Hi,
Hibernate version: 3.2.x
Mapping documents:
...
Code:
<component name="allocationFraction" className="...Fraction">
<property name="numerator" column="NUMERATOR" type="long"/>
<property name="denominator" column="DENOMINATOR" type="long" />
</component>
fraction is:
Code:
class Fraction {
private long numerator;
private long denominator;
...
public long getNumerator() { return numerator; }
public void setNumerator(long num) { numerator = num; }
}
This class however is not immutable because the current hibernate mapping requires a setNumerator/setDenominator. These methods are not used anywhere BUT via Hibernate, I would like to get rid of them to avoid potential issues.
We have a constructor Fraction(numerator,denominator) but how could I ensure that it is called via the Hibernate mapping?
Suggestions most welcomed...
Thanks
Benoit
http://www.Appendium.com