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