@groovy.transform.CompileStatic @groovy.transform.builder.Builder(builderStrategy = SimpleStrategy, prefix = '') class Property extends java.lang.Object
Base class for classes returned from PropertyMapping.getMappedForm
Type | Name and description |
---|---|
javax.persistence.AccessType |
accessType @return The default access type to use to read and write property values |
java.lang.String |
cascade Cascading strategy for this property. |
boolean |
derived @return Whether the property is derived or not |
javax.persistence.FetchType |
fetchStrategy @return The strategy to use to fetch the property (lazy or eager) |
java.lang.String |
formula The formula used to build the property |
java.lang.String |
generator Set the id generator name or class. |
java.util.List<java.lang.String> |
inList @return List of valid values |
boolean |
index @return Whether this property is index |
java.lang.Boolean |
lazy Whether to use lazy proxies for each association. |
java.lang.Comparable |
max @return The maximum value |
java.lang.Number |
maxSize @return The maximum size |
java.lang.Comparable |
min @return The minimum value |
java.lang.Number |
minSize @return The minimum size |
boolean |
nullable @return Whether the property is nullable |
boolean |
reference @return Whether this property is a database reference such as a foreign key |
int |
scale @return The scale |
java.lang.String |
targetName The target to map to, could be a database column, document attribute, or hash key |
Type Params | Return Type | Name and description |
---|---|---|
|
Property |
clone() |
<T extends Property> |
static T |
configureExisting(T property, groovy.lang.Closure config) Configures an existing PropertyConfig instance |
<T extends Property> |
static T |
configureExisting(T property, java.util.Map config) Configures an existing PropertyConfig instance |
|
Property |
fetch(java.lang.String name) Configure the fetch strategy |
|
Property |
fetch(javax.persistence.FetchType type) Configure the fetch strategy |
|
java.lang.String |
getEnumType() @return The type of the enum, either ordinal or string |
|
javax.persistence.EnumType |
getEnumTypeObject() @return The type of the enum, either ordinal or string |
|
java.lang.Boolean |
getLazy() |
|
java.lang.String |
getName() @return The name of the property this property mapping relates to |
|
java.util.List<java.lang.String> |
getUniquenessGroup() |
|
java.lang.Boolean |
isLazy() |
|
boolean |
isUnique() @return Whether the property should be unique |
|
boolean |
isUniqueWithinGroup() @return Whether the property is unique within a group |
|
Property |
name(java.lang.String propertyName) @return The name of the property this property mapping relates to |
|
void |
setEnumType(javax.persistence.EnumType enumType) |
|
void |
setEnumType(java.lang.String enumType) |
|
void |
setFetch(java.lang.String name) Makes it easier to configure the fetch strategy |
|
void |
setLazy(java.lang.Boolean lazy) |
|
void |
setName(java.lang.String propertyName) |
|
void |
setRange(groovy.lang.ObjectRange range) |
|
void |
setSize(groovy.lang.IntRange maxSize) |
|
void |
setUnique(boolean unique) |
|
void |
setUnique(java.lang.String name) |
|
void |
setUnique(java.util.List<java.lang.String> names) |
|
protected void |
setUniquenessGroup(java.util.List<java.lang.String> uniquenessGroup) |
|
void |
unique(boolean unique) |
|
void |
unique(java.lang.String name) |
|
void |
unique(java.util.List<java.lang.String> names) |
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() |
Cascading strategy for this property. Only makes sense if the property is an association or collection.
The formula used to build the property
Set the id generator name or class.
generator
- name or class
Whether to use lazy proxies for each association. This has no effect if getFetchStrategy() returns FetchType.EAGER, however if FetchType is LAZY and lazy is set to true then for collection types each element of the collection will be a proxy. If lazy is false the collection will be fetched lazily, but fully initialized objects will be loaded for each element.
The target to map to, could be a database column, document attribute, or hash key
Configures an existing PropertyConfig instance
config
- The configurationConfigures an existing PropertyConfig instance
config
- The configurationConfigure the fetch strategy
name
- The name of the fetch strategyConfigure the fetch strategy
type
- The type of the fetch strategy
Makes it easier to configure the fetch strategy
name
- The name of the fetch strategy