[forge-issues] [JBoss JIRA] (FORGE-1006) The entity plugin should generate equals and hashcode implementations considering all suitable fields in the JPA entity

Vineet Reynolds (JIRA) jira-events at lists.jboss.org
Tue Sep 3 16:35:03 EDT 2013


    [ https://issues.jboss.org/browse/FORGE-1006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12801332#comment-12801332 ] 

Vineet Reynolds commented on FORGE-1006:
----------------------------------------

A new plugin {{update-entity}} is now available, with a {{hashcode-and-equals}} command that allows users to generate {{equals()}} and {{hashCode()}} implementations based on user-chosen fields.
                
> The entity plugin should generate equals and hashcode implementations considering all suitable fields in the JPA entity
> -----------------------------------------------------------------------------------------------------------------------
>
>                 Key: FORGE-1006
>                 URL: https://issues.jboss.org/browse/FORGE-1006
>             Project: Forge
>          Issue Type: Enhancement
>          Components: Builtin Plugins
>    Affects Versions: 1.3.3.Final
>            Reporter: Vineet Reynolds
>            Assignee: Vineet Reynolds
>             Fix For: 1.4.1.Final
>
>
> As a result of FORGE-995 and FORGE-1005 the generated {{equals}} and {{hashcode}} implementations for JPA entities would be typically incorrect due to reliance on the auto-generated primary key value.
> Additionally, since the {{equals}} and {{hashCode}} methods are generated only once during creation of the JPA entity class, these methods would be out of date as more fields are added (unlike the {{toString}} method). We should enhance or regenerate the existing methods as new fields are added via the field plugin.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the forge-issues mailing list