@CompileStatic @SettingsBuilder class Entity<P extends Property> extends Object
Base class for classes returned from ClassMapping.getMappedForm
| Modifiers | Name | Description |
|---|---|---|
protected Map<String, P> |
propertyConfigs |
The configuration for each property |
| Type | Name and description |
|---|---|
boolean |
autoTimestamp
|
boolean |
autowire
|
List<String> |
datasourcesGet the datasource names that this domain class works with. |
Object |
defaultSort
|
Object |
sort |
boolean |
stateless
|
boolean |
version
|
| Constructor and description |
|---|
Entity() |
| Type Params | Return Type | Name and description |
|---|---|---|
|
protected P |
cloneGlobalConstraint() |
<T extends Entity> |
static T |
configureExisting(T mapping, Closure config)Configures an existing Mapping instance |
|
Entity<P> |
connection(String name)Sets the datastore to use |
|
Entity<P> |
connections(String[] names)Sets the connection to use |
|
Entity<P> |
connections(List<String> names)Sets the connection to use |
|
Entity<P> |
datasource(String name)Sets the datastore to use |
|
protected P |
getOrInitializePropertyConfig(String name) |
|
P |
getPropertyConfig(String name)Get a property config |
|
Map<String, P> |
getPropertyConfigs()
|
|
Object |
getSort() |
|
Entity<P> |
id(Map identityConfig)Define the identity config |
|
Entity<P> |
id(Closure identityConfig)Define the identity config |
|
boolean |
isVersioned()
|
|
Object |
methodMissing(String name, Object args) |
|
protected P |
newProperty() |
|
Entity<P> |
property(String name, Closure propertyConfig)Configure a property |
|
Entity<P> |
property(String name, Map propertyConfig)Configure a property |
|
P |
property(Closure propertyConfig)Configure a new property |
|
P |
property(Map propertyConfig)Configure a new property |
|
Object |
propertyMissing(String name, Object val) |
|
Entity<P> |
setSort(Object defaultSort) |
|
Entity<P> |
tenantId(String tenantIdProperty)Sets the tenant id |
|
Entity<P> |
version(Closure versionConfig) |
|
Entity<P> |
version(Map versionConfig) |
Get the datasource names that this domain class works with.
Configures an existing Mapping instance
config - The configurationGet a property config @return
name - The name of the propertyDefine the identity config
identityConfig - The id configDefine the identity config
identityConfig - The id config
Configure a property
name - The name of the propertypropertyConfig - The property configConfigure a property
name - The name of the propertypropertyConfig - The property configConfigure a new property
name - The name of the propertypropertyConfig - The property configConfigure a new property
name - The name of the propertypropertyConfig - The property configSets the tenant id
tenantIdProperty - The tenant id property
Configures the name of the version column
{ version 'foo' } isVersioned - True if a version property should be configured
Groovy Documentation