ORMExecuteQuery() with named params throws NPE

Description

In ORMExecuteQuery(), using columns name with the wrong case to declare a param in HQL throws NPE.
If the property name is Ant and using that name as ant to declare param in HQL throws NPE. Seems ACF works fine.

This two are works

ORMExecuteQuery("From test where Ant = :ok",{"ok":'lucee'}) // works ORMExecuteQuery("From test where ant = 'lucee'") // without param works

This one throws NPE

ORMExecuteQuery("From test where ant = :ok",{"ok":'lucee'}) // wrong case with param throws NPE

StackTrace from hibernate extension 3.5.5.78-SNAPSHOT

lucee.runtime.exp.NativeException: java.lang.NullPointerException at org.lucee.extension.orm.hibernate.HibernateCaster.toSQL(HibernateCaster.java:423) at org.lucee.extension.orm.hibernate.HibernateORMSession.__executeQuery(HibernateORMSession.java:516) at org.lucee.extension.orm.hibernate.HibernateORMSession._executeQuery(HibernateORMSession.java:426) at org.lucee.extension.orm.hibernate.HibernateORMSession.executeQuery(HibernateORMSession.java:416) at lucee.runtime.functions.orm.ORMExecuteQuery._call(ORMExecuteQuery.java:79) at lucee.runtime.functions.orm.ORMExecuteQuery.call(ORMExecuteQuery.java:47) at test.testcases.test2_cfm$cf$e.call(/test/testcases/test2.cfm:17) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1034) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:926) at lucee.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:217)

5.4.29.6-BETA

lucee.runtime.exp.NativeException: java.lang.NullPointerException at org.lucee.extension.orm.hibernate.HibernateCaster.toSQL(HibernateCaster.java:423) at org.lucee.extension.orm.hibernate.HibernateORMSession.__executeQuery(HibernateORMSession.java:528) at org.lucee.extension.orm.hibernate.HibernateORMSession._executeQuery(HibernateORMSession.java:437) at org.lucee.extension.orm.hibernate.HibernateORMSession.executeQuery(HibernateORMSession.java:427) at lucee.runtime.functions.orm.ORMExecuteQuery._call(ORMExecuteQuery.java:79) at lucee.runtime.functions.orm.ORMExecuteQuery.call(ORMExecuteQuery.java:47) at test.testcases.test2_cfm$cf.call(/test/testcases/test2.cfm:17) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1034) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:926)

Environment

None

Activity

Show:

Pothys - MitrahSoft 9 June 2023 at 13:22

I've checked this issue with Hibernate version 5.4.29.22-BETA . Now ORMExecuteQuery() with named params didn't throw the "java.lang.NullPointerException" error and the issue is solved.

Zac Spitzer 3 June 2023 at 17:56
Edited

https://github.com/lucee/extension-hibernate/pull/40

it now throws

couldn't get type for ORM parameter [ok], entity names are case sensitive!

moved tests to extension https://github.com/lucee/Lucee/pull/2105

Fixed

Details

Assignee

Reporter

Priority

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Sprint

Created 26 November 2021 at 09:39
Updated 9 June 2023 at 13:42
Resolved 9 June 2023 at 13:42

Flag notifications