org.jminor.framework.domain
Interface Entity.Definition

Enclosing interface:
Entity

public static interface Entity.Definition

Specifies a entity definition.


Method Summary
 int compareTo(Entity entity, Entity entityToCompare)
          Compares the given entities.
 Color getBackgroundColor(Entity entity, Property property)
           
 String getCaption()
           
 List<Property.ColumnProperty> getColumnProperties()
           
 Entity.Comparator getComparator()
           
 Collection<Property.DenormalizedProperty> getDenormalizedProperties(String foreignKeyPropertyID)
          Retrieves the denormalized properties which values originate from the entity referenced by the given foreign key property
 String getDomainID()
           
 String getEntityID()
           
 List<Property.ForeignKeyProperty> getForeignKeyProperties()
           
 IdSource getIdSource()
           
 String getIdValueSource()
           
 Collection<String> getLinkedPropertyIDs(String propertyID)
          Returns the IDs of the properties which values are linked to the value of the given property, an empty collection if no such linked properties exist
 String getOrderByClause()
           
 List<Property.PrimaryKeyProperty> getPrimaryKeyProperties()
           
 Map<String,Property> getProperties()
           
 List<String> getSearchPropertyIDs()
           
 String getSelectColumnsString()
          Retrieves the column list to use when constructing a select query for this entity type
 String getSelectQuery()
           
 String getSelectTableName()
           
 ValueMap.ToString<String> getStringProvider()
           
 String getTableName()
           
 List<Property.TransientProperty> getTransientProperties()
           
 Entity.Validator getValidator()
           
 List<Property> getVisibleProperties()
           
 boolean hasDenormalizedProperties()
           
 boolean hasDenormalizedProperties(String foreignKeyPropertyID)
           
 boolean hasLinkedProperties(String propertyID)
          Returns true if this entity contains properties which values are linked to the value of the given property
 boolean isReadOnly()
           
 boolean isSmallDataset()
           
 Entity.Definition setBackgroundColorProvider(Entity.BackgroundColorProvider colorProvider)
           
 Entity.Definition setCaption(String caption)
          Sets the caption for this entity type
 Entity.Definition setComparator(Entity.Comparator comparator)
          Sets the comparator to use when comparing this entity type to other entities
 Entity.Definition setDomainID(String domainID)
          Sets the domain ID for this entity type
 Entity.Definition setIdSource(IdSource idSource)
          Sets the id source for this entity type, which specifies the primary key generation strategy to use.
 Entity.Definition setIdValueSource(String idValueSource)
          Sets the id value source for this entity type, such as sequence or table name, depending on the underlying primary key generation strategy.
 Entity.Definition setOrderByClause(String orderByClause)
          Sets the order by clause for this entity type, this clause should not include the "order by" keywords.
 Entity.Definition setReadOnly(boolean readOnly)
          Sets the read only value
 Entity.Definition setSearchPropertyIDs(String... searchPropertyIDs)
          Sets the IDs of the properties to use when performing a default lookup for this entity type
 Entity.Definition setSelectQuery(String selectQuery)
          Sets the select query to use when selecting entities of this type, use with care.
 Entity.Definition setSelectTableName(String selectTableName)
          Sets the name of the table to use when selecting entities of this type, when it differs from the one used to update/insert, such as a view.
 Entity.Definition setSmallDataset(boolean smallDataset)
          Specifies whether or not this entity should be regarded as based on a small dataset, which primarily means that combo box models can be based on this entity.
 Entity.Definition setStringProvider(ValueMap.ToString<String> stringProvider)
          Sets the string provider, that is, the object responsible for providing toString values for this entity type
 Entity.Definition setToStringProvider(ValueMap.ToString<String> toString)
           
 Entity.Definition setValidator(Entity.Validator validator)
           
 String toString(Entity entity)
           
 

Method Detail

getEntityID

String getEntityID()
Returns:
the entity ID

getTableName

String getTableName()
Returns:
the name of the underlying table, with schema prefix if applicable

getDomainID

String getDomainID()
Returns:
the ID of the domain this entity type belongs to

setDomainID

Entity.Definition setDomainID(String domainID)
Sets the domain ID for this entity type

Parameters:
domainID - the domain ID
Returns:
this Entity.Definition instance

setToStringProvider

Entity.Definition setToStringProvider(ValueMap.ToString<String> toString)
Parameters:
toString - the to string provider
Returns:
this Entity.Definition instance

setBackgroundColorProvider

Entity.Definition setBackgroundColorProvider(Entity.BackgroundColorProvider colorProvider)
Parameters:
colorProvider - the background color provider
Returns:
this Entity.Definition instance

setValidator

Entity.Definition setValidator(Entity.Validator validator)
Parameters:
validator - the validator for this entity type
Returns:
this Entity.Definition instance

getValidator

Entity.Validator getValidator()
Returns:
the validator for this enitity type

getCaption

String getCaption()
Returns:
the caption to use when presenting entities of this type

setCaption

Entity.Definition setCaption(String caption)
Sets the caption for this entity type

Parameters:
caption - the caption
Returns:
this Entity.Definition instance

isSmallDataset

boolean isSmallDataset()
Returns:
true if the underlying table is small enough for displaying the contents in a combo box

setSmallDataset

Entity.Definition setSmallDataset(boolean smallDataset)
Specifies whether or not this entity should be regarded as based on a small dataset, which primarily means that combo box models can be based on this entity. This is false by default.

Parameters:
smallDataset - true if the underlying table is small enough for displaying the contents in a combo box
Returns:
this Entity.Definition instance

isReadOnly

boolean isReadOnly()
Returns:
true if this entity type is read only

setReadOnly

