Can you please help me? I have error in querying boolean value "r.isDefault = true".
In my HQL named query:
<named-query name="RptQuery.queryDefaultByCode"> <query> SELECT r FROM RptQuery r WHERE r.code = ?1 AND r.isDefault = true </query> </named-query>
I get error: Caused by: org.hibernate.HibernateException: Errors in named queries: RptQuery.queryDefaultByCode
In my persistence.xml:
<property name="hibernate.query.substitutions" value="true='Y', false='N', yes='Y', no='N'"/>
In my pojo:
private boolean isDefault; @Column(name = "CPMN_IS_DEFLT", length = 1) @Type(type = "yes_no") public boolean isDefault() { return this.isDefault; } public void setDefault(boolean isDefault) { this.isDefault = isDefault; }
Thank you in advance!
Answer: Just found a minor error:
r.isDefault = true
should be
r.default = true
Thanks.
try this : where r.isDefault is true
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With