You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by ludo <lu...@chronopost.fr> on 2015/11/26 14:35:32 UTC

EJB CMP and orm.xml / mapping

Hello TomEE guys! 

I'm trying tio get running ejb cmp, (sources are below)
Work fine when java attributes and column names in database are the same.
But in real life, java attributes and column names are sometimes different. 
and I can't  use annotation (java classes must be 1.4 compliant)

My simple table MOVIE:


I add an orm.xml file:
 

and then:
1/ - I get an exception when I try to create a new bean:
26 nov. 2015 14:34:13 org.apache.openejb.core.transaction.EjbTransactionUtil
handleSystemException
GRAVE: EjbTransactionUtil.handleSystemException: null keys not allowed
<openjpa-2.4.0-r422266:1674604 fatal general error>
org.apache.openjpa.persistence.PersistenceException: null keys not allowed

2/ - openjpa alter table to add a new column : director varchar(255)
regardless the column definition to map this field to column name
col_director

How to configure orm.xml to solve these two problems ?

I'm running tomee 1.7.2 plus. 

Thank you in advance for any help! 
Ludo



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/EJB-CMP-and-orm-xml-mapping-tp4676983.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: EJB CMP and orm.xml / mapping

Posted by ludo <lu...@chronopost.fr>.
Hi Hugo,

I didn't find a solution. I migrated to bmp ejb.



--
Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html

Re: EJB CMP and orm.xml / mapping

Posted by lebegue_h <hl...@toolwire.com>.
Ludo, 

I have the same problem n Tomee 7.1 

In my case the EAR contains persistence.xml  in EAR/META-INF 

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0"
	xmlns="http://java.sun.com/xml/ns/persistence"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
	<persistence-unit name="cmp" transaction-type="JTA">
		<description></description>
		<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
		<jta-data-source>TWConnectionPool</jta-data-source>
		<mapping-file>META-INF/openejb-cmp-generated-orm.xml</mapping-file>'
		<validation-mode>AUTO</validation-mode>
		<properties>
			<property name="hibernate.dialect"
				value="org.hibernate.dialect.Oracle10gDialect" />
			<property name="hibernate.show_sql" value="true" />
			<property name="hibernate.format_sql" value="true" />
			<property name="openjpa.Log" value="DefaultLevel=TRACE" />
		</properties>
	</persistence-unit>
</persistence>

and the EAR/META-INF/openejb-cmp-generated-orm.xml as follow 
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm
orm_1_0.xsd"
    version="1.0">
    
    <entity
class="openejb.com.toolwire.training.account.ejb.entity.account.Account"
name="Account">
        <description>account#Account</description>
        <named-query name="Account.findByLoginName(java.lang.String)">
            <query>SELECT OBJECT(e) FROM Account e WHERE e.loginName =
?1</query>
        </named-query>
        <named-query name="Account.findByCustomerId(java.lang.Long)">
            <query>SELECT OBJECT(e) FROM Account e WHERE e.customerId =
?1</query>
        </named-query>
        

        <attributes>
            <id name="accountId" access="PROPERTY">
            	<column>account_id</column>
            </id>
            <basic name="lvContractId" access="PROPERTY">
            	<column>lv_contract_id</column>
            </basic>
            <basic name="lastName" access="PROPERTY">
            	<column name="last_name"/>
            </basic>
            <basic name="firstName" access="PROPERTY">
            	<column name="first_name"/>
            </basic>
            <basic name="emailWork" access="PROPERTY">
            	<column name="email_work"/>
            </basic>
            <basic name="passwdHint" access="PROPERTY">
            	<column name="passwd_hint"/>
            </basic>
            <basic name="passwd" access="PROPERTY"/>
            <basic name="loginName" access="PROPERTY">
            	<column name="login_name"/>
            </basic>
            <basic name="customerId" access="PROPERTY">
            	<column name="customer_id"/>
            </basic>
        </attributes>
    </entity>
</entity-mappings>

At runtime, the JPA is failing to map the fields of the CMP bean to the
column as defined by the persistence.xml 


