Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Dynamically changing name of JPA Table via @Table(name=..)

843830Nov 13 2008 — edited Nov 14 2008
In my application I need to change dynamically the name of a table to create, which is annotated
via @Table(name="MyTable")

The problem is that the application handled all tables with an internal prefix so that MyTable would
be changed to something like "application1_MyTable". In xml mappings it is possible by injecting
a modified version of the xml mapping content, in plain jdbc only dynamic statements must be used
for this kind of renaming. But how can I achive this with (immutable) annotations?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 12 2008
Added on Nov 13 2008
4 comments
1,963 views