public class GrailsDomainBinder extends Object
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 String |
BACKTICK |
|
protected static String |
CASCADE_ALL |
|
protected static String |
CASCADE_ALL_DELETE_ORPHAN |
|
protected static String |
CASCADE_NONE |
|
protected static String |
CASCADE_SAVE_UPDATE |
|
protected GrailsDomainBinder.CollectionType |
CT |
|
protected static String |
DEFAULT_ENUM_TYPE |
|
protected static String |
EMPTY_PATH |
|
protected static String |
ENUM_CLASS_PROP |
|
protected static String |
ENUM_TYPE_CLASS |
|
protected static String |
ENUM_TYPE_PROP |
|
static String |
FOREIGN_KEY_SUFFIX |
|
protected static org.apache.commons.logging.Log |
LOG |
|
static org.hibernate.mapping.Map<String, org.hibernate.cfg.NamingStrategy> |
NAMING_STRATEGIES |
Overrideable naming strategy. |
static String |
SEQUENCE_KEY |
|
protected static String |
STRING_TYPE |
|
protected static char |
UNDERSCORE |
|
protected String |
dataSourceName |
|
protected Closure |
defaultMapping |
|
protected HibernateMappingContext |
hibernateMappingContext |
|
protected org.hibernate.boot.spi.MetadataBuildingContext |
metadataBuildingContext |
|
protected PersistentEntityNamingStrategy |
namingStrategy |
|
protected String |
sessionFactoryName |
Constructor and description |
---|
GrailsDomainBinder
(String dataSourceName, String sessionFactoryName, HibernateMappingContext hibernateMappingContext) |
Type Params | Return Type | Name and description |
---|---|---|
|
protected String |
addUnderscore(String s1, String s2) |
|
void |
bindClass(PersistentEntity entity, org.hibernate.boot.spi.InFlightMetadataCollector mappings, 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, org.hibernate.mapping.Collection collection, org.hibernate.mapping.PersistentClass owner, org.hibernate.boot.spi.InFlightMetadataCollector mappings, String path, String sessionFactoryBeanName) First pass to bind collection to Hibernate metamodel, sets up second pass |
|
protected void |
bindCollectionForPropertyConfig(org.hibernate.mapping.Collection collection, PropertyConfig config) |
|
protected void |
bindCollectionSecondPass(ToMany property, org.hibernate.boot.spi.InFlightMetadataCollector mappings, org.hibernate.mapping.Map<?, ?> persistentClasses, org.hibernate.mapping.Collection collection, String sessionFactoryBeanName) |
|
protected void |
bindCollectionTable(ToMany property, org.hibernate.boot.spi.InFlightMetadataCollector mappings, org.hibernate.mapping.Collection collection, Table ownerTable, String sessionFactoryBeanName) |
|
protected void |
bindCollectionWithJoinTable(ToMany property, org.hibernate.boot.spi.InFlightMetadataCollector mappings, org.hibernate.mapping.Collection collection, PropertyConfig config, String sessionFactoryBeanName) |
|
protected void |
bindColumn(PersistentProperty property, PersistentProperty parentProperty, org.hibernate.mapping.Column column, ColumnConfig cc, String path, Table table, 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, 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, String path, Table table, org.hibernate.boot.spi.InFlightMetadataCollector mappings, String sessionFactoryBeanName) |
|
protected void |
bindCompositeId(PersistentEntity domainClass, org.hibernate.mapping.RootClass root, CompositeIdentity compositeIdentity, org.hibernate.boot.spi.InFlightMetadataCollector mappings, String sessionFactoryBeanName) |
|
protected void |
bindCompositeIdentifierToManyToOne(Association property, org.hibernate.mapping.SimpleValue value, CompositeIdentity compositeId, PersistentEntity refDomainClass, String path, String sessionFactoryBeanName) |
|
protected void |
bindDependentKeyValue(PersistentProperty property, org.hibernate.mapping.DependantValue key, org.hibernate.boot.spi.InFlightMetadataCollector mappings, 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, String path, String sessionFactoryBeanName) |
|
protected void |
bindEnumType(PersistentProperty property, Class<?> propertyType, org.hibernate.mapping.SimpleValue simpleValue, String columnName) |
|
protected void |
bindIdentity(HibernatePersistentEntity domainClass, org.hibernate.mapping.RootClass root, org.hibernate.boot.spi.InFlightMetadataCollector mappings, Mapping gormMapping, String sessionFactoryBeanName) |
|
protected void |
bindIndex(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, 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, String sessionFactoryBeanName) |
|
protected void |
bindManyToMany(Association property, ManyToOne element, org.hibernate.boot.spi.InFlightMetadataCollector mappings, String sessionFactoryBeanName) Binds a many-to-many relationship. |
|
protected void |
bindManyToOne(Association property, ManyToOne manyToOne, String path, org.hibernate.boot.spi.InFlightMetadataCollector mappings, 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, 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, String path, String sessionFactoryBeanName) |
|
protected void |
bindOneToOneInternal(OneToOne property, OneToOne oneToOne, String path) |
|
protected void |
bindProperty(PersistentProperty grailsProperty, org.hibernate.mapping.Property prop, org.hibernate.boot.spi.InFlightMetadataCollector mappings) Binds a property to Hibernate runtime meta model. |
|
void |
bindRoot(HibernatePersistentEntity entity, org.hibernate.boot.spi.InFlightMetadataCollector mappings, 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, String sessionFactoryBeanName) |
|
protected void |
bindSimpleId(PersistentProperty identifier, org.hibernate.mapping.RootClass entity, org.hibernate.boot.spi.InFlightMetadataCollector mappings, Identity mappedId, String sessionFactoryBeanName) |
|
protected void |
bindSimpleValue(PersistentProperty property, PersistentProperty parentProperty, org.hibernate.mapping.SimpleValue simpleValue, String path, org.hibernate.boot.spi.InFlightMetadataCollector mappings, String sessionFactoryBeanName) Binds a simple value to the Hibernate metamodel. |
|
protected void |
bindSimpleValue(PersistentProperty grailsProp, org.hibernate.mapping.SimpleValue simpleValue, String path, PropertyConfig propertyConfig, String sessionFactoryBeanName) |
|
protected void |
bindSimpleValue(PersistentProperty grailsProp, PersistentProperty parentProperty, org.hibernate.mapping.SimpleValue simpleValue, String path, PropertyConfig propertyConfig, String sessionFactoryBeanName) |
|
protected void |
bindSimpleValue(String type, org.hibernate.mapping.SimpleValue simpleValue, boolean nullable, 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, String sessionFactoryBeanName) Binds a sub class. |
|
protected void |
bindSubClass(HibernatePersistentEntity sub, org.hibernate.mapping.Subclass subClass, org.hibernate.boot.spi.InFlightMetadataCollector mappings, 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, 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, org.hibernate.mapping.Collection collection) Binds a unidirectional one-to-many creating a psuedo back reference property in the process. |
|
protected void |
bindUnidirectionalOneToManyInverseValues(ToMany property, ManyToOne manyToOne) @param property The property to bind |
|
void |
bindUnionSubclass(HibernatePersistentEntity subClass, org.hibernate.mapping.UnionSubclass unionSubclass, org.hibernate.boot.spi.InFlightMetadataCollector mappings, String sessionFactoryBeanName) |
|
protected void |
bindVersion(PersistentProperty version, org.hibernate.mapping.RootClass entity, org.hibernate.boot.spi.InFlightMetadataCollector mappings, String sessionFactoryBeanName) |
|
protected org.hibernate.mapping.Set<String> |
buildDiscriminatorSet(HibernatePersistentEntity domainClass) |
|
protected String |
buildOrderByClause(String hqlOrderBy, org.hibernate.mapping.PersistentClass associatedClass, String role, String defaultOrder) |
|
protected String |
calculateTableForMany(ToMany property, String sessionFactoryBeanName) Calculates the mapping table for a many-to-many. |
|
protected boolean |
canBindOneToOneWithSingleColumnAndForeignKey(Association currentGrailsProp) |
|
static void |
clearMappingCache() |
|
static void |
clearMappingCache(Class<?> theClass) |
|
protected void |
configureDerivedProperties(PersistentEntity domainClass, Mapping m) |
|
static void |
configureNamingStrategy(Object strategy) Override the default naming strategy for the default datasource given a Class or a full class name. |
|
static void |
configureNamingStrategy(String datasourceName, Object strategy) Override the default naming strategy given a Class or a full class name, or an instance of a NamingStrategy. |
|
void |
contribute(org.hibernate.boot.spi.InFlightMetadataCollector metadataCollector, org.jboss.jandex.IndexView jandexIndex) |
|
protected int |
countDigits(Number number) @return a count of the digits in the specified number |
|
protected void |
createClassProperties(HibernatePersistentEntity domainClass, org.hibernate.mapping.PersistentClass persistentClass, org.hibernate.boot.spi.InFlightMetadataCollector mappings, 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, String path, Table table, String columnName, org.hibernate.mapping.List<?> propertyNames, String sessionFactoryBeanName) |
|
protected org.hibernate.mapping.DependantValue |
createPrimaryKeyValue(org.hibernate.boot.spi.InFlightMetadataCollector mappings, PersistentProperty property, org.hibernate.mapping.Collection collection, org.hibernate.mapping.Map<?, ?> persistentClasses) Creates the DependentValue object that forms a primary key reference for the collection. |
|
protected org.hibernate.mapping.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, String columnName, org.hibernate.mapping.List<org.hibernate.mapping.Column> columns) |
|
Mapping |
evaluateMapping(PersistentEntity domainClass) Evaluates a Mapping object from the domain class if it has a mapping closure |
|
Mapping |
evaluateMapping(PersistentEntity domainClass, Closure<?> defaultMapping) |
|
Mapping |
evaluateMapping(PersistentEntity domainClass, Closure<?> defaultMapping, boolean cache) |
|
protected String |
getAssociationDescription(Association grailsProperty) |
|
protected org.hibernate.mapping.Column |
getColumnForSimpleValue(org.hibernate.mapping.SimpleValue element) |
|
protected String |
getColumnNameForPropertyAndPath(PersistentProperty grailsProp, String path, ColumnConfig cc, String sessionFactoryBeanName) |
|
protected String |
getDefaultColumnName(PersistentProperty property, String sessionFactoryBeanName) |
|
protected String |
getForeignKeyForPropertyDomainClass(PersistentProperty property, String sessionFactoryBeanName) |
|
protected String |
getIndexColumnName(PersistentProperty property, String sessionFactoryBeanName) |
|
protected String |
getIndexColumnType(PersistentProperty property, String defaultType) |
|
protected boolean |
getInsertableness(PersistentProperty grailsProperty) |
|
protected String |
getJoinedSubClassTableName(HibernatePersistentEntity sub, org.hibernate.mapping.PersistentClass model, Table denormalizedSuperTable, org.hibernate.boot.spi.InFlightMetadataCollector mappings, String sessionFactoryBeanName) |
|
protected boolean |
getLaziness(PersistentProperty grailsProperty) |
|
protected String |
getMapElementName(PersistentProperty property, String sessionFactoryBeanName) |
|
static Mapping |
getMapping(Class<?> theClass) Obtains a mapping object for the given domain class nam |
|
static Mapping |
getMapping(PersistentEntity domainClass) Obtains a mapping object for the given domain class nam |
|
protected int |
getMaxSize(org.hibernate.mapping.List<?> inListValues) @return the maximum length of the strings in the specified list |
|
org.hibernate.boot.spi.MetadataBuildingContext |
getMetadataBuildingContext() |
|
protected String |
getNameForPropertyAndPath(PersistentProperty property, String path) |
|
protected org.hibernate.cfg.NamingStrategy |
getNamingStrategy(String sessionFactoryBeanName) |
|
protected org.hibernate.mapping.Property |
getProperty(org.hibernate.mapping.PersistentClass associatedClass, String propertyName) |
|
PropertyConfig |
getPropertyConfig(PersistentProperty property) |
|
protected Mapping |
getRootMapping(PersistentEntity referenced) |
|
protected ColumnConfig |
getSingleColumnConfig(PropertyConfig propertyConfig) |
|
protected String |
getTableName(PersistentEntity domainClass, String sessionFactoryBeanName) Evaluates the table name for the given property |
|
protected String |
getTypeName(PersistentProperty property, PropertyConfig config, Mapping mapping) |
|
protected boolean |
getUpdateableness(PersistentProperty grailsProperty) |
|
protected Class<?> |
getUserType(PersistentProperty currentGrailsProp) |
|
protected void |
handleLazyProxy(PersistentEntity domainClass, PersistentProperty grailsProperty) |
|
protected void |
handleUniqueConstraint(PersistentProperty property, org.hibernate.mapping.Column column, String path, Table table, String columnName, 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, org.hibernate.mapping.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(String token) |
|
protected boolean |
isNotEmpty(String s) |
|
protected boolean |
isSaveUpdateCascade(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(org.hibernate.mapping.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, String cascadeStrategy, PersistentEntity referenced) |
|
protected String |
qualify(String prefix, String name) |
|
protected String |
removeBackticks(String s) |
|
protected void |
setCascadeBehaviour(PersistentProperty grailsProperty, org.hibernate.mapping.Property prop) |
|
void |
setDefaultMapping(Closure defaultMapping) The default mapping defined by Settings.SETTING_DEFAULT_MAPPING |
|
protected void |
setGeneratedUniqueName(org.hibernate.mapping.UniqueKey uk) |
|
void |
setNamingStrategy(PersistentEntityNamingStrategy namingStrategy) @param namingStrategy Custom naming strategy to plugin into table naming |
|
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, Iterable<PersistentProperty> persistentProperties) Checks for any custom cascading saves set up via the mapping DSL and records them within the persistent property. |
|
protected String |
trimBackTigs(String tableName) |
|
protected String |
unqualify(String qualifiedName) |
Overrideable naming strategy. Defaults to ImprovedNamingStrategy
but can
be configured in DataSource.groovy via hibernate.naming_strategy = ...
.
Binds 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.