You just need to add a second constructor, for Hibernate. The design isn't bad. You shouldn't need to set up any data for an object being loaded by Hibernate. When the object was originally created (before it was saved for the first time), your factory created the object using the parameterized constructor. Whatever values were set up at that time were saved to the DB. When you load the object later, those values are loaded with it.
If for some reason you need to set up values that are not saved to the DB, there are still plenty of options. You could use a PostLoadEventListener, redesign your entities or factories, use default values, etc...
|