-->
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: Complete criteria query trouble
PostPosted: Mon Sep 22, 2008 12:45 pm 
Beginner
Beginner

Joined: Tue Jun 06, 2006 3:37 am
Posts: 29
Hi,

I've an entity named Affaire that contains a many to many relation to Commune

This Commune have a many to one relation to District

So I'm trying to get all the Affaire that have affaire.communes.district.libelleFr like = '%Sari%'

I create criteria like this way

Code:
Criteria criteria = session.createCriteria(Affaire.class);
Criteria manyToMany = criteria.createCriteria("communes");
if (district.getLibelleFr()!= null && district.getLibelleFr().length() > 0) {
  Criteria districtCriteria= manyToMany.createCriteria("district");
   System.out.println("Create district criteria for libelleFr  " + district.getLibelleFr());
  districtCriteria.add(Expression.like("libelleFr", "%" + district.getLibelleFr() + "%"));
      }



but once executing my list is empty

any idea on the cause ?

thanks in advance


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.