title: How to pass Array of complex objects as a IN parameter in a stored procedure using JPA 2
body: <p>I am trying to call an Oracle stored procedure</p>
  
  <pre><code>create or replace 
    procedure save_item (
                              item_arr__p in     complex_list__t,
                              status__p           out varchar2,
                              status_message__p   out varchar2) is
  ...
  begin
  ...
  end
  </code></pre>
  
  <p>And the complex_list__t type is defined like this:</p>
  
  <pre><code>create or replace 
  type complex_list__t is table of simple_list__t
  </code></pre>
  
  <p>And the simple_list__t type is defined like this:</p>
  
  <pre><code>create or replace 
  type simple_list__t  is table of varchar2(2000)
  </code></pre>
  
  <p>I want to call this procedure using JPA 2. I am not sure that JPA supports arrays as parameters.
  I would like to be able to do this:</p>
  
  <pre><code>StoredProcedureQuery query = em.createNamedStoredProcedureQuery("pkg_api_wd_item.save_item");
  query.registerStoredProcedureParameter("item_arr__p", MyComplexObject[].class, ParameterMode.IN);
  query.registerStoredProcedureParameter("status__p", String.class, ParameterMode.OUT);
  query.registerStoredProcedureParameter("status_message__p", String.class, ParameterMode.OUT);
  
  query.setParameter("item_arr__p", myobjects);
  query.execute();
  
  String status = (String) query.getOutputParameterValue("status__p");
  String message = (String) query.getOutputParameterValue("status_message__p");
  </code></pre>
  
  <p>I really would like to use JPA as I want my application to be agnostic (no oracle dependencies).</p>
  
  <p>If it is not supported by JPA, Can I instead use a CLOB parameter instead of my array? </p>