Entity.Definition setReadOnly(boolean readOnly)
Sets the read only value

Parameters:
readOnly - true if this entity type should be read only
Returns:
this Entity.Definition instance

getIdSource

IdSource getIdSource()
Returns:
the IdSource specified for this entity type

setIdSource

Entity.Definition setIdSource(IdSource idSource)
Sets the id source for this entity type, which specifies the primary key generation strategy to use.

Parameters:
idSource - the idSource
Returns:
this Entity.Definition instance

getIdValueSource

String getIdValueSource()
Returns:
the id value source

setIdValueSource

Entity.Definition setIdValueSource(String idValueSource)
Sets the id value source for this entity type, such as sequence or table name, depending on the underlying primary key generation strategy.

Parameters:
idValueSource - the id value source
Returns:
this Entity.Definition instance

getOrderByClause

String getOrderByClause()
Returns:
the order by clause to use when querying entities of this type, without the "order by" keywords

setOrderByClause

Entity.Definition setOrderByClause(String orderByClause)
Sets the order by clause for this entity type, this clause should not include the "order by" keywords.

Parameters:
orderByClause - the order by clause
Returns:
this Entity.Definition instance

getSelectTableName

String getSelectTableName()
Returns:
the name of the table to use when selecting entities of this type

setSelectTableName

Entity.Definition setSelectTableName(String selectTableName)
Sets the name of the table to use when selecting entities of this type, when it differs from the one used to update/insert, such as a view.

Parameters:
selectTableName - the name of the table
Returns:
this Entity.Definition instance

getSelectQuery

String getSelectQuery()
Returns:
the select query to use when selecting entities of this type

setSelectQuery

Entity.Definition setSelectQuery(String selectQuery)
Sets the select query to use when selecting entities of this type, use with care.

Parameters:
selectQuery - the select query to use for this entity type
Returns:
this Entity.Definition instance

getStringProvider

ValueMap.ToString<String> getStringProvider()
Returns:
the object responsible for providing toString values for this entity type

setStringProvider

Entity.Definition setStringProvider(ValueMap.ToString<String> stringProvider)
Sets the string provider, that is, the object responsible for providing toString values for this entity type

Parameters:
stringProvider - the string provider
Returns:
this Entity.Definition instance

setComparator

Entity.Definition setComparator(Entity.Comparator comparator)
Sets the comparator to use when comparing this entity type to other entities

Parameters:
comparator - the comparator
Returns:
this Entity.Definition instance

getComparator

Entity.Comparator getComparator()
Returns:
the comparator used when comparing this entity type to other entities

getSearchPropertyIDs

List<String> getSearchPropertyIDs()
Returns:
a list of property IDs identifying the properties to use when performing a default lookup for this entity type

setSearchPropertyIDs

Entity.Definition setSearchPropertyIDs(String... searchPropertyIDs)
Sets the IDs of the properties to use when performing a default lookup for this entity type

Parameters:
searchPropertyIDs - the search property IDs
Returns:
this Entity.Definition instance

getProperties

Map<String,Property> getProperties()
Returns:
the properties for this entity type

hasLinkedProperties

boolean hasLinkedProperties(String propertyID)
Returns true if this entity contains properties which values are linked to the value of the given property

Parameters:
propertyID - the ID of the property
Returns:
true if any properties are linked to the given property

getLinkedPropertyIDs

Collection<String> getLinkedPropertyIDs(String propertyID)
Returns the IDs of the properties which values are linked to the value of the given property, an empty collection if no such linked properties exist

Parameters:
propertyID - the ID of the property
Returns:
a collection conaining the IDs of any properties which are linked to the given property

getPrimaryKeyProperties

List<Property.PrimaryKeyProperty> getPrimaryKeyProperties()
Returns:
the primary key properties of this entity type

getSelectColumnsString

String getSelectColumnsString()
Retrieves the column list to use when constructing a select query for this entity type

Returns:
the query column list, i.e. "col1, col2, col3,..."

getVisibleProperties

List<Property> getVisibleProperties()
Returns:
a list containing the visible properties for this entity type

getColumnProperties

List<Property.ColumnProperty> getColumnProperties()
Returns:
a list containing the column-based properties for this entity type

getTransientProperties

List<Property.TransientProperty> getTransientProperties()
Returns:
a list containing the non-column-based properties for this entity type

getForeignKeyProperties

List<Property.ForeignKeyProperty> getForeignKeyProperties()
Returns:
a list containing the foreign key properties for this entity type

hasDenormalizedProperties

boolean hasDenormalizedProperties()
Returns:
true if this entity type has any denormalized properties

hasDenormalizedProperties

boolean hasDenormalizedProperties(String foreignKeyPropertyID)
Parameters:
foreignKeyPropertyID - the ID of the foreign key property
Returns:
true if this entity type has any denormalized properties associated with the give foreign key

getDenormalizedProperties

Collection<Property.DenormalizedProperty> getDenormalizedProperties(String foreignKeyPropertyID)
Retrieves the denormalized properties which values originate from the entity referenced by the given foreign key property

Parameters:
foreignKeyPropertyID - the foreign key property ID
Returns:
a collection containing the denormalized properties which values originate from the entity referenced by the given foreign key property

compareTo

int compareTo(Entity entity,
              Entity entityToCompare)
Compares the given entities.

Parameters:
entity - the first entity
entityToCompare - the second entity
Returns:
the compare result

toString

String toString(Entity entity)
Parameters:
entity - the entity
Returns:
a string representation of the given entity

getBackgroundColor

Color getBackgroundColor(Entity entity,
                         Property property)
Parameters:
entity - the entity
property - the property
Returns:
the background color to use for this entity and property