Cannot populate table with Arquillian Persistence yml when jpa has table and Schema
casta_oh Apr 22, 2014 9:05 AMHi all.
I have one JPA like this:
@Entity @Table(name="CATE_MVTO_PERSONA", schema="JPA_PART_ORAPOS") @NamedQueries({ @NamedQuery(name = CateMvtoPersonaJPA.FIND_BY_ID, query = "SELECT o FROM CateMvtoPersonaJPA o WHERE o.id.persona = :persona AND o.id.identMov = :identMov"), @NamedQuery(name = CateMvtoPersonaJPA.FIND, query = "SELECT o FROM CateMvtoPersonaJPA o WHERE o.id.persona = :persona") })
As you can see, due to business requirements I must have the name of the schema in the jpa, not in the persistence.xml.
I want to test my EJB managing this JPA with Entity Persistence. To do this, I use arquillian persistence to populate the table CATE_MVTO_PERSONA with a file yml like this:
CATE_MVTO_PERSONA: - PERSONA: "123456" IDENT_MOV: "identificador1" ID_CATEGORIA: "121212" IND_HABILITADO: "N"
I have managed to populate the table if my jpa doesn`t have the annotation schema, but I need to populate the table with the schema name in the JPA.
I have googled a lot searching a possible solution for this, but no luck finding a solution.
Please, may somebody help me telling me how to do this?
I have already tried:
JPA_PART_ORAPOS.CATE_MVTO_PERSONA: - PERSONA: "123456" IDENT_MOV: "identificador1" ID_CATEGORIA: "121212" IND_HABILITADO: "N"
With no luck.
This is my persistence.xml:
<persistence-unit name="ebkextracto_categorias_pu" transaction-type="JTA"> <jta-data-source>jdbc/arquillian</jta-data-source> <class>com.gneis.ebkextracto.jpa.CateClaveConceptoJPA</class> <class>com.gneis.ebkextracto.jpa.CateConceptoPersJPA</class> <class>com.gneis.ebkextracto.jpa.CateConceptoPersJPAPK</class> <class>com.gneis.ebkextracto.jpa.CateConPersonalizadoJPA</class> <class>com.gneis.ebkextracto.jpa.CateConPersonalizadoJPAPK</class> <class>com.gneis.ebkextracto.jpa.CateDesPersonaJPA</class> <class>com.gneis.ebkextracto.jpa.CateDesPersonaJPAPK</class> <class>com.gneis.ebkextracto.jpa.CateMvtoPersonaJPA</class> <class>com.gneis.ebkextracto.jpa.CateMvtoPersonaJPAPK</class> <class>com.gneis.ebkextracto.jpa.Game</class> <properties> <property name="eclipselink.ddl-generation" value="drop-and-create-tables"/> <property name="eclipselink.logging.level.sql" value="FINE"/> <property name="eclipselink.logging.parameters" value="true"/> </properties> </persistence-unit>
Arquillian creates the datasource. The problem is evolved in yml + schema JPA.
Maybe I can use xml or a sql query?
Regards