A bunch of helper and lookup/finder statics for dealing with domain classes and PersistentEntity. Useful methods to find the PersistentEntity and the mapping and meta fields.
Type Params | Return Type | Name and description |
---|---|---|
|
static Map<String, ConstrainedProperty> |
findConstrainedProperties(PersistentEntity entity) |
|
static PersistentEntity |
findPersistentEntity(String name) finds domain using either a simple name like "Product" or fully qualified name "com.foo.Product" name can start with either a lower or upper case |
|
Mapping |
getMapping(PersistentEntity pe) Returns the mapping for the entity to DB. |
|
static MappingContext |
getMappingContext() the mapping grailsDomainClassMappingContext. |
|
static PersistentEntity |
getPersistentEntity(Class cls) Returns a persistent entity using the class. |
|
static PersistentEntity |
getPersistentEntity(String fullName) Returns a persistent entity using a fully qualified name with package such as "com.foo.Product". |
|
static PersistentEntity |
getPersistentEntity(GormEntity instance) Returns a persistent entity using a domain instance. |
|
static List<PersistentProperty> |
getPersistentProperties(String className) Returns persistent properties for persistent entity(finds by name) Adds composite identeties, which are not in persistent properties by default |
|
static boolean |
hasProperty(PersistentEntity domain, String property) Check if Persistent Entity has property by path |
finds domain using either a simple name like "Product" or fully qualified name "com.foo.Product" name can start with either a lower or upper case
name
- an entity name to search forReturns the mapping for the entity to DB.
pe
- the PersistentEntity can found using the loolup statics abovethe mapping grailsDomainClassMappingContext. This is the main holder for the persistentEntities
Returns a persistent entity using the class.
cls
- the domain classReturns a persistent entity using a fully qualified name with package such as "com.foo.Product".
name
- an entity name which includes packageReturns a persistent entity using a domain instance. Note: shortcut for getPersistentEntity(instance.class.name)
instance
- the domain instanceReturns persistent properties for persistent entity(finds by name) Adds composite identeties, which are not in persistent properties by default
className
- name of the Persistent entityCheck if Persistent Entity has property by path
domain
- Persistent Entityproperty
- path for property