-->
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: Issue with parenthesis in criterias
PostPosted: Tue Jul 28, 2009 11:15 am 
Newbie

Joined: Tue Jul 28, 2009 11:05 am
Posts: 1
Hi Guys,

I'm clueless. Searched in forums + google but nothing.

Using simple criteria :

Code:
public List findByInstitutionName(String institutionName) {

      DetachedCriteria searchCriterias = DetachedCriteria.forClass(Institution.class);
      if (StringUtils.isNotBlank(institutionName))
         searchCriterias.add(Restrictions.eq("institutionName", institutionName).ignoreCase());
      searchCriterias.addOrder(Order.desc("id"));
      
      return getHibernateTemplate().findByCriteria(searchCriterias);
    }


the list is empty for this value :
Quote:
institutionName = Dr. F. blablabla (TEST)

but works for this value
Quote:
institutionName = Dr. F. blablabla TEST


(Checking values in debug mode with breakpoints - Both values are in DB obviously). HBM is

Quote:
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>
<class name="com.test.modell.Institution" table="INT001">
<id name="id" column="INTID" type="string" unsaved-value="null">
<generator class="sequence">
<param name="sequence">PARTICIPANT_SEQ</param>
</generator>
</id>
<version name="versionControl" type="long" column="VERSIONCTL" />
...
<property name="institutionName" type="string" column="INTNAM1A" />
...
</hibernate-mapping>

Activating SQL (hibernate.show_sql) give me nothing special:
Quote:
SELECT .... FROM INT001 this_ where lower(this_.INTNAM1A)=? order by this_.INTID desc


Using Hibernate 3.3.2.6 + Oracle 10g.

Any help would be appreciated. Thx!


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.