[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [eclipselink-users] Physical table name derived from a property
|
For a single persistence unit/session a class can only map to a single table.
I would recommend you consider having two subclasses for each table.
You could also have two different persistence units/session that each map
the class to a different table. You could also map the class to a view, and
use triggers in the view to decide which table to write to.
Ulrich Fuchs wrote:
>
> I am trying to cope with a situation, where the physical table name is
> derived from a property of the entities which must be managed.
>
> so, basically, for a class
>
> public class foo ()
> {
> String company;
> String getCompany () {return company;}
>
> String somePropertyOfFoo,
> ....
> }
>
> the persistancy engine should create an "insert into foo_001...", if
> getCompany() returns "001", an "insert into foo_002...", if getCompany()
> returns 002 and so on. Of course, not only for inserts, but also for
> updates, deletes...
>
> Is there any way to do this with the eclipselink API (not talking about
> the annotation way)?
>
> Best Regards,
> Uli
>
-----
---
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland
http://www.eclipse.org/eclipselink/
EclipseLink , http://www.oracle.com/technology/products/ias/toplink/
TopLink
Wiki: http://wiki.eclipse.org/EclipseLink EclipseLink ,
http://wiki.oracle.com/page/TopLink TopLink
Forums: http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink ,
http://www.nabble.com/EclipseLink-f26430.html EclipseLink
Book: http://en.wikibooks.org/wiki/Java_Persistence Java Persistence
--
View this message in context: http://www.nabble.com/Physical-table-name-derived-from-a-property-tp20221536p20227356.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.