Package io.jmix.core.entity
Class KeyValueEntity
java.lang.Object
io.jmix.core.entity.KeyValueEntity
- All Implemented Interfaces:
CopyingSystemState<KeyValueEntity>
,Entity
,HasInstanceMetaClass
,Serializable
public class KeyValueEntity
extends Object
implements HasInstanceMetaClass, Entity, CopyingSystemState<KeyValueEntity>
Entity that contains a variable set of attributes. For example:
KeyValueEntity company = new KeyValueEntity(); company.setValue("email", "info@globex.com"); company.setValue("name", "Globex Corporation"); KeyValueEntity person = new KeyValueEntity(); person.setValue("email", "homer.simpson@mail.com"); person.setValue("firstName", "Homer"); person.setValue("lastName", "Simpson");
- See Also:
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprotected EntityEntry
protected String
protected MetaClass
protected UUID
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
copyFrom
(KeyValueEntity source) Invoked by the framework when copying the entity instance.boolean
getId()
<T> T
int
hashCode()
boolean
void
void
Sets the name of a property that represents this entity id.void
setInstanceMetaClass
(MetaClass metaClass) Sets a meta-class for this entity instance.void
void
toString()
-
Field Details
-
uuid
-
properties
-
idName
-
metaClass
-
entityEntry
-
-
Constructor Details
-
KeyValueEntity
public KeyValueEntity()
-
-
Method Details
-
getInstanceMetaClass
- Specified by:
getInstanceMetaClass
in interfaceHasInstanceMetaClass
- Returns:
- metaclass of this entity instance.
-
setInstanceMetaClass
Sets a meta-class for this entity instance.- Specified by:
setInstanceMetaClass
in interfaceHasInstanceMetaClass
-
hasInstanceMetaClass
public boolean hasInstanceMetaClass()- Specified by:
hasInstanceMetaClass
in interfaceHasInstanceMetaClass
- Returns:
- true if the instance has a metaclass and call of
HasInstanceMetaClass.getInstanceMetaClass()
is safe
-
getIdName
- Returns:
- name of a property that represents this entity id, if set by
setIdName(String)
-
setIdName
Sets the name of a property that represents this entity id. -
getValue
-
setValue
-
setValue
-
getId
-
setId
-
equals
-
hashCode
public int hashCode() -
toString
-
__getEntityEntry
- Specified by:
__getEntityEntry
in interfaceEntity
-
__copyEntityEntry
public void __copyEntityEntry()- Specified by:
__copyEntityEntry
in interfaceEntity
-
copyFrom
Description copied from interface:CopyingSystemState
Invoked by the framework when copying the entity instance.- Specified by:
copyFrom
in interfaceCopyingSystemState<KeyValueEntity>
- Parameters:
source
- source entity
-