Quick answer, you can use the openjpa.jdbc.Schema property at EMF creation time. IIRC this won't work with EMF injection though.
A kludgy way to go would be to not define a schema in p.xml or in the entities and let it pick up the default schema from your datasource. If you can use a resource reference in persistence.xml then you can map the resource reference to different datasources at deploy time. You'd have to set a custom property on the datasource (or use different logins) to get different schemas - but it should work. Otherwise I think there'd have to be some additional hooks in the app server at deploy time. hth -mike On Thu, Jan 19, 2012 at 12:25 AM, yu wang <[email protected]> wrote: > Hello gurus, > When I were developing J2EE APP with OpenJPA, the db schema name is > hard-coded into the annotation of Bean files and persistence.xml > file, > which incurs user cannot configure their DB schema name for the apps. > > Are there any chances we can let users determine their DB schema name > when they deploy the J2ee app employing OpenJPA? > > Best Regards, > Yu Wang >
