Skip to main content



      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 13:43 Go to next message
Eclipse UserFriend
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 09:37 Go to previous message
Eclipse UserFriend
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
Previous Topic:OneToMany two times
Next Topic:EclipseLink - ordering of tables for join statement
Goto Forum:
  


Current Time: Tue Jul 22 21:17:51 EDT 2025

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

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

Back to the top