197110  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.Runtime -
Found datasource1: datasource 120478350 from configuration. StoreContext:
org.apache.openjpa.kernel.BrokerImpl@40823751
197120  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
Scanning directory "C:\_tomee\webapps\training" for persistent types.
197332  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
Scanning resource "META-INF/openejb-cmp-generated-orm.xml" for persistent
types.
197333  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData - The
persistent unit root url is "file:/C:/_tomee/webapps/training/"
197339  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData - The
resource url is
"jar:file:/C:/_tomee/tmp/OpenEJBGenerated.5086304005382265880.jar!/META-INF/openejb-cmp-generated-orm.xml"
197342  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
Mapping file name is "META-INF/openejb-cmp-generated-orm.xml"
197347  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
Mapping file name is "META-INF/openejb-cmp-generated-orm.xml"
197350  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
Scan of "META-INF/openejb-cmp-generated-orm.xml" found persistent types
[openejb.com.toolwire.training.account.ejb.entity.account.Account,
openejb.com.toolwire.training.contract.ejb.entity.contract.Contract,
openejb.com.toolwire.training.customer.ejb.entity.customer.Customer].
197351  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
Mapping resource location
"jar:file:/C:/_tomee/tmp/OpenEJBGenerated.5086304005382265880.jar!/META-INF/openejb-cmp-generated-orm.xml"
to persistent types
"[openejb.com.toolwire.training.account.ejb.entity.account.Account,
openejb.com.toolwire.training.contract.ejb.entity.contract.Contract,
openejb.com.toolwire.training.customer.ejb.entity.customer.Customer]".
197357  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
Scan of "META-INF/openejb-cmp-generated-orm.xml" found persistent types
[openejb.com.toolwire.training.account.ejb.entity.account.Account,
openejb.com.toolwire.training.contract.ejb.entity.contract.Contract,
openejb.com.toolwire.training.customer.ejb.entity.customer.Customer].
197358  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
Mapping resource location
"jar:file:/C:/_tomee/tmp/OpenEJBGenerated.5086304005382265880.jar!/META-INF/openejb-cmp-generated-orm.xml"
to persistent types
"[openejb.com.toolwire.training.account.ejb.entity.account.Account,
openejb.com.toolwire.training.contract.ejb.entity.contract.Contract,
openejb.com.toolwire.training.customer.ejb.entity.customer.Customer]".
197360  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
Scanning resource "META-INF/openejb-cmp-generated-orm.xml" for persistent
types.
197361  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData - The
persistent unit root url is "file:/C:/_tomee/webapps/training/"
197368  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData - The
resource url is
"jar:file:/C:/_tomee/tmp/OpenEJBGenerated.5086304005382265880.jar!/META-INF/openejb-cmp-generated-orm.xml"
197369  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
Mapping file name is "META-INF/openejb-cmp-generated-orm.xml"
197372  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
Mapping file name is "META-INF/openejb-cmp-generated-orm.xml"
197378  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
Scan of "META-INF/openejb-cmp-generated-orm.xml" found persistent types
[openejb.com.toolwire.training.account.ejb.entity.account.Account,
openejb.com.toolwire.training.contract.ejb.entity.contract.Contract,
openejb.com.toolwire.training.customer.ejb.entity.customer.Customer].
197382  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
Mapping resource location
"jar:file:/C:/_tomee/tmp/OpenEJBGenerated.5086304005382265880.jar!/META-INF/openejb-cmp-generated-orm.xml"
to persistent types
"[openejb.com.toolwire.training.account.ejb.entity.account.Account,
openejb.com.toolwire.training.contract.ejb.entity.contract.Contract,
openejb.com.toolwire.training.customer.ejb.entity.customer.Customer]".
197393  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
Scan of "META-INF/openejb-cmp-generated-orm.xml" found persistent types
[openejb.com.toolwire.training.account.ejb.entity.account.Account,
openejb.com.toolwire.training.contract.ejb.entity.contract.Contract,
openejb.com.toolwire.training.customer.ejb.entity.customer.Customer].
197394  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
Mapping resource location
"jar:file:/C:/_tomee/tmp/OpenEJBGenerated.5086304005382265880.jar!/META-INF/openejb-cmp-generated-orm.xml"
to persistent types
"[openejb.com.toolwire.training.account.ejb.entity.account.Account,
openejb.com.toolwire.training.contract.ejb.entity.contract.Contract,
openejb.com.toolwire.training.customer.ejb.entity.customer.Customer]".
197400  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
Scanning resource "META-INF/orm.xml" for persistent types.
197402  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData - The
persistent unit root url is "file:/C:/_tomee/webapps/training/"
197407  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
parsePersistentTypeNames() found
[openejb.com.toolwire.training.customer.ejb.entity.customer.Customer,
openejb.com.toolwire.training.account.ejb.entity.account.Account,
openejb.com.toolwire.training.contract.ejb.entity.contract.Contract].
197409  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
Found 3 classes with metadata in 289 milliseconds.
197425  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.Runtime -
org.apache.openjpa.persistence.EntityManagerFactoryImpl@4f053071 created
EntityManager org.apache.openjpa.persistence.EntityManagerImpl@40823751.
197432  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
Loading metadata for "class
openejb.com.toolwire.training.customer.ejb.entity.customer.Customer" under
mode "[META][QUERY]".
197458  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
Parsing resource
"jar:file:/C:/_tomee/tmp/OpenEJBGenerated.5086304005382265880.jar!/META-INF/openejb-cmp-generated-orm.xml".
197461  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
Overriding thread context classloader from
"java.net.URLClassLoader@6b31f684" to "java.net.URLClassLoader@4dcbadb4".
197478  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
Parsing class
"openejb.com.toolwire.training.account.ejb.entity.account.Account".
197492  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.Runtime -
Access style for
"openejb.com.toolwire.training.account.ejb.entity.account.Account" can not
be determined.  The default "implicit field access" will be used. If this
access style is not correct, specify the correct style explicitly on the
persistent type or within the mapping file.
197493  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
Generating default metadata for type
"openejb.com.toolwire.training.account.ejb.entity.account.Account".
197506  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
Parsing class
"openejb.com.toolwire.training.account.ejb.entity.account.Account".
197507  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
Parsing package
"openejb.com.toolwire.training.account.ejb.entity.account.Account".
197510  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
Parsing query "Account.findByLoginName(java.lang.String)".
197513  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
Parsing query "Account.findByCustomerId(java.lang.Long)".
197514  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
Parsing class
"openejb.com.toolwire.training.contract.ejb.entity.contract.Contract".
197516  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.Runtime -
Access style for
"openejb.com.toolwire.training.contract.ejb.entity.contract.Contract" can
not be determined.  The default "implicit field access" will be used. If
this access style is not correct, specify the correct style explicitly on
the persistent type or within the mapping file.
197520  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
Generating default metadata for type
"openejb.com.toolwire.training.contract.ejb.entity.contract.Contract".
197526  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
Parsing class
"openejb.com.toolwire.training.contract.ejb.entity.contract.Contract".
197528  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
Parsing package
"openejb.com.toolwire.training.contract.ejb.entity.contract.Contract".
197531  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
Parsing query "Contract.findByCustomerId(java.lang.Long)".
197533  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
Parsing class
"openejb.com.toolwire.training.customer.ejb.entity.customer.Customer".
197540  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.Runtime -
Access style for
"openejb.com.toolwire.training.customer.ejb.entity.customer.Customer" can
not be determined.  The default "implicit field access" will be used. If
this access style is not correct, specify the correct style explicitly on
the persistent type or within the mapping file.
197542  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
Generating default metadata for type
"openejb.com.toolwire.training.customer.ejb.entity.customer.Customer".
197548  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
Parsing class
"openejb.com.toolwire.training.customer.ejb.entity.customer.Customer".
197550  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
Parsing package
"openejb.com.toolwire.training.customer.ejb.entity.customer.Customer".
197557  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
Parsing query "Customer.findAll".
197558  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
Finished parsing metadata resource
"jar:file:/C:/_tomee/tmp/OpenEJBGenerated.5086304005382265880.jar!/META-INF/openejb-cmp-generated-orm.xml".
197559  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
Restoring thread context classloader from "java.net.URLClassLoader@4dcbadb4"
to "java.net.URLClassLoader@6b31f684".
197563  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData - Set
persistence-capable superclass of
"openejb.com.toolwire.training.customer.ejb.entity.customer.Customer" to
"null".
197569  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
Resolving metadata for
"openejb.com.toolwire.training.customer.ejb.entity.customer.Customer@615703274".
197570  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.customer.ejb.entity.customer.Customer@615703274.confExit".
197576  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.customer.ejb.entity.customer.Customer@615703274.customerId".
197577  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.customer.ejb.entity.customer.Customer@615703274.customerName".
197579  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.customer.ejb.entity.customer.Customer@615703274.customerShortName".
197582  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.customer.ejb.entity.customer.Customer@615703274.qtreeMode".
197588  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
Preparing mapping for
"openejb.com.toolwire.training.customer.ejb.entity.customer.Customer".
197589  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
Processing registered persistence-capable class "class
openejb.com.toolwire.training.contract.ejb.entity.contract.Contract".
197590  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
Processing registered persistence-capable class "class
openejb.com.toolwire.training.account.ejb.entity.account.Account".
197592  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
Processing registered persistence-capable class "class
openejb.com.toolwire.training.customer.ejb.entity.customer.Customer".
197601  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.customer.ejb.entity.customer.Customer@615703274.customerId".
197610  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
"customerId" has mapping strategy
"org.apache.openjpa.jdbc.meta.strats.HandlerFieldStrategy".
197611  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.customer.ejb.entity.customer.Customer@615703274.confExit".
197618  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
"confExit" has mapping strategy
"org.apache.openjpa.jdbc.meta.strats.StringFieldStrategy".
197619  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.customer.ejb.entity.customer.Customer@615703274.customerName".
197625  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
"customerName" has mapping strategy
"org.apache.openjpa.jdbc.meta.strats.StringFieldStrategy".
197626  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.customer.ejb.entity.customer.Customer@615703274.customerShortName".
197627  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
"customerShortName" has mapping strategy
"org.apache.openjpa.jdbc.meta.strats.StringFieldStrategy".
197629  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.customer.ejb.entity.customer.Customer@615703274.qtreeMode".
197632  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
"qtreeMode" has mapping strategy
"org.apache.openjpa.jdbc.meta.strats.StringFieldStrategy".
197638  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
"openejb.com.toolwire.training.customer.ejb.entity.customer.Customer<discriminator>"
has mapping strategy "none".
197641  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
"openejb.com.toolwire.training.customer.ejb.entity.customer.Customer<version>"
has mapping strategy "none".
197642  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
Resolving mapping for
"openejb.com.toolwire.training.customer.ejb.entity.customer.Customer@615703274".
197647  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
"openejb.com.toolwire.training.customer.ejb.entity.customer.Customer" has
mapping strategy "full".
197652  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
Initializing mapping for
"openejb.com.toolwire.training.customer.ejb.entity.customer.Customer@615703274".
197657  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.customer.ejb.entity.customer.Customer@615703274.confExit".
197660  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.customer.ejb.entity.customer.Customer@615703274.customerId".
197668  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.customer.ejb.entity.customer.Customer@615703274.customerName".
197671  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.customer.ejb.entity.customer.Customer@615703274.customerShortName".
197675  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.customer.ejb.entity.customer.Customer@615703274.qtreeMode".
197680  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData - Set
persistence-capable superclass of
"openejb.com.toolwire.training.account.ejb.entity.account.Account" to
"null".
197683  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
Resolving metadata for
"openejb.com.toolwire.training.account.ejb.entity.account.Account@495302153".
197688  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.account.ejb.entity.account.Account@495302153.accountId".
197693  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.account.ejb.entity.account.Account@495302153.customerId".
197702  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.account.ejb.entity.account.Account@495302153.emailWork".
197708  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.account.ejb.entity.account.Account@495302153.firstName".
197714  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.account.ejb.entity.account.Account@495302153.lastName".
197718  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.account.ejb.entity.account.Account@495302153.loginName".
197727  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.account.ejb.entity.account.Account@495302153.lvContractId".
197730  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.account.ejb.entity.account.Account@495302153.passwd".
197735  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.account.ejb.entity.account.Account@495302153.passwdHint".
197740  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
Preparing mapping for
"openejb.com.toolwire.training.account.ejb.entity.account.Account".
197743  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.account.ejb.entity.account.Account@495302153.accountId".
197747  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
"accountId" has mapping strategy
"org.apache.openjpa.jdbc.meta.strats.HandlerFieldStrategy".
197754  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.account.ejb.entity.account.Account@495302153.customerId".
197759  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
"customerId" has mapping strategy
"org.apache.openjpa.jdbc.meta.strats.HandlerFieldStrategy".
197764  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.account.ejb.entity.account.Account@495302153.emailWork".
197767  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
"emailWork" has mapping strategy
"org.apache.openjpa.jdbc.meta.strats.StringFieldStrategy".
197775  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.account.ejb.entity.account.Account@495302153.firstName".
197784  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
"firstName" has mapping strategy
"org.apache.openjpa.jdbc.meta.strats.StringFieldStrategy".
197794  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.account.ejb.entity.account.Account@495302153.lastName".
197799  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
"lastName" has mapping strategy
"org.apache.openjpa.jdbc.meta.strats.StringFieldStrategy".
197805  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.account.ejb.entity.account.Account@495302153.loginName".
197810  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
"loginName" has mapping strategy
"org.apache.openjpa.jdbc.meta.strats.StringFieldStrategy".
197812  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.account.ejb.entity.account.Account@495302153.lvContractId".
197817  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
"lvContractId" has mapping strategy
"org.apache.openjpa.jdbc.meta.strats.HandlerFieldStrategy".
197822  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.account.ejb.entity.account.Account@495302153.passwd".
197826  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
"passwd" has mapping strategy
"org.apache.openjpa.jdbc.meta.strats.StringFieldStrategy".
197834  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.account.ejb.entity.account.Account@495302153.passwdHint".
197840  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
"passwdHint" has mapping strategy
"org.apache.openjpa.jdbc.meta.strats.StringFieldStrategy".
197845  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
"openejb.com.toolwire.training.account.ejb.entity.account.Account<discriminator>"
has mapping strategy "none".
197850  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
"openejb.com.toolwire.training.account.ejb.entity.account.Account<version>"
has mapping strategy "none".
197855  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
Resolving mapping for
"openejb.com.toolwire.training.account.ejb.entity.account.Account@495302153".
197859  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
"openejb.com.toolwire.training.account.ejb.entity.account.Account" has
mapping strategy "full".
197862  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
Initializing mapping for
"openejb.com.toolwire.training.account.ejb.entity.account.Account@495302153".
197869  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.account.ejb.entity.account.Account@495302153.accountId".
197873  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.account.ejb.entity.account.Account@495302153.customerId".
197878  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.account.ejb.entity.account.Account@495302153.emailWork".
197880  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.account.ejb.entity.account.Account@495302153.firstName".
197891  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.account.ejb.entity.account.Account@495302153.lastName".
197896  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.account.ejb.entity.account.Account@495302153.loginName".
197902  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.account.ejb.entity.account.Account@495302153.lvContractId".
197904  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.account.ejb.entity.account.Account@495302153.passwd".
197907  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.account.ejb.entity.account.Account@495302153.passwdHint".
197915  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData - Set
persistence-capable superclass of
"openejb.com.toolwire.training.contract.ejb.entity.contract.Contract" to
"null".
197918  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
Resolving metadata for
"openejb.com.toolwire.training.contract.ejb.entity.contract.Contract@1735776250".
197925  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.contract.ejb.entity.contract.Contract@1735776250.conference".
197928  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.contract.ejb.entity.contract.Contract@1735776250.contractId".
197936  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.contract.ejb.entity.contract.Contract@1735776250.contractName".
197940  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.contract.ejb.entity.contract.Contract@1735776250.customerId".
197946  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.contract.ejb.entity.contract.Contract@1735776250.description".
197950  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.contract.ejb.entity.contract.Contract@1735776250.maxDaysClosed".
197954  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.contract.ejb.entity.contract.Contract@1735776250.maxDaysSuspended".
197959  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.contract.ejb.entity.contract.Contract@1735776250.nDays".
197962  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.contract.ejb.entity.contract.Contract@1735776250.os".
197969  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.contract.ejb.entity.contract.Contract@1735776250.product".
197972  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.contract.ejb.entity.contract.Contract@1735776250.status".
197981  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
Preparing mapping for
"openejb.com.toolwire.training.contract.ejb.entity.contract.Contract".
197988  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.contract.ejb.entity.contract.Contract@1735776250.contractId".
197998  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
"contractId" has mapping strategy
"org.apache.openjpa.jdbc.meta.strats.HandlerFieldStrategy".
198007  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.contract.ejb.entity.contract.Contract@1735776250.conference".
198014  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
"conference" has mapping strategy
"org.apache.openjpa.jdbc.meta.strats.StringFieldStrategy".
198017  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.contract.ejb.entity.contract.Contract@1735776250.contractName".
198024  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
"contractName" has mapping strategy
"org.apache.openjpa.jdbc.meta.strats.StringFieldStrategy".
198026  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.contract.ejb.entity.contract.Contract@1735776250.customerId".
198031  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
"customerId" has mapping strategy
"org.apache.openjpa.jdbc.meta.strats.HandlerFieldStrategy".
198040  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.contract.ejb.entity.contract.Contract@1735776250.description".
198047  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
"description" has mapping strategy
"org.apache.openjpa.jdbc.meta.strats.StringFieldStrategy".
198051  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.contract.ejb.entity.contract.Contract@1735776250.maxDaysClosed".
198060  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
"maxDaysClosed" has mapping strategy
"org.apache.openjpa.jdbc.meta.strats.PrimitiveFieldStrategy".
198063  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.contract.ejb.entity.contract.Contract@1735776250.maxDaysSuspended".
198068  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
"maxDaysSuspended" has mapping strategy
"org.apache.openjpa.jdbc.meta.strats.PrimitiveFieldStrategy".
198078  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.contract.ejb.entity.contract.Contract@1735776250.nDays".
198085  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
"nDays" has mapping strategy
"org.apache.openjpa.jdbc.meta.strats.PrimitiveFieldStrategy".
198092  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.contract.ejb.entity.contract.Contract@1735776250.os".
198095  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
"os" has mapping strategy
"org.apache.openjpa.jdbc.meta.strats.StringFieldStrategy".
198100  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.contract.ejb.entity.contract.Contract@1735776250.product".
198104  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
"product" has mapping strategy
"org.apache.openjpa.jdbc.meta.strats.StringFieldStrategy".
198106  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.contract.ejb.entity.contract.Contract@1735776250.status".
198108  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
"status" has mapping strategy
"org.apache.openjpa.jdbc.meta.strats.StringFieldStrategy".
198110  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
"openejb.com.toolwire.training.contract.ejb.entity.contract.Contract<discriminator>"
has mapping strategy "none".
198115  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
"openejb.com.toolwire.training.contract.ejb.entity.contract.Contract<version>"
has mapping strategy "none".
198118  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
Resolving mapping for
"openejb.com.toolwire.training.contract.ejb.entity.contract.Contract@1735776250".
198120  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
"openejb.com.toolwire.training.contract.ejb.entity.contract.Contract" has
mapping strategy "full".
198125  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
Initializing mapping for
"openejb.com.toolwire.training.contract.ejb.entity.contract.Contract@1735776250".
198127  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.contract.ejb.entity.contract.Contract@1735776250.conference".
198129  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.contract.ejb.entity.contract.Contract@1735776250.contractId".
198135  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.contract.ejb.entity.contract.Contract@1735776250.contractName".
198137  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.contract.ejb.entity.contract.Contract@1735776250.customerId".
198139  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.contract.ejb.entity.contract.Contract@1735776250.description".
198144  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.contract.ejb.entity.contract.Contract@1735776250.maxDaysClosed".
198146  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.contract.ejb.entity.contract.Contract@1735776250.maxDaysSuspended".
198148  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.contract.ejb.entity.contract.Contract@1735776250.nDays".
198151  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.contract.ejb.entity.contract.Contract@1735776250.os".
198156  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.contract.ejb.entity.contract.Contract@1735776250.product".
198158  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -       
Resolving field
"openejb.com.toolwire.training.contract.ejb.entity.contract.Contract@1735776250.status".
198223  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
Parsing class "java.lang.String".
198238  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.Runtime -
Query "SELECT OBJECT(e) FROM Account e WHERE e.loginName = ?1" is cached."
198239  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.Query -
Executing query: [SELECT OBJECT(e) FROM Account e WHERE e.loginName = ?1]
with parameters: ?
198277  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.jdbc.SQL - <t
2082483929, conn 634155632> executing prepstmnt 134639762 SELECT
t0.accountId, t0.customerId, t0.emailWork, t0.firstName, t0.lastName,
t0.loginName, t0.lvContractId, t0.passwd, t0.passwdHint FROM Account t0
WHERE (t0.loginName = ?) [params=?]
09-Oct-2018 20:56:47.205 INFO [http-nio2-127.0.0.1-8080-exec-7]
org.apache.openejb.resource.jdbc.logging.LoggingPreparedSqlStatement.invoke
SELECT t0.accountId, t0.customerId, t0.emailWork, t0.firstName, t0.lastName,
t0.loginName, t0.lvContractId, t0.passwd, t0.passwdHint FROM Account t0
WHERE (t0.loginName = sadasdasdasd) --> 44ms - FAILED



