Hibernate Books

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: Search with multiple columns
PostPosted: Mon May 14, 2012 8:57 am 
Newbie

Joined: Thu Dec 01, 2011 10:47 am
Posts: 4
Hi,
In my project i want to be able to search after multiple columns, lets say i got my Mapped Object, and i got the Property-names as strings.
My Object got e.g. the Property "Name", "Id", "Artist",.. and i got the Names of those Properties in my list.
now i Enter a String and i want to search all of my Fields like: "Name LIKE '%asdf%' OR Id LIKE '%asdf%' ,... OR Artist.Name LIKE '%asdf' "

as you can see i also want to search vor the Properties-Properties (Artist.Name).
I tries something with Criterions, but i just got a looot of exceptions, no matter what i was trying.
first i had problems, because he couldnt convert Int32 to String, then i got problems, cause he couldnt find the Field "Artist", and so an.

Can anyone help me with creating this Criterion, I would really appreciate it.

Spong3bob


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.