2 bugs with entityLoadByPK

  • Hibernate

This works;
local.deleteEntity = entityLoadByPK("customerAlertSpec", session.testEntityId);

This doesn’t;

local.deleteEntity = entityLoadByPK(name="customerAlertSpec", id=session.testEntityId);
// This doesn't work either
local.deleteEntity = entityLoadByPK(name="customerAlertSpec", id="#session.testEntityId#");

I get the following error;

java.lang.Object lucee.runtime.functions.orm.EntityLoadByPK.call(lucee.runtime.PageContext, java.lang.String, java.lang.Object, boolean)

Same result - with or without the unique attribute : (true OR false)

I also tried with the latest snapshot of 5.3.10
Also tried with

Bug 1:
Using attribute names with the function causes the error.

Bug 2:
Using the 3rd parameter (unique) (without attribute names) also causes an error.

While this works;
local.deleteEntity = entityLoadByPK("customerAlertSpec", session.testEntityId);

This doesn’t - irrespective of the value used for the 3rd argument.
local.deleteEntity = entityLoadByPK("customerAlertSpec", session.testEntityId, true); local.deleteEntity = entityLoadByPK("customerAlertSpec", session.testEntityId, false);

Don’t forget to tell us about your stack!

OS: AWS Linux 2 (CentOS 7)
Java Version: 11
Tomcat Version: 8.x
Lucee Version: / / 5.3.10.{latest-snapshot}

@Gavin_Baumanis I’ve created a ticket for this issue in JIRA: LDEV-4416


Just to keep the thread accurate :
it is LDEV-4461 and not LDEV-4416

unique isn’t even implemented, it’s a lucee only thing