I can see in the log (setting the log level to verose) that it did not
substitute the ccolumn names in the query 


Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: ORA-00942:
table or view does not exist
 {prepstmnt 134639762 SELECT t0.accountId, t0.customerId, t0.emailWork,
t0.firstName, t0.lastName, t0.loginName, t0.lvContractId, t0.passwd,
t0.passwdHint FROM Account t0 WHERE (t0.loginName = ?) [params=?]}
[code=942, state=42000]
        at
org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:218)
        at
org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:202)
        at
org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.access$700(LoggingConnectionDecorator.java:58)
        at
org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingPreparedStatement.executeQuery(LoggingConnectionDecorator.java:1117)
        at
org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:268)
        at
org.apache.openjpa.jdbc.kernel.JDBCStoreManager$CancelPreparedStatement.executeQuery(JDBCStoreManager.java:1800)
        at
org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:258)
        at
org.apache.openjpa.jdbc.sql.SelectImpl.executeQuery(SelectImpl.java:500)
        at
org.apache.openjpa.jdbc.sql.SelectImpl.execute(SelectImpl.java:425)
        at
org.apache.openjpa.jdbc.sql.SelectImpl.execute(SelectImpl.java:392)
        at
org.apache.openjpa.jdbc.sql.LogicalUnion$UnionSelect.execute(LogicalUnion.java:427)
        at
