Ability to turn off construction of entities to determine unsaved-value for primitive @Id type
Description
Activity
Show:
Michael Haefele February 12, 2015 at 10:21 PM
Typo, the first mention of https://hibernate.atlassian.net/browse/HHH-1595#icft=HHH-1595 should be https://hibernate.atlassian.net/browse/HHH-1495#icft=HHH-1495 (it looks like I can't edit the description to change this).
Details
Details
Assignee
Unassigned
UnassignedReporter
Michael Haefele
Michael HaefelePriority
Created February 12, 2015 at 10:19 PM
Updated February 12, 2015 at 10:21 PM
This a slightly modified duplicate of HHH-1595, which i believe was closed prematurely.
Discussion here: https://forum.hibernate.org/viewtopic.php?t=955569
UnsavedValueFactory constructs an instance of each entity to determine the unsaved value of @Id and @Version.
In our particular app we are using spring and aspects to autowire our entities (not my choice, but here we are).
This makes constructing an instance very expensive and adds a lot of time to our hibernate initialization.
In our case, the unsaved value for the ID of all of our entities is null.
It would be nice to be able to specify this somewhere and have UnsavedValueFactory skip the constructor in that case.
Alternately, as https://hibernate.atlassian.net/browse/HHH-1495#icft=HHH-1495 suggests, don't call the constructor for primitive-typed Ids (or have a flag to specify this).