|
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
HHH-1495
suggests, don't call the constructor for primitive-typed Ids (or have a flag to specify this).
|