-->
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: Can HIbernate do this magic ?
PostPosted: Thu May 13, 2010 2:35 am 
Newbie

Joined: Wed Mar 10, 2010 12:03 pm
Posts: 7
Hi ..

I have a little problem with hibernate and I'm not even sure how to search for it on google.

So here it goes.

I have several entity tables (entity1, entity2, entity3) and I have a Tag table. To connect them together I created many to many tables entity1_tag, entity2_tag, entity3_tag. I separated them, because I know now that these tables will be huge. So I'm writing a a method that loads my entities by Tag. Is there a way for hibernate to load all entity records for desired tag or I have to load this manualy for each many to many relation?

for example: if I execute method
List entities = EntityLoader.loadByTag(MyTag);

I would like to get all entities. Entity1, Entity2, Entity3 ( of course if all entities were tagged by the same tag)

Is there a way to achieve that and how ? Also any examples would be much appreciated

Kind regards

Armando


Top
 Profile  
 
 Post subject: Re: Can HIbernate do this magic ?
PostPosted: Tue May 18, 2010 11:37 am 
Regular
Regular

Joined: Tue May 11, 2010 5:50 pm
Posts: 54
Location: Norman, Ok, U.S.A
I don't understand your question. Are you saying that each entity would have many tags and those tags would have their own table?
Can you add your Entity class here?


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.