I have what seem to be a working patch for hibernatedoclet to handle formulas.
This is what I'm thinking in terms of a parameter for specifying a formula for a property:
Simple Example:
Code:
/**
* @hibernate.property formula = "( left(account_num, 6) )"
*/
public String getIssuerBin() { return issuerBin; }
public void setIssuerBin() { this.issuerBin = issuerBin; }
And it would produce the following mapping meta-data:
Code:
<property
name="issuerBin"
type="java.lang.String"
formula="( left(account_num, 6) )"
update="false"
insert="false"
access="property"
/>
It seems to be that these rules should be enforced when you are using a formula. Please let me know if this doesn't make sense (I can't see how it would make sense for these to be true).
insert = "false"
update = "false"
And that these settings should be ignored if present in the doclet tag, and thus, not placed in the hibernate mapping file:
column
not-null
length
unique
Does this make sense?
Christian