openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Dick <>
Subject Re: Should l use bidirectional relations or not?
Date Wed, 23 Mar 2011 13:29:10 GMT

It's hard to come up with an all encompassing guide for bidirectional vs
unidirectional relationships, since this will depend on your application to
a large extent. I find a bidiriectional relationship more intuitive so I use
them unless I have a good reason to make them unidirectional. That's just my
rule of thumb, other users may be able to expand on it.

Having OpenJPA generate the database tables once and using that as a
template for your production environment is fine. Having OpenJPA always keep
your table definitions up to date (using the
openjpa.jdbc.SynchronizeMappings property) while you're running in
production is not something I'd recommend.

Basically you should generate the tables once and use those table
definitions until you roll out a new version of the application or otherwise
need to change the schema.


On Wed, Mar 23, 2011 at 2:01 AM, LongkerDandy <>wrote:

> Hi
> Is there a best practice or something, that when should I use bidirectional
> relations?
> Currently I let openjpa to generate DB tables, is that OK for production?
> Thanks
> LongkerDandy

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