List of usage examples for org.hibernate.mapping Collection setLazy
public void setLazy(boolean lazy)
From source file:com.fiveamsolutions.nci.commons.util.CsmEnabledHibernateHelper.java
License:Open Source License
/** * {@inheritDoc}/*from w ww . jav a2 s .c o 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); collection.setExtraLazy(false);//w w w . j ava 2 s . c o m } 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 w w w .ja v a 2 s. 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); collection.setExtraLazy(false);/* w w w .ja v a 2 s. co m*/ } 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); } } }