ORM Update doesn't update for every ORM Field change

Description

I have a field in an entity.
When i change values of this entity it does not update.
If i change the name, it makes a new field.

No logs stating there was an error, just silence.

Environment

None

Activity

Show:
Luis Majano
November 4, 2018, 10:46 AM

Unfortunately this is not well documented with the Hibernate docs. You have to see the source or ask, like I did a few years ago. Schema Updates are non-destructive. Meaning, it will only work on additions.

hibernate.hbm2ddl.auto" value="update won't modify existing table column definitions. Doing some testing I found that:

hibernate.hbm2ddl.auto" value="update will add a db column that doesn't already exist.

hibernate.hbm2ddl.auto" value="update will not delete a db column that is removed/no longer in your entity.

hibernate.hbm2ddl.auto" value="update will not modify a db column that has already been created.

Gavin Pickin
November 7, 2018, 4:50 AM

Thanks, this wasn't clear in any of the docs.
I'll update them on cfdocs so they are more clear to those, like me, bitten by this.

This issue didn't cause me much headaches, I just don't trust hibernate for changes if it's not set to drop/create.
The fact that my models said one thing and my db said another thing, made it harder for me to track down a Lucee black hole error. When I updated my lucee to the latest, this blackhole is gone, at least erroring, and then that helped.

Thanks for the clarification.

Luis Majano
November 7, 2018, 10:00 AM

I have created thee following ticket: https://luceeserver.atlassian.net/browse/LDEV-2064

This should help tremendouslly

Assignee

Unassigned

Reporter

Gavin Pickin

Priority

Major

Labels

Fix versions

None

Affects versions

Configure