Hi,

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.

-mike

On Wed, Mar 23, 2011 at 2:01 AM, LongkerDandy <[email protected]>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
>

Reply via email to