I think you might need to provide some more information for someone to help with this. Could you share your POJO's so we can see how you built the relationships betwen Manager and Employees. Are you trying to retrieve one Manager and a List of Employees? If the relationships are set up correctly it should just be a matter of fetching the Manager by id and the List of Employees will come with it [however you may have to read the list to avoid lazy loading issues].
HTH, Nathan ----- Original Message ----- From: "Lucky123" <[EMAIL PROTECTED]> To: users@appfuse.dev.java.net Sent: Thursday, October 4, 2007 2:13:00 PM (GMT-0800) America/Los_Angeles Subject: Re: [appfuse-user] Hibernate Example.create I have two entities stored in seperate database tables - Employee - Manager Every Employee has a Manager(or vice versa: Every Manager has several Employees) Get Manager with his employees. I tried Hibernate Query by example, but it is not returning anything.. Criteria criteria = session.createCriteria(Manager.class). add(Example.create(manager).excludeZeroes()); if(manager.getEmployee() != null) { criteria.createCriteria("employee").add( Example.create(manager.getEmployee()).excludeZeroes()); } Can anybody help. Thanks -- View this message in context: http://www.nabble.com/Hibernate-Example.create-tf1278198s2369.html#a13048884 Sent from the AppFuse - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]