|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Entity
An ORM entity interface, providing access to the property values via the ValueMap interface.
Nested Class Summary | |
---|---|
static interface |
Entity.BackgroundColorProvider
Provides background colors for entities. |
static interface |
Entity.Comparator
Provides comparisons for entities. |
static interface |
Entity.Definition
Specifies a entity definition. |
static interface |
Entity.Key
A class representing a primary key. |
static interface |
Entity.Validator
Responsible for providing validation for entities. |
Nested classes/interfaces inherited from interface org.jminor.common.model.valuemap.ValueMap |
---|
ValueMap.ToString<K> |
Method Summary | |
---|---|
boolean |
containsValue(Property property)
|
Color |
getBackgroundColor(Property property)
|
Boolean |
getBooleanValue(String propertyID)
|
Character |
getCharValue(String propertyID)
|
Date |
getDateValue(String propertyID)
|
Double |
getDoubleValue(String propertyID)
|
String |
getEntityID()
|
Entity |
getForeignKeyValue(String foreignKeyPropertyID)
|
String |
getFormattedValue(Property property)
|
String |
getFormattedValue(Property property,
Format format)
|
String |
getFormattedValue(String propertyID)
|
String |
getFormattedValue(String propertyID,
Format format)
|
Integer |
getIntValue(String propertyID)
|
Entity.Key |
getOriginalPrimaryKey()
|
Entity.Key |
getPrimaryKey()
|
Property |
getProperty(String propertyID)
Retrieves the property identified by propertyID from the entity repository |
Entity.Key |
getReferencedPrimaryKey(Property.ForeignKeyProperty foreignKeyProperty)
Returns the primary key of the entity referenced by the given ForeignKeyProperty, if the reference is null this method returns null. |
String |
getStringValue(String propertyID)
|
Timestamp |
getTimestampValue(String propertyID)
|
Object |
getValue(Property property)
|
String |
getValueAsString(Property property)
This method returns a String representation of the value associated with the given property, if the property has a format it is used. |
void |
initializeValue(Property property,
Object value)
Initializes the given value assuming it has no previously set value. |
boolean |
is(String entityID)
|
boolean |
isForeignKeyNull(Property.ForeignKeyProperty foreignKeyProperty)
Returns true if the value of the given foreign key is null, in case of composite foreign keys a single null value is enough. |
boolean |
isLoaded(String foreignKeyPropertyID)
Returns true if the entity referenced via the given foreign key property has been loaded |
boolean |
isPrimaryKeyNull()
|
boolean |
isValueNull(Property property)
|
boolean |
propertyValuesEqual(Entity entity)
|
Object |
setValue(Property property,
Object value)
Sets the value of the given property |
Methods inherited from interface org.jminor.common.model.valuemap.ValueChangeMap |
---|
addValueListener, getCopy, getInstance, getModifiedState, getOriginalCopy, getOriginalValue, getOriginalValueKeys, getValueChangeObserver, initializeValue, isModified, isModified, removeValueListener, revertAll, revertValue, saveAll, saveValue, setAs |
Methods inherited from interface org.jminor.common.model.valuemap.ValueMap |
---|
clear, containsValue, copyValue, getValueKeys, getValues, isValueNull, removeValue, setValue, size |
Methods inherited from interface org.jminor.common.model.valuemap.ValueProvider |
---|
getValue |
Methods inherited from interface org.jminor.common.model.valuemap.ValueAsStringProvider |
---|
getValueAsString |
Methods inherited from interface java.lang.Comparable |
---|
compareTo |
Method Detail |
---|
String getEntityID()
Entity.Key getPrimaryKey()
Entity.Key getOriginalPrimaryKey()
Property getProperty(String propertyID)
propertyID
- the ID of the property to retrieve
Object getValue(Property property)
property
- the property for which to retrieve the value
String getStringValue(String propertyID)
propertyID
- the ID of the property for which to retrieve the value
propertyID
,
assuming it is a String
ClassCastException
- if the value is not a String instanceInteger getIntValue(String propertyID)
propertyID
- the ID of the property for which to retrieve the value
propertyID
,
assuming it is an Integer
ClassCastException
- if the value is not a Integer instanceCharacter getCharValue(String propertyID)
propertyID
- the ID of the property for which to retrieve the value
propertyID
,
assuming it is a Character
ClassCastException
- if the value is not a Character instanceDouble getDoubleValue(String propertyID)
propertyID
- the ID of the property for which to retrieve the value
propertyID
,
assuming it is a Double
ClassCastException
- if the value is not a Double instanceDate getDateValue(String propertyID)
propertyID
- the ID of the date property for which to retrieve the value
propertyID
,
assuming it is a Date
ClassCastException
- if the value is not a Date instanceTimestamp getTimestampValue(String propertyID)
propertyID
- the ID of the date property for which to retrieve the value
propertyID
,
assuming it is a Timestamp
ClassCastException
- if the value is not a Timestamp instanceBoolean getBooleanValue(String propertyID)
propertyID
- the ID of the property for which to retrieve the value
propertyID
,
assuming it is a Boolean
ClassCastException
- if the value is not a Boolean instanceString getFormattedValue(String propertyID)
propertyID
- the ID of the property for which to retrieve the formatted value
propertyID
, formatting it
with the format object associated with the propertyString getFormattedValue(String propertyID, Format format)
propertyID
- the ID of the property for which to retrieve the formatted valueformat
- the format object
propertyID
, formatted with format
String getFormattedValue(Property property)
property
- the property for which to retrieve the formatted value
String getFormattedValue(Property property, Format format)
property
- the property for which to retrieve the formatted valueformat
- the format object
format
String getValueAsString(Property property)
property
- the property for which to retrieve the value
property
getFormattedValue(Property, java.text.Format)
Entity getForeignKeyValue(String foreignKeyPropertyID)
foreignKeyPropertyID
- the ID of the property for which to retrieve the value
propertyID
,
assuming it is an Entity
RuntimeException
- if the property is not a foreign key propertyEntity.Key getReferencedPrimaryKey(Property.ForeignKeyProperty foreignKeyProperty)
foreignKeyProperty
- the foreign key property for which to retrieve the underlying EntityKey
boolean isForeignKeyNull(Property.ForeignKeyProperty foreignKeyProperty)
foreignKeyProperty
- the foreign key property
Object setValue(Property property, Object value)
property
- the propertyvalue
- the value
boolean isPrimaryKeyNull()
boolean isValueNull(Property property)
property
- the property
boolean containsValue(Property property)
property
- the property
void initializeValue(Property property, Object value)
property
- the property for which to initialize the valuevalue
- the valueboolean is(String entityID)
entityID
- the entityID
boolean propertyValuesEqual(Entity entity)
entity
- the entity to compare to
boolean isLoaded(String foreignKeyPropertyID)
foreignKeyPropertyID
- the property id
Color getBackgroundColor(Property property)
property
- the property for which to retrieve the background color
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |