openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Dick <michael.d.d...@gmail.com>
Subject Re: about variable DB schema name support
Date Sat, 21 Jan 2012 16:57:03 GMT
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 <wangyumi@gmail.com> 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
>

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