org.apache.openjpa.jdbc.sql.LogicalUnion.execute(LogicalUnion.java:230)
        at
org.apache.openjpa.jdbc.sql.LogicalUnion.execute(LogicalUnion.java:220)
        at
org.apache.openjpa.jdbc.kernel.SelectResultObjectProvider.open(SelectResultObjectProvider.java:93)
        at
org.apache.openjpa.lib.rop.EagerResultList.<init>(EagerResultList.java:33)
        ... 120 more


Any one has insights on this issue? I am running ot of ideas.

It seems that no mater what orm file is set for my EAR, JPA always generates
and loads it';s own 
197558  cmp  TRACE  [http-nio2-127.0.0.1-8080-exec-7] openjpa.MetaData -
Finished parsing metadata resource
"jar:file:/C:/_tomee/tmp/OpenEJBGenerated.5086304005382265880.jar!/META-INF/openejb-cmp-generated-orm.xml".

Such generation always ignores the EAR's orm XML 

Maybe it's a bug 

Hugo 





--
Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html


Re: EJB CMP and orm.xml / mapping

Posted by ludo <lu...@chronopost.fr>.
Ok forget the class name...

How just my current BIG question: how mapping "col_director" colum to
"director" java attribute ??





--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/EJB-CMP-and-orm-xml-mapping-tp4676983p4677014.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: EJB CMP and orm.xml / mapping

