public Class getCollectionPersisterClass() { try { return MappingHelper.getClassValue(collection.getPersister()); } catch (ClassNotFoundException cnfe) { throw new MappingException( "Could not find collection persister class: " + collection.getPersister()); } }
public CustomSQL getCustomSQLDeleteAll() { XMLSqlDeleteAllElement sqlDeleteAll = collection.getSqlDeleteAll(); return sqlDeleteAll == null ? null : HbmHelper.getCustomSql( collection.getSqlDeleteAll().getValue(), collection.getSqlDeleteAll().isCallable(), collection.getSqlDeleteAll().getCheck().value()); }
public CustomSQL getCustomSQLInsert() { XMLSqlInsertElement sqlInsert = collection.getSqlInsert(); return sqlInsert == null ? null : HbmHelper.getCustomSql( collection.getSqlInsert().getValue(), collection.getSqlInsert().isCallable(), collection.getSqlInsert().getCheck().value()); }
public CustomSQL getCustomSQLUpdate() { XMLSqlUpdateElement sqlUpdate = collection.getSqlUpdate(); return sqlUpdate == null ? null : HbmHelper.getCustomSql( collection.getSqlUpdate().getValue(), collection.getSqlUpdate().isCallable(), collection.getSqlUpdate().getCheck().value()); }
public java.util.Set getSynchronizedTables() { java.util.Set<String> synchronizedTables = new HashSet<String>(); for (XMLSynchronizeElement sync : collection.getSynchronize()) { synchronizedTables.add(sync.getTable()); } return synchronizedTables; }
public FetchMode getFetchMode() { FetchMode fetchMode; if (collection.getFetch() != null) { fetchMode = "join".equals(collection.getFetch()) ? FetchMode.JOIN : FetchMode.SELECT; } else { String jfNodeValue = (collection.getOuterJoin().value() == null ? "auto" : collection.getOuterJoin().value()); if ("auto".equals(jfNodeValue)) { fetchMode = FetchMode.DEFAULT; } else if ("true".equals(jfNodeValue)) { fetchMode = FetchMode.JOIN; } else { fetchMode = FetchMode.SELECT; } } return fetchMode; }
public HbmPluralAttributeDomainState( MappingDefaults defaults, XMLBagElement collection, Map<String, MetaAttribute> entityMetaAttributes, Attribute attribute) { super( defaults, attribute, collection.getNode(), HbmHelper.extractMetas(collection.getMeta(), entityMetaAttributes), HbmHelper.getPropertyAccessorName( collection.getAccess(), collection.isEmbedXml(), defaults.getDefaultAccess()), collection.isOptimisticLock()); this.collection = collection; // TODO: is collection.getCollectionType() correct here? this.hibernateTypeDescriptor.setTypeName(collection.getCollectionType()); this.cascade = MappingHelper.getStringValue(collection.getCascade(), defaults.getDefaultCascade()); // Attribute typeNode = collectionElement.attribute( "collection-type" ); // if ( typeNode != null ) { // TODO: implement when typedef binding is implemented /* String typeName = typeNode.getValue(); TypeDef typeDef = mappings.getTypeDef( typeName ); if ( typeDef != null ) { collectionBinding.setTypeName( typeDef.getTypeClass() ); collectionBinding.setTypeParameters( typeDef.getParameters() ); } else { collectionBinding.setTypeName( typeName ); } */ // } // TODO: fix this!!! this.hibernateTypeDescriptor.setTypeName(collection.getCollectionType()); }
public String getWhere() { return collection.getWhere(); }
public CollectionElementDomainState getCollectionElementDomainState() { return new HbmCollectionElementDomainState(collection.getElement()); }
public boolean isInverse() { return collection.isInverse(); }
public boolean isMutable() { return collection.isMutable(); }
public boolean isOptimisticLocked() { return collection.isOptimisticLock(); }
@Override public boolean isEmbedded() { return collection.isEmbedXml(); }
public boolean isExtraLazy() { return ("extra".equals(collection.getLazy())); }
public boolean isSubselectLoadable() { return "subselect".equals(collection.getFetch()); }
public String getOrderBy() { return collection.getOrderBy(); }
public String getCacheRegionName() { return collection.getCache() == null ? null : collection.getCache().getRegion(); }
public String getCacheConcurrencyStrategy() { return collection.getCache() == null ? null : collection.getCache().getUsage(); }
public String getLoaderName() { return collection.getLoader() == null ? null : collection.getLoader().getQueryRef(); }
public String getReferencedPropertyName() { return collection.getKey().getPropertyRef(); }
public int getBatchSize() { return MappingHelper.getIntValue(collection.getBatchSize(), 0); }
public boolean isLazy() { return isExtraLazy() || MappingHelper.getBooleanValue( collection.getLazy().value(), getDefaults().isDefaultLazy()); }