This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Hibernate bidirectional manyToOne: How to get Index easily. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate bidirectional manyToOne: How to get Index easily." Watch "Hibernate bidirectional manyToOne: How to get Index easily." New topic
Author

Hibernate bidirectional manyToOne: How to get Index easily.

Manuel Petermann
Ranch Hand

Joined: Jul 19, 2011
Posts: 175

Hello again.
Lets say we got a customer with orders attached to it.


So is there an easier way than doing:


in an instance of Order. Because that seems to be a little too excessive.
All I want is the index in the array.

Thanks.


Please correct my English.
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3817

If you frequently need this then it might better to have a method for just that?


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Manuel Petermann
Ranch Hand

Joined: Jul 19, 2011
Posts: 175

Of course, but I thought that it might be possible to map this value to an int in the right entity.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Hibernate bidirectional manyToOne: How to get Index easily.
 
Similar Threads
Hibernate 3 Annotations
JPA CascadeType enquiry
JPA - need help with query
Java Persistence API
JPA MappingException: Repeated column in mapping for entity