Posted by Romain Manni-Bucau <rm...@gmail.com>.
2015-11-27 15:10 GMT+01:00 ludo <lu...@chronopost.fr>:

> But, I have to change it !
>

the *class* name? this has no link with table name.


> MOVIE table have a column named *col_director*
> but for the java entity, the attribute name is *director*
> So, somewhere, I need to map *director* field to *col_director* column
> and I don't success. All my troubles are here.
>
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/EJB-CMP-and-orm-xml-mapping-tp4676983p4677011.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Re: EJB CMP and orm.xml / mapping

Posted by ludo <lu...@chronopost.fr>.
But, I have to change it !
MOVIE table have a column named *col_director*
but for the java entity, the attribute name is *director*
So, somewhere, I need to map *director* field to *col_director* column
and I don't success. All my troubles are here.




--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/EJB-CMP-and-orm-xml-mapping-tp4676983p4677011.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: EJB CMP and orm.xml / mapping

Posted by Romain Manni-Bucau <rm...@gmail.com>.
the class "openejb.xxx" is the generated JPA entity, why did you change it?

The fact you get an error in openjpa layer means you didnt map it
correctly. You can open generated classes with jd-gui, the jar is in /tmp
(OpenEJBGenerated*jar). Normally we dont use annotations so only orm.xml is
used.


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com>

