public boolean generateIdentifiableMethods ( ) { Assert . isTrue ( isRoot ( ) , "generateIdentifiableMethods() can be invoked only on root entity. Please fix your template." ) ; if ( hasSimplePk ( ) || hasCompositePk ( ) ) { String identifiableProperty = config . getCelerio ( ) . getConfiguration ( ) . getConventions ( ) . getIdentifiableProperty ( ) ; // keep it with equalsIgnoreCase as people tends to use 'Id' return ! getPrimaryKey ( ) . getVar ( ) . equalsIgnoreCase ( identifiableProperty ) ; } return true ; }
Tells whether we should generate identifiable methods . We do not need to generate them in the case where the identifiable property matches exactly the entity s PK field .