-->
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.  [ 1 post ] 
Author Message
 Post subject: Question Regarding Accessing UniDirectional Associations.
PostPosted: Wed Aug 17, 2005 11:39 am 
Beginner
Beginner

Joined: Mon Aug 15, 2005 4:37 pm
Posts: 27
Location: Washington DC
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp


Hibernate version:3.0.5

My question is a more general question.
I have a class A linked through a unidirectional 1-* association to class B.
At the DB level, i have a foreign key in the class B which is the primary key of class A. Staying at Class B i want to retrieve class B objects based on this foreign key value.
At the Class level, i will have an instance of class A with get/set methods in Class B.
Is this possible? I am using criteria queries cos they are more flexible at run-time in that i don't need to know the class type and parameters at compile time making it more general as a search Command object for different objects.

So is there a way using Criteria Queries to retrieve Associations (basically based on setting foreign key values-meaning i set the value to be used as a search criteria on an object instance of class A and set that object to the instance of Class B and use that class B instance to search for records in table B)? I can't use the other queryting techniques cos i don't know the class types at compile time.

Thanks,
Surya


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

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.