2015-11-27 14:34 GMT+01:00 ludo <lu...@chronopost.fr>:

> Not yet, sorry, I doesn't work:
>
> I followed the 3 steps...
> Here is my persistence.xml after:
>
>
> I updated this line:
>
> to:
>
> and I try too:
>
> What's the good declaration ?
>
> Nevertheless, the result is:
>
>
> Have you already see a *working* CMP entity which java attributes mapping
> table with differents names ?
>
>
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/EJB-CMP-and-orm-xml-mapping-tp4676983p4677008.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Re: EJB CMP and orm.xml / mapping

Posted by ludo <lu...@chronopost.fr>.
Not yet, sorry, I doesn't work:

I followed the 3 steps...
Here is my persistence.xml after:


I updated this line:

to: 

and I try too:

What's the good declaration ?

Nevertheless, the result is:


Have you already see a *working* CMP entity which java attributes mapping
table with differents names ?





--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/EJB-CMP-and-orm-xml-mapping-tp4676983p4677008.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: EJB CMP and orm.xml / mapping

Posted by Romain Manni-Bucau <rm...@gmail.com>.
It is pretty easy following these steps:


1) you add cmp persistence unit (so persistence.xml)
2) you grab this generated file and add it with the persistence.xml or any
location you reference in mappings in persistence.xml
3) you update the generated file to match your needs



Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com>

