public static boolean containsBasicElementCollectionField ( final EntityMetadata m , final KunderaMetadata kunderaMetadata ) { Metamodel metaModel = kunderaMetadata . getApplicationMetadata ( ) . getMetamodel ( m . getPersistenceUnit ( ) ) ; EntityType entityType = metaModel . entity ( m . getEntityClazz ( ) ) ; Iterator < Attribute > iter = entityType . getAttributes ( ) . iterator ( ) ; while ( iter . hasNext ( ) ) { Attribute attr = iter . next ( ) ; if ( attr . isCollection ( ) && ! attr . isAssociation ( ) && isBasicElementCollectionField ( ( Field ) attr . getJavaMember ( ) ) ) { return true ; } } return false ; }
Checks whether an entity with given metadata contains a collection field