|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jminor.framework.domain.Entities
public final class Entities
A Entity factory class
Nested Class Summary | |
---|---|
static class |
Entities.Validator
A default extensible Entity.Validator implementation. |
Method Summary | |
---|---|
static Entity.Definition |
define(String entityID,
Property... propertyDefinitions)
Defines a new entity, by default the entityID is used as the underlying table name |
static Entity.Definition |
define(String entityID,
String tableName,
Property... propertyDefinitions)
Defines a new entity |
static Entity |
entity(Entity.Key key)
Creates a new Entity instance with the given primary key |
static Entity |
entity(String entityID)
Creates a new Entity instance with the given entityID |
static Entity |
entity(String entityID,
Map<String,Object> values,
Map<String,Object> originalValues)
Creates a new Entity instance with the given entityID and the given values/originalValues |
static String |
getCaption(String entityID)
|
static Collection<Property.ColumnProperty> |
getColumnProperties(String entityID)
|
static List<Property.ColumnProperty> |
getColumnProperties(String entityID,
boolean includePrimaryKeyProperties,
boolean includeReadOnly,
boolean includeNonUpdatable)
Retrieves the column properties comprising the entity identified by entityID |
static Property.ColumnProperty |
getColumnProperty(String entityID,
String propertyID)
|
static Collection<String> |
getDefinedEntities()
|
static Map<String,String> |
getDefinitions()
|
static Map<String,String> |
getDefinitions(String domainID)
|
static Collection<Property.DenormalizedProperty> |
getDenormalizedProperties(String entityID,
String foreignKeyPropertyID)
|
static Collection<String> |
getDomainEntityIDs(String domainID)
|
static Collection<String> |
getEntitySearchPropertyIDs(String entityID)
|
static Collection<Property.ForeignKeyProperty> |
getForeignKeyProperties(String entityID)
|
static List<Property.ForeignKeyProperty> |
getForeignKeyProperties(String entityID,
String referenceEntityID)
Returns the foreign key properties referencing entities of the given type |
static Property.ForeignKeyProperty |
getForeignKeyProperty(String entityID,
String propertyID)
|
static IdSource |
getIdSource(String entityID)
|
static String |
getIdValueSource(String entityID)
|
static Collection<String> |
getLinkedPropertyIDs(String entityID,
String propertyID)
Returns the IDs of any properties which values are linked to the property identified by propertyID
in the entity identified by entityID |
static String |
getOrderByClause(String entityID)
|
static List<Property.PrimaryKeyProperty> |
getPrimaryKeyProperties(String entityID)
|
static Map<String,Property> |
getProperties(String entityID)
|
static Collection<Property> |
getProperties(String entityID,
boolean includeHidden)
|
static List<Property> |
getProperties(String entityID,
Collection<String> propertyIDs)
|
static List<Property> |
getProperties(String entityID,
String... propertyIDs)
|
static Property |
getProperty(String entityID,
String propertyID)
|
static List<Property.ColumnProperty> |
getSearchProperties(String entityID)
Retrieves the properties used when searching for a entity of the given type, if no search property IDs are defined all STRING based properties are returned. |
static List<Property.ColumnProperty> |
getSearchProperties(String entityID,
Collection<String> searchPropertyIds)
Retrieves the properties used when searching for a entity of the given type, if no search property IDs are defined all STRING based properties are returned. |
static String |
getSelectColumnsString(String entityID)
|
static String |
getSelectQuery(String entityID)
|
static String |
getSelectTableName(String entityID)
|
static ValueMap.ToString<String> |
getStringProvider(String entityID)
|
static String |
getTableName(String entityID)
|
static Collection<Property.TransientProperty> |
getTransientProperties(String entityID)
|
static Entity.Validator |
getValidator(String entityID)
|
static List<Property> |
getVisibleProperties(String entityID)
|
static boolean |
hasDenormalizedProperties(String entityID)
|
static boolean |
hasDenormalizedProperties(String entityID,
String foreignKeyPropertyID)
|
static boolean |
hasLinkedProperties(String entityID,
String propertyID)
Returns true if the property identified by propertyID in the entity identified
by entityID has any linked properties, that is properties which
values depend on the value of the given property |
static boolean |
isDefined(String entityID)
|
static boolean |
isPrimaryKeyAutoGenerated(String entityID)
Returns true if the value for the primary key of this entity is automatically generated, either by the framework, such as values queried from sequences or set by triggers |
static boolean |
isReadOnly(String entityID)
|
static boolean |
isSmallDataset(String entityID)
|
static Entity.Key |
key(String entityID)
Creates a new Entity.Key instance with the given entityID |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Entity entity(String entityID)
entityID
- the entity ID
public static Entity entity(Entity.Key key)
key
- the primary key
public static Entity entity(String entityID, Map<String,Object> values, Map<String,Object> originalValues)
entityID
- the entity IDvalues
- the valuesoriginalValues
- the original values
public static Entity.Key key(String entityID)
entityID
- the entity ID
public static Entity.Definition define(String entityID, Property... propertyDefinitions)
entityID
is used as the underlying table name
entityID
- the ID uniquely identifying the entitypropertyDefinitions
- the Property objects to base this entity on
public static Entity.Definition define(String entityID, String tableName, Property... propertyDefinitions)
entityID
- the ID uniquely identifying the entitytableName
- the name of the underlying tablepropertyDefinitions
- the Property objects to base the entity on
public static Collection<String> getDomainEntityIDs(String domainID)
domainID
- the domain ID
public static Collection<String> getEntitySearchPropertyIDs(String entityID)
entityID
- the entity ID
entityID
public static List<Property.ColumnProperty> getSearchProperties(String entityID)
entityID
- the entity ID
public static List<Property.ColumnProperty> getSearchProperties(String entityID, Collection<String> searchPropertyIds)
entityID
- the entity IDsearchPropertyIds
- the IDs of the properties to use as search properties
public static List<Property.PrimaryKeyProperty> getPrimaryKeyProperties(String entityID)
entityID
- the entity ID
entityID
public static boolean isReadOnly(String entityID)
entityID
- the entity ID
entityID
is read only
RuntimeException
- if the entity is undefinedpublic static boolean isSmallDataset(String entityID)
entityID
- the entity ID
entityID
is based on a small dataset
RuntimeException
- if the entity is undefinedpublic static String getOrderByClause(String entityID)
entityID
- the entity ID
public static String getSelectTableName(String entityID)
entityID
- the entity ID
entityID
RuntimeException
- if the entity is undefinedpublic static String getTableName(String entityID)
entityID
- the entity ID
entityID
are based
RuntimeException
- if the entity is undefinedpublic static String getSelectQuery(String entityID)
entityID
- the entity ID
entityID
RuntimeException
- if the entity is undefinedpublic static String getSelectColumnsString(String entityID)
entityID
- the entity ID
entityID
RuntimeException
- if the entity is undefinedpublic static IdSource getIdSource(String entityID)
entityID
- the entity ID
entityID
RuntimeException
- if the entity is undefinedpublic static ValueMap.ToString<String> getStringProvider(String entityID)
entityID
- the entity ID
RuntimeException
- if the entity is undefinedpublic static boolean isPrimaryKeyAutoGenerated(String entityID)
entityID
- the entity ID
public static List<Property.ColumnProperty> getColumnProperties(String entityID, boolean includePrimaryKeyProperties, boolean includeReadOnly, boolean includeNonUpdatable)
entityID
entityID
- the entity IDincludePrimaryKeyProperties
- if true primary key properties are includedincludeReadOnly
- if true then properties that are marked as 'read only' are includedincludeNonUpdatable
- if true then non updatable properties are included
entityID
public static List<Property> getVisibleProperties(String entityID)
entityID
- the entity ID
entityID
RuntimeException
- if no visible properties are defined for the given entitypublic static Property.ColumnProperty getColumnProperty(String entityID, String propertyID)
entityID
- the entity IDpropertyID
- the property ID
public static Property getProperty(String entityID, String propertyID)
entityID
- the entity IDpropertyID
- the property ID
propertyID
in the entity identified by entityID
RuntimeException
- in case no such property existspublic static List<Property> getProperties(String entityID, Collection<String> propertyIDs)
entityID
- the entity IDpropertyIDs
- the property IDs of the properties to retrieve
propertyIDs
, found in
the entity identified by entityID
public static List<Property> getProperties(String entityID, String... propertyIDs)
entityID
- the entity IDpropertyIDs
- the property IDs of the properties to retrieve
propertyIDs
, found in
the entity identified by entityID
public static Collection<Property> getProperties(String entityID, boolean includeHidden)
entityID
- the entity IDincludeHidden
- true if hidden properties should be included in the result
entityID
public static Collection<Property.ColumnProperty> getColumnProperties(String entityID)
entityID
- the entity ID
entityID
,
that is, properties that map to database columnspublic static Collection<Property.TransientProperty> getTransientProperties(String entityID)
entityID
- the entity ID
entityID
,
that is, properties that do not map to database columnspublic static Collection<Property.ForeignKeyProperty> getForeignKeyProperties(String entityID)
entityID
- the entity ID
entityID
public static boolean hasDenormalizedProperties(String entityID)
entityID
- the entity ID
public static Collection<Property.DenormalizedProperty> getDenormalizedProperties(String entityID, String foreignKeyPropertyID)
entityID
- the entity IDforeignKeyPropertyID
- the foreign key id
entityID
which source is the entity identified by propertyOwnerEntityID
public static boolean hasDenormalizedProperties(String entityID, String foreignKeyPropertyID)
entityID
- the entity IDforeignKeyPropertyID
- the foreign key id
entityID
contains denormalized properties
which source is the entity identified by propertyOwnerEntityID
public static boolean hasLinkedProperties(String entityID, String propertyID)
propertyID
in the entity identified
by entityID
has any linked properties, that is properties which
values depend on the value of the given property
entityID
- the entityIDpropertyID
- the propertyID
public static Collection<String> getLinkedPropertyIDs(String entityID, String propertyID)
propertyID
in the entity identified by entityID
entityID
- the entityIDpropertyID
- the propertyID
public static List<Property.ForeignKeyProperty> getForeignKeyProperties(String entityID, String referenceEntityID)
entityID
- the ID of the entity from which to retrieve the foreign key propertiesreferenceEntityID
- the ID of the reference entity
public static Property.ForeignKeyProperty getForeignKeyProperty(String entityID, String propertyID)
entityID
- the entity IDpropertyID
- the property ID
RuntimeException
- in case no such property existspublic static Map<String,Property> getProperties(String entityID)
entityID
- the entity ID
public static String getIdValueSource(String entityID)
entityID
- the entity ID
RuntimeException
- in case no id source name is specifiedpublic static String getCaption(String entityID)
entityID
- the entity ID
public static Entity.Validator getValidator(String entityID)
entityID
- the entityID
public static Collection<String> getDefinedEntities()
public static boolean isDefined(String entityID)
entityID
- the entity ID
public static Map<String,String> getDefinitions()
public static Map<String,String> getDefinitions(String domainID)
domainID
- the ID of the domain for which to retrieve the entity definitions
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |