users@glassfish.java.net

Re: how to cancel the whwere clause effect

From: <glassfish_at_javadesktop.org>
Date: Mon, 04 Jun 2007 23:49:27 PDT

Hi,

you could use a LIKE expression to compare the user name:
SELECT u FROM user u WHERE u.name LIKE :name

Passing a percent sign "%" as parameter value matches a sequence of any characters which has the same effect as omitting the LIKE expression:
Query q = em.createQuery("SELECT u FROM user u WHERE u.name LIKE :name");
q.setParameter("name", "%");
List result = q.getResultList();

Regards Michael
[Message sent by forum member 'mb124283' (mb124283)]

http://forums.java.net/jive/thread.jspa?messageID=220484