openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Zenzin <>
Subject Fwd: orm.xml does not override annotations
Date Fri, 03 Apr 2009 00:19:12 GMT

I need to use both annotations and orm.xml to be able sometimes override
mapping defined with annotations in the compiled file. According to manual:

*Persistence metadata is specified using either the Java 5 annotations
defined in the javax.persistence package, XML mapping files, or a mixture of
both. In the latter case, XML declarations override conflicting annotations.

I have created and attached test case where I use orm.xml to override a
column name: class org.intalio.tempo.workflow.task.Task has field _id which
is mapped to column "TID" by use of annotations. In file orm.xml I map this
same field to column "ITD" and expect OpenJPA to create DB schema
accordingly (openjpa.jdbc.SynchronizeMappings=buildSchema). But my test
shows that it does not happen, i.e. *mapping defined in orm.xml does not
impact or override mapping defined with annotations*.

Where did I miss something, is this a bug?

Thank you,
Oleg Zenzin

ps. please change file extention to "zip". It contains project descriptors
for IntelliJ IDEA, Eclipse and build scripts for
Buildr<>and ant. Unfortunately I was not able
to ship all libs due to size
restrictions. I've deleted derby-, junit-4.4.jar and
commons-collections-3.2.jar. Also projects contain paths to my local m2
repository, you might need to change them.

  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message