@java.lang.SuppressWarnings({"rawtypes", "unchecked"}) public class GormMappingConfigurationStrategy extends java.lang.Object
This implementation of the MappingConfigurationStrategy interface will interpret GORM-style syntax for defining entities and associations.
Example in Groovy code:
class Author {
String name
static hasMany = [books:Book]
}
class Book {
String title
static belongsTo = [author:Author]
}
Modifiers | Name | Description |
---|---|---|
static java.lang.String |
MAPPED_BY_NONE |
|
protected MappingFactory |
propertyFactory |
Constructor and description |
---|
GormMappingConfigurationStrategy
(MappingFactory propertyFactory) |
Type Params | Return Type | Name and description |
---|---|---|
|
protected void |
configureOwningSide(Association association) |
|
protected Association |
establishRelationshipForCollection(java.beans.PropertyDescriptor property, PersistentEntity entity, MappingContext context, java.util.Map<java.lang.String, java.lang.Class> hasManyMap, java.util.Map mappedByMap, boolean embedded) |
|
protected java.util.Map |
getAllAssociationMap(ClassPropertyFetcher cpf) Retrieves the association map |
|
java.util.Map |
getAssociationMap(ClassPropertyFetcher cpf) Retrieves the association map |
|
PersistentProperty[] |
getCompositeIdentity(java.lang.Class javaClass, MappingContext context) |
|
IdentityMapping |
getDefaultIdentityMapping(ClassMapping classMapping) |
|
PersistentProperty |
getIdentity(java.lang.Class javaClass, MappingContext context) @see org.grails.datastore.mapping.model.MappingConfigurationStrategy#getIdentity(Class, org.grails.datastore.mapping.model.MappingContext) |
|
IdentityMapping |
getIdentityMapping(ClassMapping classMapping) Obtains the identity mapping for the specified class mapping |
|
protected PersistentEntity |
getOrCreateAssociatedEntity(PersistentEntity entity, MappingContext context, java.lang.Class propType) Tries to obtain or create an associated entity. |
|
protected PersistentEntity |
getOrCreateEmbeddedEntity(PersistentEntity entity, MappingContext context, java.lang.Class type) Tries to obtain or create an embedded entity. |
|
java.util.Set |
getOwningEntities(java.lang.Class javaClass, MappingContext context) |
|
java.util.List<PersistentProperty> |
getPersistentProperties(java.lang.Class javaClass, MappingContext context) |
|
java.util.List<PersistentProperty> |
getPersistentProperties(java.lang.Class javaClass, MappingContext context, ClassMapping classMapping) |
|
java.util.List<PersistentProperty> |
getPersistentProperties(PersistentEntity entity, MappingContext context, ClassMapping classMapping, boolean includeIdentifiers) |
|
java.util.List<PersistentProperty> |
getPersistentProperties(PersistentEntity entity, MappingContext context, ClassMapping classMapping) |
|
static boolean |
isAbstract(PersistentEntity entity) |
|
protected boolean |
isCollectionType(java.lang.Class type) |
|
protected boolean |
isExcludedProperty(java.lang.String propertyName, ClassMapping classMapping, java.util.Collection transients, boolean includeIdentifiers) |
|
boolean |
isPersistentEntity(java.lang.Class clazz) Tests whether an class is a persistent entity |
|
void |
setCanExpandMappingContext(boolean canExpandMappingContext) Whether the strategy can add new entities to the mapping context |
|
protected boolean |
supportsCustomType(java.lang.Class<?> propertyType) |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), 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() |
Retrieves the association map
cpf
- The ClassPropertyFetcher instanceRetrieves the association map
cpf
- The ClassPropertyFetcher instance
Obtains the identity mapping for the specified class mapping
classMapping
- The class mappingTries to obtain or create an associated entity. Note that if #canExpandMappingContext is set to false then this method may return null
entity
- The main entitycontext
- The contextpropType
- The associated property typeTries to obtain or create an embedded entity. Note that if #canExpandMappingContext is set to false then this method may return null
entity
- The main entitycontext
- The contexttype
- The associated property typeTests whether an class is a persistent entity Based on the same method in Grails core within the DomainClassArtefactHandler class
clazz
- The java classWhether the strategy can add new entities to the mapping context