2015-11-27 11:39 GMT+01:00 ludo <lu...@chronopost.fr>:

> I started tomme without orm.xml nor persistence.xml files.
> I founded in apache-tomee-plus-1.7.2/tmp dir a generated jar which contains
> METAINF/openejb-cmp-generated-orm.xml
>
> Is it the right file ?
> And now ? Do I have to split to orm.xml and persistence.xml files ?
> I don't really understand the way
>
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/EJB-CMP-and-orm-xml-mapping-tp4676983p4676995.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Re: EJB CMP and orm.xml / mapping

Posted by ludo <lu...@chronopost.fr>.
I started tomme without orm.xml nor persistence.xml files.
I founded in apache-tomee-plus-1.7.2/tmp dir a generated jar which contains
METAINF/openejb-cmp-generated-orm.xml

Is it the right file ? 
And now ? Do I have to split to orm.xml and persistence.xml files ?
I don't really understand the way 




--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/EJB-CMP-and-orm-xml-mapping-tp4676983p4676995.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: EJB CMP and orm.xml / mapping

Posted by Romain Manni-Bucau <rm...@gmail.com>.
what you did should be good but you need to define all your columns in the
orm.xml. By default tomee generate one at startup (the path is logged
IIRC). Start from this file instead of your own orm.xml (= remove your file
and persistence.xml, restart, get the file and add back persistence.xml and
orm.xml)


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com>

