Example usage for org.hibernate.mapping Collection setExtraLazy

List of usage examples for org.hibernate.mapping Collection setExtraLazy

Introduction

In this page you can find the example usage for org.hibernate.mapping Collection setExtraLazy.

Prototype

public void setExtraLazy(boolean extraLazy) 

Source Link

Usage

From source file:com.fiveamsolutions.nci.commons.util.CsmEnabledHibernateHelper.java

License:Open Source License

/**
 * {@inheritDoc}//w w w .  j  a v  a  2s.co  m
 */
@Override
protected void modifyConfig() {
    super.modifyConfig();
    if (this.authorizationManager != null) {
        if (this.userSecurityFilters) {
            InstanceLevelSecurityHelper.addFilters(this.authorizationManager, getConfiguration());
        } else {
            InstanceLevelSecurityHelper.addFiltersForGroups(this.authorizationManager, getConfiguration());
        }
    }
    @SuppressWarnings("unchecked")
    Iterator<Collection> it = getConfiguration().getCollectionMappings();
    final String role = Group.class.getName() + ".users";
    while (it.hasNext()) {
        Collection c = it.next();
        if (c.getRole().equals(role)) {
            c.setLazy(true);
            c.setExtraLazy(true);
        }
    }
}

From source file:org.codehaus.groovy.grails.orm.hibernate.cfg.AbstractGrailsDomainBinder.java

License:Apache License

protected void bindCollectionForPropertyConfig(Collection collection, PropertyConfig config) {
    if (config == null) {
        collection.setLazy(true);/*from  ww  w .  ja v  a  2 s  . c  o m*/
        collection.setExtraLazy(false);
    } else {
        collection.setLazy(config.getLazy());
    }
}

From source file:org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsDomainBinder.java

License:Apache License

private static void bindCollectionForPropertyConfig(Collection collection, PropertyConfig config) {
    if (config != null) {
        collection.setLazy(config.getLazy());
    } else {/*from  ww w . j  a  v  a2s.c o  m*/
        collection.setLazy(true);
        collection.setExtraLazy(false);
    }
}

From source file:org.grails.orm.hibernate.cfg.AbstractGrailsDomainBinder.java

License:Apache License

protected void bindCollectionForPropertyConfig(Collection collection, PropertyConfig config) {
    if (config == null) {
        collection.setLazy(true);//  ww w  . j  av  a2s  . c o m
        collection.setExtraLazy(false);
    } else {
        final FetchMode fetch = config.getFetchMode();
        if (!fetch.equals(FetchMode.JOIN) && !fetch.equals(FetchMode.EAGER)) {
            collection.setLazy(true);
        }
        final Boolean lazy = config.getLazy();
        if (lazy != null) {
            collection.setExtraLazy(lazy);
        }
    }
}