This patch addresses two problems:
1. Suppose I have Entities Customer and Address with
a OneToMany relation Customer-->Address, and suppose we name the Address
end of this relation addresses.
Currently Taylor generates code that looks like this:
public void addAddresse(Address addresse) ...
This is correct Java but it may not be what you wanted (or expected);
2. Suppose I have a superentity - say Fruit - and one or more
subentities - say Apple and Pear. Then the generated code for Fruit
declares the properties to be private. This means the classes of the
subentities may not reference the properties of the superentity directly.
Currently the generated code for Pear has a method hashCode that looks
like this
public int hashCode() {
final int PRIME = 31;
int result = 1;
result = PRIME * result + ((id == null) ? 0 : id.hashCode());
return result;
}
There are two plausible fixes for this problem:
a) make all properties in Fruit.java protected instead of private.
b) replace the direct reference to id in Pear.hashCode by a call to
getId().
Of the two fixes the fix b) is maybe cleaner; this patch chooses fix a).
A patch file and a README