2015-11-27 11:13 GMT+01:00 ludo <lu...@chronopost.fr>:

> Sorry Romain,
> I dont understand what you mean, Can you explain your answer
>
> I resume:
> - I have a lot of weblogic EJB CMP to migrate to tomee
> - when java attributes in entities and column names in database are the
> same, it's ok
> - but I have to map java attributes to database with a different name
>
> Can you give me a sample to do that ?
> Thanks in advance
>
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/EJB-CMP-and-orm-xml-mapping-tp4676983p4676991.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Re: EJB CMP and orm.xml / mapping

Posted by ludo <lu...@chronopost.fr>.
Sorry Romain,
I dont understand what you mean, Can you explain your answer

I resume:
- I have a lot of weblogic EJB CMP to migrate to tomee
- when java attributes in entities and column names in database are the
same, it's ok
- but I have to map java attributes to database with a different name

Can you give me a sample to do that ?
Thanks in advance




--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/EJB-CMP-and-orm-xml-mapping-tp4676983p4676991.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: EJB CMP and orm.xml / mapping

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Did you map movie? You need to map them all as mentionned then.
Le 27 nov. 2015 10:57, "ludo" <lu...@chronopost.fr> a écrit :

> Ok, I added a persistence.xml file:
>
>
> And now, MOVIE table is no longer altered
> But I have got this exception:
>
>
> So, on one hand I set the column name to "col_director" and the table is no
> longer altered to add a fake column "director", but in the other one, I
> can't insert entity nor find them.
>
> still missing something , but what?
>
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/EJB-CMP-and-orm-xml-mapping-tp4676983p4676989.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Re: EJB CMP and orm.xml / mapping

Posted by ludo <lu...@chronopost.fr>.
Ok, I added a persistence.xml file:


And now, MOVIE table is no longer altered 
But I have got this exception:


So, on one hand I set the column name to "col_director" and the table is no
longer altered to add a fake column "director", but in the other one, I
can't insert entity nor find them.

still missing something , but what?




--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/EJB-CMP-and-orm-xml-mapping-tp4676983p4676989.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: EJB CMP and orm.xml / mapping

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi

you need to define a persistence-unit called "cmp" and link the orm.xml
file there.

Tip: use the generated orm.xml file for CMP beans to start and alter it
otherwise you will need to write the whole mapping yourself.


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com>

2015-11-26 14:35 GMT+01:00 ludo <lu...@chronopost.fr>:

> Hello TomEE guys!
>
> I'm trying tio get running ejb cmp, (sources are below)
> Work fine when java attributes and column names in database are the same.
> But in real life, java attributes and column names are sometimes different.
> and I can't  use annotation (java classes must be 1.4 compliant)
>
> My simple table MOVIE:
>
>
> I add an orm.xml file:
>
>
> and then:
> 1/ - I get an exception when I try to create a new bean:
> 26 nov. 2015 14:34:13
> org.apache.openejb.core.transaction.EjbTransactionUtil
> handleSystemException
> GRAVE: EjbTransactionUtil.handleSystemException: null keys not allowed
> <openjpa-2.4.0-r422266:1674604 fatal general error>
> org.apache.openjpa.persistence.PersistenceException: null keys not allowed
>
> 2/ - openjpa alter table to add a new column : director varchar(255)
> regardless the column definition to map this field to column name
> col_director
>
> How to configure orm.xml to solve these two problems ?
>
> I'm running tomee 1.7.2 plus.
>
> Thank you in advance for any help!
> Ludo
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/EJB-CMP-and-orm-xml-mapping-tp4676983.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>