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.  [ 3 posts ] 
Author Message
 Post subject: MySQL and HSQLDB Expresson.like() Inconsistency
PostPosted: Fri Aug 13, 2004 2:33 pm 
Newbie

Joined: Fri Aug 13, 2004 2:16 pm
Posts: 2
Hibernate version:2.1.6

Name and version of the database you are using: MySQL 4.0.20 and HSQLDB 1.7.2

I am currently working through "Hibernate a Developer's Notebook" by James Elliot and have found that when using the exact same code, schema, and mapping files I get two different results.

The code is:
Code:
        Criteria criteria = session.createCriteria(Track.class);
        criteria.add(Expression.le("playTime", length));
        criteria.add(Expression.like("title", "%A%"));
        criteria.addOrder(Order.asc("title"));
        return criteria.list();


When using HSQLDB it returns the correct results, all titles that contain an uppercase A. When using MySQL it returns all titles that contain A regardless of case. With a little instruction I can get more info if needed.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 13, 2004 2:58 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
This is database specific. Mysql for example always does case-insensitive like matching. Nothing Hibernate can do about that.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 13, 2004 3:03 pm 
Newbie

Joined: Fri Aug 13, 2004 2:16 pm
Posts: 2
Thanks for the info.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

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.