java - HQL- Select new constructor with boolean parameters -



java - HQL- Select new constructor with boolean parameters -

i'm trying phone call testresultdto constructor boolean parameter maintain geting error

testresultdto :

public class testresultdto extends abstractdto { private boolean test; private boolean locked; public testresultdto() { super(); } public testresultdto(boolean locked, boolean test) { super(); this.test = test; this.locked = locked; }

the query:

select new com.xxx.model.dto.widgets.results.testresultdto(p.islocked, if((p.playerstatus = 'standard'), false, true)) player p p.id = 1

the error:

java.lang.nullpointerexception @ org.hibernate.internal.util.reflecthelper.getconstructor(reflecthelper.java:355)

is there way pass boolean parameter hard coded ('true')??

the query may :-

select new com.xxx.model.dto.widgets.results.testresultdto(p.islocked, case when p.playerstatus = 'standard' false else true end) player p p.id = 1 .

for reference : http://docs.jboss.org/hibernate/core/3.5/reference/en/html/queryhql.html#queryhql-expressions

java hibernate hql

Comments

Popular posts from this blog

java Multi query from Mysql using netbeans -

c# - DotNetZip fails with "stream does not support seek operations" -

c++ - StartServiceCtrlDispatcher don't can access 1063 error -