I’m working with an application that was originally built on ColdFusion. The application utilizes Hibernate ORM. There are entities that have associated properties (A property that references another entity in a certain relationship - one-to-many, many-to-many, etc). These associated properties are often marked as “lazy” for a good reason. The application has a need to send json serialized entity data to client and this is where Lucee has trouble. In ColdFusion, serializeJson seems to skip properties that are marked as “lazy”. If I examine the json data for an entity on ColdFusion server, I only see properties that aren’t associated properties. When the same entity data are serialized to Json on Lucee, I see all the child entity data as json, and certain children data are very large.
My question is… does the serializeJson function on Lucee cause retrieval of all lazy properties? Is there a way to serialize only the non-lazy properties of an entity somehow?
UPDATE: Found [LDEV-176] - Lucee. According to this, the ACF implementation of the serializeJson function uses toString() recursively on variables and will not recurse to lazy=true relationships. It seems Lucee’s implementation recurses to lazy=true relationships too. I need to find out if there is a way to prevent this.
I’ve checked this issue and Yes, there is an incompatibility in lucee with the ACF SerializeJSON result. Could you please create an incompatibility ticket in jira https://luceeserver.atlassian.net/
I created an issue [LDEV-3652] - Lucee. Unfortunately, I originally created it as “Enhancement” issue type. Now, I’m trying to change the issue type to incompatibility, but I get the access denied message.
Is someone able to update the issue type of that issue I linked?
Haha, I apologize for the confusion. test_type.cfm is another test that I’ve done in the past (This is a test project that I’ve created different things with ORM). I know index.cfm has a link referencing it, but the focus for this issue is test_serializejson.cfm. But, I will go ahead and include it.
When you say "define the datasource test_orm once as variable in application.cfc, are you talking about this?