Methods Summary |
---|
public void | addFilter(java.lang.String name, java.lang.String condition)
filters.put( name, condition );
|
public void | addManyToManyFilter(java.lang.String name, java.lang.String condition)
manyToManyFilters.put( name, condition );
|
private void | checkColumnDuplication(java.util.Set distinctColumns, java.util.Iterator columns)
while ( columns.hasNext() ) {
Selectable s = (Selectable) columns.next();
if ( !s.isFormula() ) {
Column col = (Column) s;
if ( !distinctColumns.add( col.getName() ) ) {
throw new MappingException( "Repeated column in mapping for collection: "
+ getRole()
+ " column: "
+ col.getName() );
}
}
}
|
private void | checkColumnDuplication()
HashSet cols = new HashSet();
checkColumnDuplication( cols, getKey().getColumnIterator() );
if ( isIndexed() ) {
checkColumnDuplication( cols, ( (IndexedCollection) this )
.getIndex()
.getColumnIterator() );
}
if ( isIdentified() ) {
checkColumnDuplication( cols, ( (IdentifierCollection) this )
.getIdentifier()
.getColumnIterator() );
}
if ( !isOneToMany() ) {
checkColumnDuplication( cols, getElement().getColumnIterator() );
}
|
public void | createAllKeys()
createForeignKeys();
if ( !isInverse() ) createPrimaryKey();
|
public void | createForeignKey()
|
private void | createForeignKeys()
// if ( !isInverse() ) { // for inverse collections, let the "other end" handle it
if ( referencedPropertyName == null ) {
getElement().createForeignKey();
key.createForeignKeyOfEntity( getOwner().getEntityName() );
}
// }
|
abstract void | createPrimaryKey()
|
public int | getBatchSize()
return batchSize;
|
public java.lang.String | getCacheConcurrencyStrategy()
return cacheConcurrencyStrategy;
|
public java.lang.String | getCacheRegionName()
return cacheRegionName == null ? role : cacheRegionName;
|
public java.lang.Class | getCollectionPersisterClass()
return collectionPersisterClass;
|
public Table | getCollectionTable()
return collectionTable;
|
public org.hibernate.type.CollectionType | getCollectionType()
if ( typeName == null ) {
return getDefaultCollectionType();
}
else {
return TypeFactory.customCollection( typeName, typeParameters, role, referencedPropertyName, isEmbedded() );
}
|
public boolean[] | getColumnInsertability()
return ArrayHelper.EMPTY_BOOLEAN_ARRAY;
|
public java.util.Iterator | getColumnIterator()
return EmptyIterator.INSTANCE;
|
public int | getColumnSpan()
return 0;
|
public boolean[] | getColumnUpdateability()
return ArrayHelper.EMPTY_BOOLEAN_ARRAY;
|
public java.util.Comparator | getComparator()
if ( comparator == null && comparatorClassName != null ) {
try {
setComparator( (Comparator) ReflectHelper.classForName( comparatorClassName ).newInstance() );
}
catch ( Exception e ) {
throw new MappingException(
"Could not instantiate comparator class [" + comparatorClassName
+ "] for collection " + getRole()
);
}
}
return comparator;
|
public java.lang.String | getComparatorClassName()
return comparatorClassName;
|
public java.lang.String | getCustomSQLDelete()
return customSQLDelete;
|
public java.lang.String | getCustomSQLDeleteAll()
return customSQLDeleteAll;
|
public org.hibernate.engine.ExecuteUpdateResultCheckStyle | getCustomSQLDeleteAllCheckStyle()
return deleteAllCheckStyle;
|
public org.hibernate.engine.ExecuteUpdateResultCheckStyle | getCustomSQLDeleteCheckStyle()
return deleteCheckStyle;
|
public java.lang.String | getCustomSQLInsert()
return customSQLInsert;
|
public org.hibernate.engine.ExecuteUpdateResultCheckStyle | getCustomSQLInsertCheckStyle()
return insertCheckStyle;
|
public java.lang.String | getCustomSQLUpdate()
return customSQLUpdate;
|
public org.hibernate.engine.ExecuteUpdateResultCheckStyle | getCustomSQLUpdateCheckStyle()
return updateCheckStyle;
|
public abstract org.hibernate.type.CollectionType | getDefaultCollectionType()
|
public Value | getElement()
return element;
|
public java.lang.String | getElementNodeName()
return elementNodeName;
|
public org.hibernate.FetchMode | getFetchMode()
return fetchMode;
|
public java.util.Map | getFilterMap()
return filters;
|
public KeyValue | getKey()
return key;
|
public java.lang.String | getLoaderName()
return loaderName;
|
public java.util.Map | getManyToManyFilterMap()
return manyToManyFilters;
|
public java.lang.String | getManyToManyOrdering()
return manyToManyOrderBy;
|
public java.lang.String | getManyToManyWhere()
return manyToManyWhere;
|
public java.lang.String | getNodeName()
return nodeName;
|
public java.lang.String | getOrderBy()
return orderBy;
|
public PersistentClass | getOwner()
return owner;
|
public java.lang.String | getOwnerEntityName()
return owner.getEntityName();
|
public java.lang.String | getReferencedPropertyName()
return referencedPropertyName;
|
public java.lang.String | getRole()
return role;
|
public java.util.Set | getSynchronizedTables()
return synchronizedTables;
|
public Table | getTable()
return owner.getTable();
|
public org.hibernate.type.Type | getType()
return getCollectionType();
|
public java.lang.String | getTypeName()
return typeName;
|
public java.util.Properties | getTypeParameters()
return typeParameters;
|
public java.lang.String | getWhere()
return where;
|
public boolean | hasFormula()
return false;
|
public boolean | hasOrder()
return orderBy!=null || manyToManyOrderBy!=null;
|
public boolean | hasOrphanDelete()
return orphanDelete;
|
public boolean | isAlternateUniqueKey()
return false;
|
public boolean | isArray()
return false;
|
public boolean | isCustomDeleteAllCallable()
return customDeleteAllCallable;
|
public boolean | isCustomDeleteCallable()
return customDeleteCallable;
|
public boolean | isCustomInsertCallable()
return customInsertCallable;
|
public boolean | isCustomUpdateCallable()
return customUpdateCallable;
|
public boolean | isEmbedded()
return embedded;
|
public boolean | isExtraLazy()
return extraLazy;
|
public boolean | isIdentified()
return false;
|
public boolean | isIndexed()
return false;
|
public boolean | isInverse()
return inverse;
|
public boolean | isLazy()
return lazy;
|
public boolean | isMap()
return false;
|
public boolean | isMutable()
return mutable;
|
public boolean | isNullable()
return true;
|
public boolean | isOneToMany()
return element instanceof OneToMany;
|
public boolean | isOptimisticLocked()
return optimisticLocked;
|
public boolean | isPrimitiveArray()
return false;
|
public boolean | isSet()
return false;
|
public boolean | isSimpleValue()
return false;
|
public boolean | isSorted()
return sorted;
|
public boolean | isSubselectLoadable()
return subselectLoadable;
|
public boolean | isValid(org.hibernate.engine.Mapping mapping)
return true;
|
public void | setBatchSize(int i)
batchSize = i;
|
public void | setCacheConcurrencyStrategy(java.lang.String cacheConcurrencyStrategy)
this.cacheConcurrencyStrategy = cacheConcurrencyStrategy;
|
public void | setCacheRegionName(java.lang.String cacheRegionName)
this.cacheRegionName = cacheRegionName;
|
public void | setCollectionPersisterClass(java.lang.Class persister)
this.collectionPersisterClass = persister;
|
public void | setCollectionTable(Table table)
this.collectionTable = table;
|
public void | setComparator(java.util.Comparator comparator)
this.comparator = comparator;
|
public void | setComparatorClassName(java.lang.String comparatorClassName)
this.comparatorClassName = comparatorClassName;
|
public void | setCustomSQLDelete(java.lang.String customSQLDelete, boolean callable, org.hibernate.engine.ExecuteUpdateResultCheckStyle checkStyle)
this.customSQLDelete = customSQLDelete;
this.customDeleteCallable = callable;
this.deleteCheckStyle = checkStyle;
|
public void | setCustomSQLDeleteAll(java.lang.String customSQLDeleteAll, boolean callable, org.hibernate.engine.ExecuteUpdateResultCheckStyle checkStyle)
this.customSQLDeleteAll = customSQLDeleteAll;
this.customDeleteAllCallable = callable;
this.deleteAllCheckStyle = checkStyle;
|
public void | setCustomSQLInsert(java.lang.String customSQLInsert, boolean callable, org.hibernate.engine.ExecuteUpdateResultCheckStyle checkStyle)
this.customSQLInsert = customSQLInsert;
this.customInsertCallable = callable;
this.insertCheckStyle = checkStyle;
|
public void | setCustomSQLUpdate(java.lang.String customSQLUpdate, boolean callable, org.hibernate.engine.ExecuteUpdateResultCheckStyle checkStyle)
this.customSQLUpdate = customSQLUpdate;
this.customUpdateCallable = callable;
this.updateCheckStyle = checkStyle;
|
public void | setElement(Value element)
this.element = element;
|
public void | setElementNodeName(java.lang.String elementNodeName)
this.elementNodeName = elementNodeName;
|
public void | setEmbedded(boolean embedded)
this.embedded = embedded;
|
public void | setExtraLazy(boolean extraLazy)
this.extraLazy = extraLazy;
|
public void | setFetchMode(org.hibernate.FetchMode fetchMode)
this.fetchMode = fetchMode;
|
public void | setInverse(boolean inverse)
this.inverse = inverse;
|
public void | setKey(KeyValue key)
this.key = key;
|
public void | setLazy(boolean lazy)
this.lazy = lazy;
|
public void | setLoaderName(java.lang.String name)
this.loaderName = name==null ? null : name.intern();
|
public void | setManyToManyOrdering(java.lang.String orderFragment)
this.manyToManyOrderBy = orderFragment;
|
public void | setManyToManyWhere(java.lang.String manyToManyWhere)
this.manyToManyWhere = manyToManyWhere;
|
public void | setMutable(boolean mutable)
this.mutable = mutable;
|
public void | setNodeName(java.lang.String nodeName)
this.nodeName = nodeName;
|
public void | setOptimisticLocked(boolean optimisticLocked)
this.optimisticLocked = optimisticLocked;
|
public void | setOrderBy(java.lang.String orderBy)
this.orderBy = orderBy;
|
public void | setOrphanDelete(boolean orphanDelete)
this.orphanDelete = orphanDelete;
|
public void | setOwner(PersistentClass owner)
this.owner = owner;
|
public void | setReferencedPropertyName(java.lang.String propertyRef)
this.referencedPropertyName = propertyRef==null ? null : propertyRef.intern();
|
public void | setRole(java.lang.String role)
this.role = role==null ? null : role.intern();
|
public void | setSorted(boolean sorted)
this.sorted = sorted;
|
public void | setSubselectLoadable(boolean subqueryLoadable)
this.subselectLoadable = subqueryLoadable;
|
public void | setTypeName(java.lang.String typeName)
this.typeName = typeName;
|
public void | setTypeParameters(java.util.Properties parameterMap)
this.typeParameters = parameterMap;
|
public void | setTypeUsingReflection(java.lang.String className, java.lang.String propertyName)
|
public void | setWhere(java.lang.String where)
this.where = where;
|
public java.lang.String | toString()
return getClass().getName() + '(" + getRole() + ')";
|
public void | validate(org.hibernate.engine.Mapping mapping)
if ( getKey().isCascadeDeleteEnabled() && ( !isInverse() || !isOneToMany() ) ) {
throw new MappingException(
"only inverse one-to-many associations may use on-delete=\"cascade\": "
+ getRole() );
}
if ( !getKey().isValid( mapping ) ) {
throw new MappingException(
"collection foreign key mapping has wrong number of columns: "
+ getRole()
+ " type: "
+ getKey().getType().getName() );
}
if ( !getElement().isValid( mapping ) ) {
throw new MappingException(
"collection element mapping has wrong number of columns: "
+ getRole()
+ " type: "
+ getElement().getType().getName() );
}
checkColumnDuplication();
if ( elementNodeName!=null && elementNodeName.startsWith("@") ) {
throw new MappingException("element node must not be an attribute: " + elementNodeName );
}
if ( elementNodeName!=null && elementNodeName.equals(".") ) {
throw new MappingException("element node must not be the parent: " + elementNodeName );
}
if ( nodeName!=null && nodeName.indexOf('@")>-1 ) {
throw new MappingException("collection node must not be an attribute: " + elementNodeName );
}
|