Methods Summary |
---|
public void | addAuxiliaryDatabaseObject(org.hibernate.mapping.AuxiliaryDatabaseObject auxiliaryDatabaseObject)
auxiliaryDatabaseObjects.add( auxiliaryDatabaseObject );
|
public void | addClass(org.hibernate.mapping.PersistentClass persistentClass)
Object old = classes.put( persistentClass.getEntityName(), persistentClass );
if ( old!=null ) {
throw new DuplicateMappingException( "class/entity", persistentClass.getEntityName() );
}
|
public void | addCollection(org.hibernate.mapping.Collection collection)
Object old = collections.put( collection.getRole(), collection );
if ( old!=null ) {
throw new DuplicateMappingException( "collection role", collection.getRole() );
}
|
public void | addColumnBinding(java.lang.String logicalName, org.hibernate.mapping.Column finalColumn, org.hibernate.mapping.Table table)
ColumnNames binding = (ColumnNames) columnNameBindingPerTable.get(table);
if (binding == null) {
binding = new ColumnNames();
columnNameBindingPerTable.put(table, binding);
}
String oldFinalName = (String) binding.logicalToPhysical.put(
logicalName.toLowerCase(),
finalColumn.getQuotedName()
);
if ( oldFinalName != null &&
! ( finalColumn.isQuoted() ?
oldFinalName.equals( finalColumn.getQuotedName() ) :
oldFinalName.equalsIgnoreCase( finalColumn.getQuotedName() ) ) ) {
//TODO possibly relax that
throw new MappingException("Same logical column name referenced by different physical ones: "
+ table.getName() + "." + logicalName + " => '" + oldFinalName + "' and '" + finalColumn.getQuotedName() + "'" );
}
String oldLogicalName = (String) binding.physicalToLogical.put(
finalColumn.getQuotedName(),
logicalName
);
if ( oldLogicalName != null && ! oldLogicalName.equals( logicalName ) ) {
//TODO possibly relax that
throw new MappingException("Same physical column represented by different logical column names: "
+ table.getName() + "." + finalColumn.getQuotedName() + " => '" + oldLogicalName + "' and '" + logicalName + "'");
}
|
public org.hibernate.mapping.Table | addDenormalizedTable(java.lang.String schema, java.lang.String catalog, java.lang.String name, boolean isAbstract, java.lang.String subselect, org.hibernate.mapping.Table includedTable)
String key = subselect==null ?
Table.qualify(catalog, schema, name) :
subselect;
if ( tables.containsKey(key) ) {
throw new DuplicateMappingException("table", name);
}
Table table = new DenormalizedTable(includedTable);
table.setAbstract(isAbstract);
table.setName(name);
table.setSchema(schema);
table.setCatalog(catalog);
table.setSubselect(subselect);
tables.put(key, table);
return table;
|
public void | addFilterDefinition(org.hibernate.engine.FilterDefinition definition)
filterDefinitions.put( definition.getFilterName(), definition );
|
public void | addImport(java.lang.String className, java.lang.String rename)
String existing = (String) imports.put(rename, className);
if ( existing!=null ) {
if ( existing.equals(className) ) {
log.info( "duplicate import: " + className + "->" + rename );
}
else {
throw new DuplicateMappingException(
"duplicate import: " + rename +
" refers to both " + className +
" and " + existing +
" (try using auto-import=\"false\")",
"import",
rename
);
}
}
|
void | addPropertyReference(java.lang.String referencedClass, java.lang.String propertyName)
PropertyReference upr = new PropertyReference();
upr.referencedClass = referencedClass;
upr.propertyName = propertyName;
propertyReferences.add(upr);
|
public void | addQuery(java.lang.String name, org.hibernate.engine.NamedQueryDefinition query)
checkQueryExist(name);
queries.put( name.intern(), query );
|
public void | addResultSetMapping(org.hibernate.engine.ResultSetMappingDefinition sqlResultSetMapping)
final String name = sqlResultSetMapping.getName();
if ( resultSetMappings.containsKey(name) ) {
throw new DuplicateMappingException("resultSet", name);
}
resultSetMappings.put(name, sqlResultSetMapping);
|
public void | addSQLQuery(java.lang.String name, org.hibernate.engine.NamedSQLQueryDefinition query)
checkQueryExist(name);
sqlqueries.put( name.intern(), query );
|
public void | addSecondPass(SecondPass sp)
addSecondPass(sp, false);
|
public void | addSecondPass(SecondPass sp, boolean onTopOfTheQueue)
if (onTopOfTheQueue) {
secondPasses.add(0, sp);
}
else {
secondPasses.add(sp);
}
|
public org.hibernate.mapping.Table | addTable(java.lang.String schema, java.lang.String catalog, java.lang.String name, java.lang.String subselect, boolean isAbstract)
String key = subselect==null ?
Table.qualify(catalog, schema, name) :
subselect;
Table table = (Table) tables.get(key);
if (table == null) {
table = new Table();
table.setAbstract(isAbstract);
table.setName(name);
table.setSchema(schema);
table.setCatalog(catalog);
table.setSubselect(subselect);
tables.put(key, table);
}
else {
if (!isAbstract) table.setAbstract(false);
}
return table;
|
public void | addTableBinding(java.lang.String schema, java.lang.String catalog, java.lang.String logicalName, java.lang.String physicalName, org.hibernate.mapping.Table denormalizedSuperTable)
String key = buildTableNameKey( schema, catalog, physicalName );
TableDescription tableDescription = new TableDescription(
logicalName, denormalizedSuperTable
);
TableDescription oldDescriptor = (TableDescription) tableNameBinding.put( key, tableDescription );
if ( oldDescriptor != null && ! oldDescriptor.logicalName.equals( logicalName ) ) {
//TODO possibly relax that
throw new MappingException("Same physical table name reference several logical table names: "
+ physicalName + " => " + "'" + oldDescriptor.logicalName + "' and '" + logicalName + "'");
}
|
public void | addToExtendsQueue(ExtendsQueueEntry entry)
extendsQueue.put( entry, null );
|
public void | addTypeDef(java.lang.String typeName, java.lang.String typeClass, java.util.Properties paramMap)
TypeDef def = new TypeDef(typeClass, paramMap);
typeDefs.put(typeName, def);
log.debug("Added " + typeName + " with class " + typeClass);
|
void | addUniquePropertyReference(java.lang.String referencedClass, java.lang.String propertyName)
PropertyReference upr = new PropertyReference();
upr.referencedClass = referencedClass;
upr.propertyName = propertyName;
upr.unique = true;
propertyReferences.add(upr);
|
private java.lang.String | buildTableNameKey(java.lang.String schema, java.lang.String catalog, java.lang.String finalName)
StringBuffer keyBuilder = new StringBuffer();
if (schema != null) keyBuilder.append( schema );
keyBuilder.append( ".");
if (catalog != null) keyBuilder.append( catalog );
keyBuilder.append( ".");
keyBuilder.append( finalName );
return keyBuilder.toString();
|
private void | checkQueryExist(java.lang.String name)
if ( sqlqueries.containsKey(name) || queries.containsKey(name) ) {
throw new DuplicateMappingException("query", name);
}
|
public java.lang.String | getCatalogName()
return catalogName;
|
public org.hibernate.mapping.PersistentClass | getClass(java.lang.String className)
return (PersistentClass) classes.get(className);
|
public org.hibernate.mapping.Collection | getCollection(java.lang.String role)
return (Collection) collections.get(role);
|
public java.lang.String | getDefaultAccess()
return defaultAccess;
|
public java.lang.String | getDefaultCascade()
return defaultCascade;
|
public java.lang.String | getDefaultPackage()
return defaultPackage;
|
public org.hibernate.engine.FilterDefinition | getFilterDefinition(java.lang.String name)
return (FilterDefinition) filterDefinitions.get(name);
|
public java.util.Map | getFilterDefinitions()
return filterDefinitions;
|
public java.lang.String | getLogicalColumnName(java.lang.String physicalName, org.hibernate.mapping.Table table)
String logical = null;
Table currentTable = table;
TableDescription description = null;
do {
ColumnNames binding = (ColumnNames) columnNameBindingPerTable.get(currentTable);
if (binding != null) {
logical = (String) binding.physicalToLogical.get( physicalName );
}
String key = buildTableNameKey( currentTable.getSchema(), currentTable.getCatalog(), currentTable.getName() );
description = (TableDescription) tableNameBinding.get(key);
if (description != null) currentTable = description.denormalizedSupertable;
}
while (logical == null && currentTable != null && description != null);
if (logical == null) {
throw new MappingException( "Unable to find logical column name from physical name "
+ physicalName + " in table " + table.getName() );
}
return logical;
|
private java.lang.String | getLogicalTableName(java.lang.String schema, java.lang.String catalog, java.lang.String physicalName)
String key = buildTableNameKey( schema, catalog, physicalName );
TableDescription descriptor = (TableDescription) tableNameBinding.get( key );
if (descriptor == null) {
throw new MappingException( "Unable to find physical table: " + physicalName);
}
return descriptor.logicalName;
|
public java.lang.String | getLogicalTableName(org.hibernate.mapping.Table table)
return getLogicalTableName( table.getQuotedSchema(), table.getCatalog(), table.getQuotedName() );
|
public NamingStrategy | getNamingStrategy()
return namingStrategy;
|
public java.lang.String | getPhysicalColumnName(java.lang.String logicalName, org.hibernate.mapping.Table table)
logicalName = logicalName.toLowerCase();
String finalName = null;
Table currentTable = table;
do {
ColumnNames binding = (ColumnNames) columnNameBindingPerTable.get(currentTable);
if (binding != null) {
finalName = (String) binding.logicalToPhysical.get( logicalName );
}
String key = buildTableNameKey( currentTable.getSchema(), currentTable.getCatalog(), currentTable.getName() );
TableDescription description = (TableDescription) tableNameBinding.get(key);
if (description != null) currentTable = description.denormalizedSupertable;
}
while (finalName == null && currentTable != null);
if (finalName == null) {
throw new MappingException( "Unable to find column with logical name "
+ logicalName + " in table " + table.getName() );
}
return finalName;
|
public org.hibernate.engine.NamedQueryDefinition | getQuery(java.lang.String name)
return (NamedQueryDefinition) queries.get(name);
|
public org.hibernate.engine.ResultSetMappingDefinition | getResultSetMapping(java.lang.String name)
return (ResultSetMappingDefinition) resultSetMappings.get(name);
|
public java.lang.String | getSchemaName()
return schemaName;
|
public org.hibernate.mapping.Table | getTable(java.lang.String schema, java.lang.String catalog, java.lang.String name)
String key = Table.qualify(catalog, schema, name);
return (Table) tables.get(key);
|
public org.hibernate.mapping.TypeDef | getTypeDef(java.lang.String typeName)
return (TypeDef) typeDefs.get(typeName);
|
public boolean | isAutoImport()Returns the autoImport.
return autoImport;
|
public boolean | isDefaultLazy()
return defaultLazy;
|
public java.util.Iterator | iterateCollections()
return collections.values().iterator();
|
public java.util.Iterator | iterateTables()
return tables.values().iterator();
|
public org.hibernate.mapping.PersistentClass | locatePersistentClassByEntityName(java.lang.String entityName)
PersistentClass persistentClass = ( PersistentClass ) classes.get( entityName );
if ( persistentClass == null ) {
String actualEntityName = ( String ) imports.get( entityName );
if ( StringHelper.isNotEmpty( actualEntityName ) ) {
persistentClass = ( PersistentClass ) classes.get( actualEntityName );
}
}
return persistentClass;
|
public void | setAutoImport(boolean autoImport)Sets the autoImport.
this.autoImport = autoImport;
|
public void | setCatalogName(java.lang.String catalogName)Sets the catalogName.
this.catalogName = catalogName;
|
public void | setDefaultAccess(java.lang.String defaultAccess)sets the default access strategy
this.defaultAccess = defaultAccess;
|
public void | setDefaultCascade(java.lang.String defaultCascade)Sets the defaultCascade.
this.defaultCascade = defaultCascade;
|
public void | setDefaultLazy(boolean defaultLazy)
this.defaultLazy = defaultLazy;
|
public void | setDefaultPackage(java.lang.String defaultPackage)
this.defaultPackage = defaultPackage;
|
public void | setSchemaName(java.lang.String schemaName)Sets the schemaName.
this.schemaName = schemaName;
|