-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Get the value of the IndexColumn
PostPosted: Thu Mar 18, 2010 7:27 pm 
Newbie

Joined: Fri Oct 17, 2008 1:30 pm
Posts: 2
Is it possible to access the value of the IndexColumn from within an entity? If so, how?

Thanks!


Top
 Profile  
 
 Post subject: Re: Get the value of the IndexColumn
PostPosted: Fri Mar 19, 2010 7:07 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
I guess you mean that you have a entity which referenced in a persistent collection mapped as list,
and you want to know on which index it is stored?

Class A ----OneToMany---> class B

Code:
List allBs = a.getAllBs();
int index = allBs.indexOf(b); 

I believe this should correspond to the value in the index-column (test it).


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.