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 <[email protected]>:

> 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.
>

Reply via email to