[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.rt.eclipselink] Re: unidirectional one-to-many mapping with join column

This is something we are working on for EclipseLink 1.1. In EclipseLink 1.0 you can map the relationship using a DescriptorCustomizer and use either a OneToManyMapping or AggregateCollectionMapping.

For the OneToManyMapping, you will need to map the foreign key in the target object some how, either Basic or ManyToOne (of coarse then you could just use JPA as normal).

For AggregateCollectionMapping the target object needs to be treated like an Embeddable and marked as an aggregateCollectionDescriptor.

In general the best way to model a OneToMany is to either have a ManyToOne back, or use a join table.

-- James