cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "jerome moliere" <>
Subject Re: Improvement ? code generation (templates)
Date Wed, 07 Mar 2007 16:30:32 GMT
2007/3/7, Andrus Adamchik <>:
> Hi Jerome,
> Could you give specific examples of the code you want to see
> generated?

yes of course I can, this is an excerpt from one of my Java class...
This class has different attributes (name and so on):

    /* (non-Javadoc)
     * @see java.lang.Object#equals(java.lang.Object)
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        if (!(obj instanceof PersistentField)) {
            return false;
        PersistentField rhs = (PersistentField) obj;
        return new EqualsBuilder().append(name,
                ordinalPosition, rhs.ordinalPosition)

    }// equals()

    /* (non-Javadoc)
     * @see java.lang.Object#hashCode()
    public int hashCode() {
        return new HashCodeBuilder().append(name).append(ordinalPosition)
    /* (non-Javadoc)
     * @see java.lang.Object#toString()
    public String toString() {
        return new ToStringBuilder(this).append("column", name).append(
                "dataType", dataType).append("isNullable",
isNullable).append("Fk member :",isFkMember).append("isPkmember",
                .append("typname",genre).append("refers to table:",refersTo)

these methods use the COmmons Lang main classes (ToStringBuilder and so on)
to generate the hashcode/equals/toString methods...

>>From your message I don't quite understand why we need to
>change the *default* template?
Because I think it may be generated directly from the Modeler as the super
classes (generated as

Jerome Moliere - Mentor/J
auteur Eyrolles

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message