2 bugs with entityLoadByPK

  • Hibernate 3.5.5.87

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 5.3.9.166

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.120 / 5.3.9.166 / 5.3.10.{latest-snapshot}

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

2 Likes

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

https://luceeserver.atlassian.net/browse/LDEV-4461?focusedCommentId=53881

1 Like