coldbox-modules / cborm

The ColdBox ORM enhancements for ColdFusion ORM & Hibernate. Make ORM not suck!
https://coldbox-orm.ortusbooks.com/
8 stars 17 forks source link

Partial Resolution to Issue #24 #25

Closed jclausen closed 5 years ago

jclausen commented 5 years ago

Converts the usage of id as a hard-coded identifier in BaseORMService to use dynamic key name.

Downside: Dynamically pulling the key name requires a load of the object graph via entityNew()

lmajano commented 5 years ago

ACtually, id is hibernate's alias to the REAL identifier. So we do not need to do this. Hibernate figures it out by leveraging the keyword id:

https://docs.jboss.org/hibernate/orm/3.3/reference/en-US/html/queryhql.html

The special property (lowercase) id may be used to reference the identifier property of an entity provided that the entity does not define a non-identifier property named id.
jclausen commented 5 years ago

Nice! I’ll refactor this back on those properties then. I’d like to keep the change to exists(), though because, otherwise, it blows up when the entity is a reserved word.

jclausen commented 5 years ago

The test errors failing this build have nothing to do with the code modified. They have to do with Adobe compat on the new dirty/clean entity methods

lmajano commented 5 years ago

Closing this, as I think we tackled it.