Wednesday, 15 April 2015

hibernate - How to apply where clause for criteria fetch mode? -



hibernate - How to apply where clause for criteria fetch mode? -

i working hibernate ,i have tables user & address 1 many relationship. please check code below

criteria crit = session.createcriteria(user.class); crit.setfetchmode("address", fetchmode.join); // crit.add(restrictions.eq("address.city", "new street")); crit.setresulttransformer(crit.distinct_root_entity); list<user> userlist = crit.list();

this working fine.but in address table have city column ,here want apply clause address ( address.city=vizag) how can 1 help me.

hibernate

No comments:

Post a Comment