Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » ManyToOne only have the IDs in a collection not the whole object
ManyToOne only have the IDs in a collection not the whole object [message #454344] Sat, 01 August 2009 17:43 Go to next message
Philipp Kursawe is currently offline Philipp KursaweFriend
Messages: 135
Registered: July 2009
Senior Member
Hello!

I wonder if its possible to fetch only the IDs of the associated
collection objects instead of the full blown entity. Lets say I have a
User object hat can have 0..n orders assigned to him. But I only want to
have the order IDs in the collection in the User entity.
Collection<String> orders;
instead of
Collection<UserOrder> orders;

Any ideas?

Thanks
Phil
Re: ManyToOne only have the IDs in a collection not the whole object [message #480785 is a reply to message #454344] Tue, 18 August 2009 13:37 Go to previous message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

You can use a @BasicCollection in EclipseLink (1.1) or an
@ElementCollection in JPA 2.0 (EclipseLink 2.0) to define this type of
relationship. You would probably also want to make the relationship
read-only.

---
James


James : Wiki : Book : Blog : Twitter
Previous Topic:OneToMany two times
Next Topic:EclipseLink - ordering of tables for join statement
Goto Forum:
  


Current Time: Thu Apr 25 00:35:05 GMT 2024

Powered by FUDForum. Page generated in 0.02910 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top