Annotation Type IdEqualsHashCode


  • @Documented
    @Retention(RUNTIME)
    @Target(TYPE)
    public @interface IdEqualsHashCode
    Equals and hash code annotation for Gorm and JPA entites when you want it based on id. doesn't hydrate the proxy when checking it roughtly based on the following https://vladmihalcea.com/how-to-implement-equals-and-hashcode-using-the-jpa-entity-identifier/ https://thorben-janssen.com/ultimate-guide-to-implementing-equals-and-hashcode-with-hibernate/
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      java.lang.String[] hashKey
      List of field and/or property names to use in the hashCode if id is null
      java.lang.String[] includes
      List of field and/or property names to include within the equals and hashCode calculations.
    • Element Detail

      • includes

        java.lang.String[] includes
        List of field and/or property names to include within the equals and hashCode calculations. Must not be used if 'excludes' is used. For convenience, a String with comma separated names can be used in addition to an array (using Groovy's literal list notation) of String values.
        Default:
        {}
      • hashKey

        java.lang.String[] hashKey
        List of field and/or property names to use in the hashCode if id is null
        Default:
        {}