/************************* Test case - EntityLoad named argument results in "lucee.runtime.exp.CasterException: null can not be casted to a Struct" ************************/ /***** Application.cfc *****/ component { this.Name = "LuceeORMTest"; this.datasources["mydsn"] = { class: 'com.mysql.cj.jdbc.Driver' , connectionString: 'jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=UTF-8&useLegacyDatetimeCode=true' , username: 'root' , password: "dgwKfh7IndeEd" }; this.defaultdatasource="mydsn"; this.ormenabled = "true"; this.ORMSettings = { datasource="mydsn", cfclocation=["/ORM/cfc"] }; this.nullSupport=true; boolean function onApplicationStart () { return true; } } /***** ROOT/ORM/cfc/birds.cfc *****/ component persistent=true table="birds" entityName="birds" { property name="id" column="id" type="numeric" ormtype="integer" fieldtype="id"; property name="birdName" type="string" ormtype="string" fieldtype="id"; property name="size" type="string" ormtype="string"; } Database table: birds Composite primary-key: (id, birdName) id birdName size 4 sparrow S 3 penguin M 2 eagle M 1 ostrich L /***** ROOT/ormTest.cfm *****/ /***** When you use named arguments in entityLoad, you get “lucee.runtime.exp.CasterException: null can not be casted to a Struct” *****/ writeoutput("Time now: " & now()); id_Filter={id:1,birdName:"ostrich"}; //oBirds1=entityLoad("birds",{id:1,birdName:"ostrich"}); oBirds2=entityLoad("birds",id_Filter); //oBirds3=entityLoad(name="birds",idOrFilter=id_Filter); //writedump(oBirds1); writedump(oBirds2); //writedump(oBirds2);