@groovy.transform.CompileStatic class EnumType extends AbstractMappingAwareCustomTypeMarshaller<java.lang.Object, Document, Document>
A custom type for persisting Enum which have an id field in domain classes. For example: To save identity instead of string in database for field type.
class User { UserType type String name } enum UserType { A(1), B(2) final int id UserType(int id) { this.id = id } }
Constructor and description |
---|
EnumType() |
Type Params | Return Type | Name and description |
---|---|---|
|
protected static java.lang.Object |
getId(java.lang.Enum value) |
|
protected void |
queryInternal(PersistentProperty property, java.lang.String key, PropertyCriterion criterion, Document nativeQuery) |
|
protected java.lang.Object |
readInternal(PersistentProperty property, java.lang.String key, Document nativeSource) |
|
boolean |
supports(MappingContext context) |
|
boolean |
supports(Datastore datastore) |
|
protected java.lang.Object |
writeInternal(PersistentProperty property, java.lang.String key, java.lang.Object value, Document nativeTarget) |