hi all
in JPAQL
i wanna cancel the where clause effect in order to use the following example query
select u from user u where u.name= :name
the question is what to put for the value of the parameter:name to make the query get all the objects ,ie. make it match against any name,i know that this can be achieved with omiting the where clause alltogether but my real world query is much complex and i cannot guarentee that each time i run the query all the parameters will be assigned so i want to neutralize the effect of effect of the unassigned parameters by making a default that get all objects, i cannot use dynamically generated sql or jpaql as my db perform much much better with precompiled queries
please help me and tell me if ur solution is portable among JPA providers(in the spec )or just available in hibernate
thanx alot
|