Hi,
I have a hibernate managed class 'Foo' that has a boolean flag on it, unfortunately this boolean flag is not persisted or present in the database.
However, any Foo object that is returned from the database should have this flag set to true.
This is rather easy to fix in that I can define the default constructor like the following:
Code:
public Foo()
{
this.flag = true;
}
However, doing this will undermine the default logic of the Foo class and possibly undermine any client code that is using this default constructor and are unaware that they need to set the boolean flag (previously it was false); so I would like to stick clear of this option.
Are there any options via hibernates configuration that allow me to set a default for this value?
Thanks in advance,
Justin
Code: