-->
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: Restrictions.ilike
PostPosted: Mon Oct 30, 2006 4:57 am 
Newbie

Joined: Mon Oct 30, 2006 4:47 am
Posts: 3
Hy

I can't find a solution to my sql query.
I use MySQL and I have a query like this:

SELECT * from table where column1 like concat('%',column2,'%') and column2 <> 'sometext'

I have mapped this table to a Class, lat's say MyClass

I can't get hibernate to make that column1 like column2, there is no fuction to use like on 2 properties, something like ilikeProperty(property,anotherProperty)

session.createCriteria(MyClass.class)
.add(Restrictions.ne("column2","sometext"))
.add(Restrictions.ilike("column1",?????????)
.list()


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.