Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] pojo mapping

Does your object model not have an owner attribute? Do you not need a relationship? I am surprised mapping the id through the owner attribute did not work for you? What was the problem you encountered?
--Gordon

WP Moore-Taylor wrote:
Sorry had already tried that with no luck, not using JPA because we like pojo's and workbench.

if you change the object to both having just id and text and only add in a relation ship attribute if need be. that will do as a basic example. to get the two tables and object sharing a common id value.

thanks


On 19/06/2009 13:36:22, Gordon Yorke (gordon.yorke@xxxxxxxxxx) wrote:
> Map the Menu.owner to the ID column. You can then remove the id
> attribute from Menu or map it as readonly. If you map it as readonly
> you will have to ensure in your setOwner method to set the id attribute
> to the id of Item or new instances will not have the id attribute
> populated until refreshed from the database. If you do not want to add
> this code to your setter or setting the ID value is not occurring as you
> need because of when sequences are allocated you can also write a
> postClone and postMerge event listener to ensure the value is placed in
> the Menu.id.
>
> if you would like more details feel free to ask.
> Also is there a particular reason you have chosen to not use the Java
> Persistence APIs?
> --Gordon
>
> WP Moore-Taylor wrote:
> > Can some one give me so help with this, I have 2 classes pojos mapped
> > to 2 tables using the workbench, item and menu.
> > Item uses a default sequencing and menus Id prim key needs to be the
> > same values as items. I know it can be done but can not getting it



Back to the top