| Home | JSP | EJB | JDBC | Java Servlets | WAP | Free JSP Hosting | Spring Framework | Web Services | BioInformatics | Java Server Faces | Jboss 3.0 tutorial | Hibernate 3.0 | XML | ||||
|
||||
|
|
||||
| Tutorial Categories: Ajax
| Articles
| JSP
| Bioinformatics
| Database
| Free
Books |
Hibernate
| J2EE
| J2ME
| Java
| JavaScript
| JDBC
| JMS
| Linux
| MS
Technology |
PHP
| RMI
| Web-Services
| Servlets
| Struts
| UML
|
|
||||||||||||||||||||||||||||||
|
Home | JSP | EJB | JDBC | Java Servlets | WAP | Free JSP Hosting | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs |
||||||||||||||||||||||||||||||
Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.
Copyright © 2007. All rights reserved.
Current Comments
3 comments so far (post your own) View All Comments Latest 10 Comments:What i should do in case when it's need to use more then two OR ?
like:
WHERE
firstname LIKE ".." OR
secondname LIKE ".." OR
thirdname LIKE ".." OR
description LIKE ".."
reply:
you can do somthing like this:
search = "%"+search+"%";
Criteria criteria = session.createCriteria(your.class);
criteria.add(
Expression.or(
Expression.or(
Expression.ilike("colum", search),
Expression.ilike("columx", search)
),
Expression.or(
Expression.or(
Expression.ilike("columx+1", search),
Expression.ilike("columx+2", search)
),
Expression.or(
Expression.ilike("columx+3", search),
Expression.ilike("columx+4", search)
)
)
)
);
this is not a realy good way of doing it but it works.
Posted by sdf on Saturday, 11.15.08 @ 00:09am | #81685
What i should do in case when it's need to use more then two OR ?
like:
WHERE
firstname LIKE ".." OR
secondname LIKE ".." OR
thirdname LIKE ".." OR
description LIKE ".."
Posted by iBog on Friday, 09.12.08 @ 15:18pm | #78875
Hi,
I have a problem in writing a criteria expression for nested properties.
Say your "insurance" table has a column "brokerid" and it's the primary key in table "insurance_broker". That table has fields for name, address, etc.
And assume those tables are properly mapped in mapping files.
I want to write something like
Expression.or
(Expression.eq("insurance_name",new Long(3)),
Expression.eq("insurance_broker.name","Test Broker")));
Thanks in advance
Posted by Chamara Ranasinghe on Friday, 01.11.08 @ 13:12pm | #44968