@java.lang.SuppressWarnings("WeakerAccess") public class GrailsDomainBinder extends java.lang.Object implements org.hibernate.boot.spi.MetadataContributor
Handles the binding Grails domain classes and properties to the Hibernate runtime meta model. Based on the HbmBinder code in Hibernate core and influenced by AnnotationsBinder.
Modifiers | Name | Description |
---|---|---|
protected static java.lang.String |
BACKTICK |
|
protected static java.lang.String |
CASCADE_ALL |
|
protected static java.lang.String |
CASCADE_ALL_DELETE_ORPHAN |
|
protected static java.lang.String |
CASCADE_NONE |
|
protected static java.lang.String |
CASCADE_SAVE_UPDATE |
|
protected GrailsDomainBinder.CollectionType |
CT |
|
protected static java.lang.String |
DEFAULT_ENUM_TYPE |
|
protected static java.lang.String |
EMPTY_PATH |
|
protected static java.lang.String |
ENUM_CLASS_PROP |
|
protected static java.lang.String |
ENUM_TYPE_CLASS |
|
protected static java.lang.String |
ENUM_TYPE_PROP |
|
protected static java.lang.String |
FOREIGN_KEY_SUFFIX |
|
protected static org.slf4j.Logger |
LOG |
|
static org.hibernate.mapping.Map<java.lang.String, org.hibernate.cfg.NamingStrategy> |
NAMING_STRATEGIES |
Overrideable naming strategy. |
static java.lang.String |
SEQUENCE_KEY |
|
protected static java.lang.String |
STRING_TYPE |
|
protected static char |
UNDERSCORE |
|
protected java.lang.String |
dataSourceName |
|
protected groovy.lang.Closure |
defaultMapping |
|
protected HibernateMappingContext |
hibernateMappingContext |
|
protected org.hibernate.boot.spi.MetadataBuildingContext |
metadataBuildingContext |
|
protected PersistentEntityNamingStrategy |
namingStrategy |
|
protected java.lang.String |
sessionFactoryName |
Constructor and description |
---|
GrailsDomainBinder
(java.lang.String dataSourceName, java.lang.String sessionFactoryName, HibernateMappingContext hibernateMappingContext) |
Type Params | Return Type | Name and description |
---|---|---|
|
protected void |
addMultiTenantFilterIfNecessary(HibernatePersistentEntity entity, org.hibernate.mapping.PersistentClass persistentClass, org.hibernate.boot.spi.InFlightMetadataCollector mappings, java.lang.String sessionFactoryBeanName) Add a Hibernate filter for multitenancy if the persistent class is multitenant |
|
protected java.lang.String |
addUnderscore(java.lang.String s1, java.lang.String s2) |
|
public void |
bindClass(PersistentEntity entity, org.hibernate.boot.spi.InFlightMetadataCollector mappings, java.lang.String sessionFactoryBeanName) Binds a Grails domain class to the Hibernate runtime meta model |
|
protected void |
bindClass(PersistentEntity domainClass, org.hibernate.mapping.PersistentClass persistentClass, org.hibernate.boot.spi.InFlightMetadataCollector mappings) Binds the specified persistant class to the runtime model based on the properties defined in the domain class |
|
protected void |
bindCollection(ToMany property, java.util.Collection collection, org.hibernate.mapping.PersistentClass owner, org.hibernate.boot.spi.InFlightMetadataCollector mappings, java.lang.String path, java.lang.String sessionFactoryBeanName) First pass to bind collection to Hibernate metamodel, sets up second pass |
|
protected void |
bindCollectionForPropertyConfig(java.util.Collection collection, PropertyConfig config) |
|
protected void |
bindCollectionSecondPass(ToMany property, org.hibernate.boot.spi.InFlightMetadataCollector mappings, org.hibernate.mapping.Map<?, ?> persistentClasses, java.util.Collection collection, java.lang.String sessionFactoryBeanName) |
|
protected void |
bindCollectionTable(ToMany property, org.hibernate.boot.spi.InFlightMetadataCollector mappings, java.util.Collection collection, Table ownerTable, java.lang.String sessionFactoryBeanName) |
|
protected void |
bindCollectionWithJoinTable(ToMany property, org.hibernate.boot.spi.InFlightMetadataCollector mappings, java.util.Collection collection, PropertyConfig config, java.lang.String sessionFactoryBeanName) |
|
protected void |
bindColumn(PersistentProperty property, PersistentProperty parentProperty, org.hibernate.mapping.Column column, ColumnConfig cc, java.lang.String path, Table table, java.lang.String sessionFactoryBeanName) Binds a Column instance to the Hibernate meta model |
|
protected void |
bindColumnConfigToColumn(PersistentProperty property, org.hibernate.mapping.Column column, ColumnConfig columnConfig) |
|
protected void |
bindComponent(org.hibernate.mapping.Component component, Embedded property, boolean isNullable, org.hibernate.boot.spi.InFlightMetadataCollector mappings, java.lang.String sessionFactoryBeanName) Binds a Hibernate component type using the given GrailsDomainClassProperty instance |
|
protected void |
bindComponentProperty(org.hibernate.mapping.Component component, PersistentProperty componentProperty, PersistentProperty currentGrailsProp, org.hibernate.mapping.PersistentClass persistentClass, java.lang.String path, Table table, org.hibernate.boot.spi.InFlightMetadataCollector mappings, java.lang.String sessionFactoryBeanName) |
|
protected void |
bindCompositeId(PersistentEntity domainClass, org.hibernate.mapping.RootClass root, CompositeIdentity compositeIdentity, org.hibernate.boot.spi.InFlightMetadataCollector mappings, java.lang.String sessionFactoryBeanName) |
|
protected void |
bindCompositeIdentifierToManyToOne(Association property, org.hibernate.mapping.SimpleValue value, CompositeIdentity compositeId, PersistentEntity refDomainClass, java.lang.String path, java.lang.String sessionFactoryBeanName) |
|
protected void |
bindDependentKeyValue(PersistentProperty property, org.hibernate.mapping.DependantValue key, org.hibernate.boot.spi.InFlightMetadataCollector mappings, java.lang.String sessionFactoryBeanName) Binds the primary key value column |
|
protected void |
bindDiscriminatorProperty(Table table, org.hibernate.mapping.RootClass entity, org.hibernate.boot.spi.InFlightMetadataCollector mappings) Creates and binds the discriminator property used in table-per-hierarchy inheritance to discriminate between sub class instances |
|
protected void |
bindEnumType(PersistentProperty property, org.hibernate.mapping.SimpleValue simpleValue, java.lang.String path, java.lang.String sessionFactoryBeanName) |
|
protected void |
bindEnumType(PersistentProperty property, java.lang.Class<?> propertyType, org.hibernate.mapping.SimpleValue simpleValue, java.lang.String columnName) |
|
protected void |
bindIdentity(HibernatePersistentEntity domainClass, org.hibernate.mapping.RootClass root, org.hibernate.boot.spi.InFlightMetadataCollector mappings, Mapping gormMapping, java.lang.String sessionFactoryBeanName) |
|
protected void |
bindIndex(java.lang.String columnName, org.hibernate.mapping.Column column, ColumnConfig cc, Table table) |
|
protected void |
bindJoinedSubClass(HibernatePersistentEntity sub, org.hibernate.mapping.JoinedSubclass joinedSubclass, org.hibernate.boot.spi.InFlightMetadataCollector mappings, Mapping gormMapping, java.lang.String sessionFactoryBeanName) Binds a joined sub-class mapping using table-per-subclass |
|
protected void |
bindListSecondPass(ToMany property, org.hibernate.boot.spi.InFlightMetadataCollector mappings, org.hibernate.mapping.Map<?, ?> persistentClasses, org.hibernate.mapping.List list, java.lang.String sessionFactoryBeanName) |
|
protected void |
bindManyToMany(Association property, ManyToOne element, org.hibernate.boot.spi.InFlightMetadataCollector mappings, java.lang.String sessionFactoryBeanName) Binds a many-to-many relationship. |
|
protected void |
bindManyToOne(Association property, ManyToOne manyToOne, java.lang.String path, org.hibernate.boot.spi.InFlightMetadataCollector mappings, java.lang.String sessionFactoryBeanName) Binds a many-to-one relationship to the |
|
protected void |
bindManyToOneValues(Association property, ManyToOne manyToOne) |
|
protected void |
bindMapSecondPass(ToMany property, org.hibernate.boot.spi.InFlightMetadataCollector mappings, org.hibernate.mapping.Map<?, ?> persistentClasses, org.hibernate.mapping.Map map, java.lang.String sessionFactoryBeanName) |
|
protected void |
bindNaturalIdentifier(Table table, Mapping mapping, org.hibernate.mapping.PersistentClass persistentClass) |
|
protected void |
bindNumericColumnConstraints(org.hibernate.mapping.Column column, PersistentProperty constrainedProperty) |
|
protected void |
bindNumericColumnConstraints(org.hibernate.mapping.Column column, PersistentProperty property, ColumnConfig cc) Interrogates the specified constraints looking for any constraints that would limit the precision and/or scale of the property's value. |
|
protected void |
bindOneToMany(OneToMany currentGrailsProp, OneToMany one, org.hibernate.boot.spi.InFlightMetadataCollector mappings) |
|
protected void |
bindOneToOne(OneToOne property, OneToOne oneToOne, java.lang.String path, java.lang.String sessionFactoryBeanName) |
|
protected void |
bindOneToOneInternal(OneToOne property, OneToOne oneToOne, java.lang.String path) |
|
protected void |
bindProperty(PersistentProperty grailsProperty, Property prop, org.hibernate.boot.spi.InFlightMetadataCollector mappings) Binds a property to Hibernate runtime meta model. |
|
public void |
bindRoot(HibernatePersistentEntity entity, org.hibernate.boot.spi.InFlightMetadataCollector mappings, java.lang.String sessionFactoryBeanName) Binds a root class (one with no super classes) to the runtime meta model based on the supplied Grails domain class |
|
protected void |
bindRootPersistentClassCommonValues(HibernatePersistentEntity domainClass, org.hibernate.mapping.RootClass root, org.hibernate.boot.spi.InFlightMetadataCollector mappings, java.lang.String sessionFactoryBeanName) |
|
protected void |
bindSimpleId(PersistentProperty identifier, org.hibernate.mapping.RootClass entity, org.hibernate.boot.spi.InFlightMetadataCollector mappings, Identity mappedId, java.lang.String sessionFactoryBeanName) |
|
protected void |
bindSimpleValue(PersistentProperty property, PersistentProperty parentProperty, org.hibernate.mapping.SimpleValue simpleValue, java.lang.String path, org.hibernate.boot.spi.InFlightMetadataCollector mappings, java.lang.String sessionFactoryBeanName) Binds a simple value to the Hibernate metamodel. |
|
protected void |
bindSimpleValue(PersistentProperty grailsProp, org.hibernate.mapping.SimpleValue simpleValue, java.lang.String path, PropertyConfig propertyConfig, java.lang.String sessionFactoryBeanName) |
|
protected void |
bindSimpleValue(PersistentProperty grailsProp, PersistentProperty parentProperty, org.hibernate.mapping.SimpleValue simpleValue, java.lang.String path, PropertyConfig propertyConfig, java.lang.String sessionFactoryBeanName) |
|
protected void |
bindSimpleValue(java.lang.String type, org.hibernate.mapping.SimpleValue simpleValue, boolean nullable, java.lang.String columnName, org.hibernate.boot.spi.InFlightMetadataCollector mappings) Binds a value for the specified parameters to the meta model. |
|
protected void |
bindStringColumnConstraints(org.hibernate.mapping.Column column, PersistentProperty constrainedProperty) Interrogates the specified constraints looking for any constraints that would limit the length of the property's value. |
|
protected void |
bindSubClass(HibernatePersistentEntity sub, org.hibernate.mapping.PersistentClass parent, org.hibernate.boot.spi.InFlightMetadataCollector mappings, java.lang.String sessionFactoryBeanName) Binds a sub class. |
|
protected void |
bindSubClass(HibernatePersistentEntity sub, org.hibernate.mapping.Subclass subClass, org.hibernate.boot.spi.InFlightMetadataCollector mappings, java.lang.String sessionFactoryBeanName) Binds a sub-class using table-per-hierarchy inheritance mapping |
|
protected void |
bindSubClasses(HibernatePersistentEntity domainClass, org.hibernate.mapping.PersistentClass parent, org.hibernate.boot.spi.InFlightMetadataCollector mappings, java.lang.String sessionFactoryBeanName) Binds the sub classes of a root class using table-per-heirarchy inheritance mapping |
|
protected void |
bindUnidirectionalOneToMany(OneToMany property, org.hibernate.boot.spi.InFlightMetadataCollector mappings, java.util.Collection collection) Binds a unidirectional one-to-many creating a psuedo back reference property in the process. |
|
protected void |
bindUnidirectionalOneToManyInverseValues(ToMany property, ManyToOne manyToOne)
|
|
public void |
bindUnionSubclass(HibernatePersistentEntity subClass, org.hibernate.mapping.UnionSubclass unionSubclass, org.hibernate.boot.spi.InFlightMetadataCollector mappings, java.lang.String sessionFactoryBeanName) |
|
protected void |
bindVersion(PersistentProperty version, org.hibernate.mapping.RootClass entity, org.hibernate.boot.spi.InFlightMetadataCollector mappings, java.lang.String sessionFactoryBeanName) |
|
protected org.hibernate.mapping.Set<java.lang.String> |
buildDiscriminatorSet(HibernatePersistentEntity domainClass) |
|
protected java.lang.String |
buildOrderByClause(java.lang.String hqlOrderBy, org.hibernate.mapping.PersistentClass associatedClass, java.lang.String role, java.lang.String defaultOrder) |
|
protected java.lang.String |
calculateTableForMany(ToMany property, java.lang.String sessionFactoryBeanName) Calculates the mapping table for a many-to-many. |
|
protected boolean |
canBindOneToOneWithSingleColumnAndForeignKey(Association currentGrailsProp) |
|
public static void |
clearMappingCache() |
|
public static void |
clearMappingCache(java.lang.Class<?> theClass) |
|
protected void |
configureDerivedProperties(PersistentEntity domainClass, Mapping m) |
|
public static void |
configureNamingStrategy(java.lang.Object strategy) Override the default naming strategy for the default datasource given a Class or a full class name. |
|
public static void |
configureNamingStrategy(java.lang.String datasourceName, java.lang.Object strategy) Override the default naming strategy given a Class or a full class name, or an instance of a NamingStrategy. |
|
public void |
contribute(org.hibernate.boot.spi.InFlightMetadataCollector metadataCollector, org.jboss.jandex.IndexView jandexIndex) |
|
protected int |
countDigits(java.lang.Number number)
|
|
public java.util.Collection |
create(ToMany property, org.hibernate.mapping.PersistentClass owner, java.lang.String path, org.hibernate.boot.spi.InFlightMetadataCollector mappings, java.lang.String sessionFactoryBeanName) |
|
protected void |
createClassProperties(HibernatePersistentEntity domainClass, org.hibernate.mapping.PersistentClass persistentClass, org.hibernate.boot.spi.InFlightMetadataCollector mappings, java.lang.String sessionFactoryBeanName) Creates and binds the properties for the specified Grails domain class and PersistentClass and binds them to the Hibernate runtime meta model |
|
protected void |
createKeyForProps(PersistentProperty grailsProp, java.lang.String path, Table table, java.lang.String columnName, org.hibernate.mapping.List<?> propertyNames, java.lang.String sessionFactoryBeanName) |
|
protected org.hibernate.mapping.DependantValue |
createPrimaryKeyValue(org.hibernate.boot.spi.InFlightMetadataCollector mappings, PersistentProperty property, java.util.Collection collection, org.hibernate.mapping.Map<?, ?> persistentClasses) Creates the DependentValue object that forms a primary key reference for the collection. |
|
protected Property |
createProperty(org.hibernate.mapping.Value value, org.hibernate.mapping.PersistentClass persistentClass, PersistentProperty grailsProperty, org.hibernate.boot.spi.InFlightMetadataCollector mappings) |
|
protected void |
createUniqueKeyForColumns(Table table, java.lang.String columnName, org.hibernate.mapping.List<org.hibernate.mapping.Column> columns) |
|
public Mapping |
evaluateMapping(PersistentEntity domainClass) Evaluates a Mapping object from the domain class if it has a mapping closure |
|
public Mapping |
evaluateMapping(PersistentEntity domainClass, groovy.lang.Closure<?> defaultMapping) |
|
public Mapping |
evaluateMapping(PersistentEntity domainClass, groovy.lang.Closure<?> defaultMapping, boolean cache) |
|
protected java.lang.String |
getAssociationDescription(Association grailsProperty) |
|
protected org.hibernate.mapping.Column |
getColumnForSimpleValue(org.hibernate.mapping.SimpleValue element) |
|
protected java.lang.String |
getColumnNameForPropertyAndPath(PersistentProperty grailsProp, java.lang.String path, ColumnConfig cc, java.lang.String sessionFactoryBeanName) |
|
protected java.lang.String |
getDefaultColumnName(PersistentProperty property, java.lang.String sessionFactoryBeanName) |
|
protected java.lang.String |
getForeignKeyForPropertyDomainClass(PersistentProperty property, java.lang.String sessionFactoryBeanName) |
|
protected java.lang.String |
getIndexColumnName(PersistentProperty property, java.lang.String sessionFactoryBeanName) |
|
protected java.lang.String |
getIndexColumnType(PersistentProperty property, java.lang.String defaultType) |
|
protected boolean |
getInsertableness(PersistentProperty grailsProperty) |
|
protected java.lang.String |
getJoinedSubClassTableName(HibernatePersistentEntity sub, org.hibernate.mapping.PersistentClass model, Table denormalizedSuperTable, org.hibernate.boot.spi.InFlightMetadataCollector mappings, java.lang.String sessionFactoryBeanName) |
|
protected boolean |
getLaziness(PersistentProperty grailsProperty) |
|
protected java.lang.String |
getMapElementName(PersistentProperty property, java.lang.String sessionFactoryBeanName) |
|
public static Mapping |
getMapping(java.lang.Class<?> theClass) Obtains a mapping object for the given domain class nam |
|
public static Mapping |
getMapping(PersistentEntity domainClass) Obtains a mapping object for the given domain class nam |
|
protected int |
getMaxSize(org.hibernate.mapping.List<?> inListValues)
|
|
public org.hibernate.boot.spi.MetadataBuildingContext |
getMetadataBuildingContext() |
|
protected java.lang.String |
getNameForPropertyAndPath(PersistentProperty property, java.lang.String path) |
|
protected org.hibernate.cfg.NamingStrategy |
getNamingStrategy(java.lang.String sessionFactoryBeanName) |
|
protected Property |
getProperty(org.hibernate.mapping.PersistentClass associatedClass, java.lang.String propertyName) |
|
public PropertyConfig |
getPropertyConfig(PersistentProperty property) |
|
protected Mapping |
getRootMapping(PersistentEntity referenced) |
|
protected ColumnConfig |
getSingleColumnConfig(PropertyConfig propertyConfig) |
|
protected java.lang.String |
getTableName(PersistentEntity domainClass, java.lang.String sessionFactoryBeanName) Evaluates the table name for the given property |
|
protected java.lang.String |
getTypeName(PersistentProperty property, PropertyConfig config, Mapping mapping) |
|
protected boolean |
getUpdateableness(PersistentProperty grailsProperty) |
|
protected java.lang.Class<?> |
getUserType(PersistentProperty currentGrailsProp) |
|
protected void |
handleUniqueConstraint(PersistentProperty property, org.hibernate.mapping.Column column, java.lang.String path, Table table, java.lang.String columnName, java.lang.String sessionFactoryBeanName) |
|
protected boolean |
hasCompositeIdentifier(Mapping mapping) |
|
protected boolean |
hasJoinColumnMapping(PropertyConfig config) |
|
protected boolean |
hasJoinKeyMapping(PropertyConfig c) |
|
protected boolean |
hasJoinTableColumnNameMapping(PropertyConfig pc) |
|
protected boolean |
isBidirectionalManyToOne(PersistentProperty currentGrailsProp) |
|
protected boolean |
isBidirectionalManyToOneWithListMapping(PersistentProperty grailsProperty, Property prop) |
|
protected boolean |
isBidirectionalOneToManyMap(Association property) |
|
protected boolean |
isCircularAssociation(PersistentProperty grailsProperty) |
|
protected boolean |
isComponentPropertyNullable(PersistentProperty componentProperty) |
|
protected boolean |
isCompositeIdProperty(Mapping gormMapping, PersistentProperty currentGrailsProp) |
|
protected boolean |
isIdentityProperty(Mapping gormMapping, PersistentProperty currentGrailsProp) |
|
protected boolean |
isNonPropertyToken(java.lang.String token) |
|
protected boolean |
isNotEmpty(java.lang.String s) |
|
protected boolean |
isSaveUpdateCascade(java.lang.String cascade) Check if a save-update cascade is defined within the Hibernate cascade properties string. |
|
protected boolean |
isSorted(PersistentProperty property) Establish whether a collection property is sorted |
|
protected boolean |
isUnidirectionalOneToMany(PersistentProperty property) Checks whether a property is a unidirectional non-circular one-to-many |
|
protected void |
linkBidirectionalOneToMany(java.util.Collection collection, org.hibernate.mapping.PersistentClass associatedClass, org.hibernate.mapping.DependantValue key, PersistentProperty otherSide) Links a bidirectional one-to-many, configuring the inverse side and using a column copy to perform the link |
|
protected void |
linkValueUsingAColumnCopy(PersistentProperty prop, org.hibernate.mapping.Column column, org.hibernate.mapping.DependantValue key) |
|
protected void |
logCascadeMapping(Association grailsProperty, java.lang.String cascadeStrategy, PersistentEntity referenced) |
|
protected java.lang.String |
qualify(java.lang.String prefix, java.lang.String name) |
|
protected java.lang.String |
removeBackticks(java.lang.String s) |
|
protected void |
setCascadeBehaviour(PersistentProperty grailsProperty, Property prop) |
|
public void |
setDefaultMapping(groovy.lang.Closure defaultMapping) The default mapping defined by Settings.SETTING_DEFAULT_MAPPING |
|
protected void |
setGeneratedUniqueName(org.hibernate.mapping.UniqueKey uk) |
|
public void |
setNamingStrategy(PersistentEntityNamingStrategy namingStrategy)
|
|
protected void |
setTypeForPropertyConfig(PersistentProperty grailsProp, org.hibernate.mapping.SimpleValue simpleValue, PropertyConfig config) |
|
protected boolean |
shouldBindCollectionWithForeignKey(ToMany property) |
|
protected boolean |
shouldCollectionBindWithJoinColumn(ToMany property) |
|
protected boolean |
supportsJoinColumnMapping(PersistentProperty grailsProp) |
|
protected void |
trackCustomCascadingSaves(Mapping mapping, java.lang.Iterable<PersistentProperty> persistentProperties) Checks for any custom cascading saves set up via the mapping DSL and records them within the persistent property. |
|
protected java.lang.String |
trimBackTigs(java.lang.String tableName) |
|
protected java.lang.String |
unqualify(java.lang.String qualifiedName) |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Overrideable naming strategy. Defaults to ImprovedNamingStrategy
but can
be configured in DataSource.groovy via hibernate.naming_strategy = ...
.
Add a Hibernate filter for multitenancy if the persistent class is multitenant
entity
- target persistent entity for get tenant informationpersistentClass
- persistent class for add the filter and get tenant property infomappings
- mappings to add the filtersessionFactoryBeanName
- the session factory bean nameBinds a Grails domain class to the Hibernate runtime meta model
entity
- The domain class to bindmappings
- The existing mappingssessionFactoryBeanName
- the session factory bean nameBinds the specified persistant class to the runtime model based on the properties defined in the domain class
domainClass
- The Grails domain classpersistentClass
- The persistant classmappings
- Existing mappingsFirst pass to bind collection to Hibernate metamodel, sets up second pass
property
- The GrailsDomainClassProperty instancecollection
- The collectionowner
- The owning persistent classmappings
- The Hibernate mappings instanceBinds a Column instance to the Hibernate meta model
property
- The Grails domain class propertycolumn
- The column to bindtable
- The table namesessionFactoryBeanName
- the session factory bean nameBinds a Hibernate component type using the given GrailsDomainClassProperty instance
component
- The component to bindproperty
- The propertyisNullable
- Whether it is nullable or notmappings
- The Hibernate Mappings objectsessionFactoryBeanName
- the session factory bean nameBinds the primary key value column
property
- The propertykey
- The keymappings
- The mappingssessionFactoryBeanName
- The name of the session factoryCreates and binds the discriminator property used in table-per-hierarchy inheritance to discriminate between sub class instances
table
- The table to bind ontoentity
- The root class entitymappings
- The mappings instanceBinds a joined sub-class mapping using table-per-subclass
sub
- The Grails sub classjoinedSubclass
- The Hibernate Subclass objectmappings
- The mappings ObjectgormMapping
- The GORM mapping objectsessionFactoryBeanName
- the session factory bean nameBinds a many-to-many relationship. A many-to-many consists of - a key (a DependentValue) - an element The element is a ManyToOne from the association table to the target entity
property
- The grails propertyelement
- The ManyToOne elementmappings
- The mappingsBinds a many-to-one relationship to the
Interrogates the specified constraints looking for any constraints that would limit the precision and/or scale of the property's value. If such constraints exist, this method adjusts the precision and/or scale of the column accordingly.
column
- the column that corresponds to the propertyproperty
- the property's constraintscc
- the column configurationBinds a property to Hibernate runtime meta model. Deals with cascade strategy based on the Grails domain model
grailsProperty
- The grails property instanceprop
- The Hibernate propertymappings
- The Hibernate mappingsBinds a root class (one with no super classes) to the runtime meta model based on the supplied Grails domain class
entity
- The Grails domain classmappings
- The Hibernate Mappings objectsessionFactoryBeanName
- the session factory bean nameBinds a simple value to the Hibernate metamodel. A simple value is any type within the Hibernate type system
simpleValue
- The simple value to bindmappings
- The Hibernate mappings instancesessionFactoryBeanName
- the session factory bean nameBinds a value for the specified parameters to the meta model.
type
- The type of the propertysimpleValue
- The simple value instancenullable
- Whether it is nullablecolumnName
- The property namemappings
- The mappingsInterrogates the specified constraints looking for any constraints that would limit the length of the property's value. If such constraints exist, this method adjusts the length of the column accordingly.
column
- the column that corresponds to the propertyconstrainedProperty
- the property's constraintsBinds a sub class.
sub
- The sub domain class instanceparent
- The parent persistent class instancemappings
- The mappings instancesessionFactoryBeanName
- the session factory bean nameBinds a sub-class using table-per-hierarchy inheritance mapping
sub
- The Grails domain class instance representing the sub-classsubClass
- The Hibernate SubClass instancemappings
- The mappings instanceBinds the sub classes of a root class using table-per-heirarchy inheritance mapping
domainClass
- The root domain class to bindparent
- The parent class instancemappings
- The mappings instancesessionFactoryBeanName
- the session factory bean nameBinds a unidirectional one-to-many creating a psuedo back reference property in the process.
property
- The property to bindmanyToOne
- The inverse sideCalculates the mapping table for a many-to-many. One side of the relationship has to "own" the relationship so that there is not a situation where you have two mapping tables for left_right and right_left
Override the default naming strategy for the default datasource given a Class or a full class name.
strategy
- the class or nameOverride the default naming strategy given a Class or a full class name, or an instance of a NamingStrategy.
datasourceName
- the datasource namestrategy
- the class, name, or instance
Creates and binds the properties for the specified Grails domain class and PersistentClass and binds them to the Hibernate runtime meta model
domainClass
- The Grails domain classpersistentClass
- The Hibernate PersistentClass instancemappings
- The Hibernate Mappings instancesessionFactoryBeanName
- the session factory bean nameCreates the DependentValue object that forms a primary key reference for the collection.
property
- The grails propertycollection
- The collection objectEvaluates a Mapping object from the domain class if it has a mapping closure
domainClass
- The domain classObtains a mapping object for the given domain class nam
theClass
- The domain class in questionObtains a mapping object for the given domain class nam
domainClass
- The domain class in question
Evaluates the table name for the given property
domainClass
- The domain class to evaluateCheck if a save-update cascade is defined within the Hibernate cascade properties string.
cascade
- The string containing the cascade properties.Establish whether a collection property is sorted
property
- The propertyChecks whether a property is a unidirectional non-circular one-to-many
property
- The property to checkLinks a bidirectional one-to-many, configuring the inverse side and using a column copy to perform the link
collection
- The collection one-to-manyassociatedClass
- The associated classkey
- The keyotherSide
- The other side of the relationshipThe default mapping defined by Settings.SETTING_DEFAULT_MAPPING
defaultMapping
- The default mapping
namingStrategy
- Custom naming strategy to plugin into table namingChecks for any custom cascading saves set up via the mapping DSL and records them within the persistent property.
mapping
- The Mapping.persistentProperties
- The persistent properties of the domain class.