java - Getting Callback after all setters called to add extra fields? -


I want to override a setter so that I can do some functions on the data so that I can return a calculation column My organization This function depends on many columns (eg, 1 9 2, 2, 2, 2), so I can not really block a particular setter because other values ​​can not be populated yet. Does Hibernation provide some type of "Finnish ()" method which can be called once upon values?

 @ override @ column (name = "COL1") public string getCol1 () {this.col1; } @ Override Public Zero Set Call 1 (string value) {super.setCol1 (value); GenMagicValue (); } Public string getMagicValue () {return.magicValue (); }  

I do not understand your question, never setCol1 Can be said (and left with its default value). Apart from this, anyone is preventing you from calling twice with different values.

Perhaps the method you are looking for is:

  Boolean magic = wrong; Public string getMagicValue () {if (Magic Done) {magicDone = true; GenMagicValue (); } Make this return. Magic value (); }    

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -