title: JPA + StoredProcedureCall + object type IN parameter
body: <p>I'm trying to do a simple thing: call stored procedure which have a object type parameter.</p>
  
  <p>This is what I have in db:</p>
  
  <pre><code>create or replace
  TYPE TEST_TYPE AS OBJECT 
  (
    test_field varchar(100)
  )
  </code></pre>
  
  <p>and</p>
  
  <pre><code>CREATE OR REPLACE PROCEDURE TEST_PROC 
  (
    PARAM1 IN TEST_TYPE 
  ) AS 
  BEGIN
  END TEST_PROC;
  </code></pre>
  
  <p>This is what I have in my java code:</p>
  
  <pre><code>@Embeddable
  @Struct(name = "TEST_TYPE", fields = {"TEST_FIELD"})
  public class TestStruct
  {
  
      private String testField;
  
      public String getTestField() {
          return testField;
      }
  
      public void setTestField(String testField) {
          this.testField = testField;
      }
  }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>    @PostConstruct
      public void init()
      {
  
          StoredProcedureCall call = new StoredProcedureCall();
          call.setProcedureName("TEST_PROC");
          call.addNamedArgument("PARAM1", "PARAM1", Types.STRUCT, "TEST_TYPE", TestStruct.class);
  
          DataReadQuery dataReadQuery = new DataReadQuery(call);
          dataReadQuery.addArgument("PARAM1");
  
          TestStruct testStruct = new TestStruct();
          List args = new ArrayList();
          args.add(testStruct);
  
          Object result = ((EntityManagerImpl)em.getDelegate()).getSession().executeQuery(dataReadQuery,args);
      }
  </code></pre>
  
  <p>this is what I get in runtime:</p>
  
  <pre><code>Internal Exception: java.sql.SQLException: Invalid column type
  Error Code: 17004
  Call: BEGIN TEST_PROC(PARAM1=&gt;?); END;
      bind =&gt; [1 parameter bound]
  Query: DataReadQuery()
  </code></pre>
  
  <p>I think I totally don't understand the subject of usage structs with JPA</p>
  
  <p>please help me, good people :)</p>
  
  <p>What is the shortest way to make this working?</p>