Example usage for org.hibernate.tuple NonIdentifierAttribute getType

List of usage examples for org.hibernate.tuple NonIdentifierAttribute getType

Introduction

In this page you can find the example usage for org.hibernate.tuple NonIdentifierAttribute getType.

Prototype

public Type getType();

Source Link

Usage

From source file:org.babyfish.hibernate.internal.ImplicitCollectionJoins.java

License:Open Source License

private boolean hasImplicitCollectionJoins1(String entityName, Map<String, Boolean> contextMap) {
    EntityPersister persister = this.factory.getEntityPersister(entityName);
    for (NonIdentifierAttribute nonIdAttribute : persister.getEntityMetamodel().getProperties()) {
        Type propertyType = nonIdAttribute.getType();
        if (nonIdAttribute.getFetchMode() == FetchMode.JOIN) {
            if (propertyType.isCollectionType()) { //find collection with {fetch = "join"}
                return true;
            }/*from w  w w . ja v a2s. c o m*/
            if (propertyType instanceof AssociationType) {
                String childEntityName = ((AssociationType) propertyType).getAssociatedEntityName(this.factory);
                if (this.hasImplicitCollectionJoins0(childEntityName, contextMap)) {
                    return true;
                }
            }
        } else if (propertyType instanceof CompositeType) {
            if (this.hasImplicitCollectionJoins0((CompositeType) propertyType, contextMap)) {
                return true;
            }
        }
    }
    return false;
}