|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsDomainBinder
public final class GrailsDomainBinder
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.
Nested Class Summary | |
---|---|
(package private) static class |
GrailsDomainBinder.CollectionType
A Collection type, for the moment only Set is supported |
(package private) static class |
GrailsDomainBinder.GrailsCollectionSecondPass
Second pass class for grails relationships. |
(package private) static class |
GrailsDomainBinder.ListSecondPass
|
(package private) static class |
GrailsDomainBinder.MapSecondPass
|
Constructor Summary | |
---|---|
GrailsDomainBinder()
|
Method Summary | |
---|---|
static void |
bindClass(GrailsDomainClass domainClass,
org.hibernate.cfg.Mappings mappings)
Binds a Grails domain class to the Hibernate runtime meta model |
protected static void |
bindNumericColumnConstraints(org.hibernate.mapping.Column column,
ConstrainedProperty constrainedProperty)
Interrogates the specified constraints looking for any constraints that would limit the precision and/or scale of the property's value. |
static void |
bindRoot(GrailsDomainClass domainClass,
org.hibernate.cfg.Mappings mappings)
Binds a root class (one with no super classes) to the runtime meta model based on the supplied Grails domain class |
protected static void |
bindStringColumnConstraints(org.hibernate.mapping.Column column,
ConstrainedProperty constrainedProperty)
Interrogates the specified constraints looking for any constraints that would limit the length of the property's value. |
protected static void |
createClassProperties(GrailsDomainClass domainClass,
org.hibernate.mapping.PersistentClass persistentClass,
org.hibernate.cfg.Mappings mappings)
Creates and binds the properties for the specified Grails domain class and PersistantClass and binds them to the Hibernate runtime meta model |
static Mapping |
getMapping(String domainClassName)
Obtains a mapping object for the given domain class nam |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GrailsDomainBinder()
Method Detail |
---|
public static void bindClass(GrailsDomainClass domainClass, org.hibernate.cfg.Mappings mappings) throws org.hibernate.MappingException
domainClass
- The domain class to bindmappings
- The existing mappings
org.hibernate.MappingException
- Thrown if the domain class uses inheritance which is not supportedpublic static Mapping getMapping(String domainClassName)
domainClassName
- The domain class name in question
public static void bindRoot(GrailsDomainClass domainClass, org.hibernate.cfg.Mappings mappings)
domainClass
- The Grails domain classmappings
- The Hibernate Mappings objectprotected static void createClassProperties(GrailsDomainClass domainClass, org.hibernate.mapping.PersistentClass persistentClass, org.hibernate.cfg.Mappings mappings)
domainClass
- The Grails domain classpersistentClass
- The Hibernate PersistentClass instancemappings
- The Hibernate Mappings instanceprotected static void bindStringColumnConstraints(org.hibernate.mapping.Column column, ConstrainedProperty constrainedProperty)
column
- the column that corresponds to the propertyconstrainedProperty
- the property's constraintsprotected static void bindNumericColumnConstraints(org.hibernate.mapping.Column column, ConstrainedProperty constrainedProperty)
column
- the column that corresponds to the propertyconstrainedProperty
- the property's constraints
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |