users@glassfish.java.net

Re: Overriding mappings in a persistence unit

From: Marina Vatkina <Marina.Vatkina_at_Sun.COM>
Date: Thu, 15 Jun 2006 10:57:32 -0700

Vince,

You'll need to add an orm.xml in the same META-INF/ as your persistence.xml
with the mapping information, and redeploy the app.

thanks,
-marina

vince kraemer wrote:
> Say I have a persistence unit created against a database, with the
> mapping defined in the annotations.
>
> After my war or ear that uses that persistence unit is in production for
> a while, the DBA realizes that they need to tweak the database schema,
> creating a database'...
>
> How would I modify my PU without recompiling the classes?
>
> Could I change the mapping without reconstructing the PU in any manner
> at all?
>
> Back in the bad old days, I could change the mapping in the data in the
> JSR-88 plan file (since it was vendor specific) and redeploy my
> ejbjar/ear file...
>
> Is JPA/EJB3/JavaEE5 flexible enough to do that?
>
> vbk
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>