org.caleigo.core
Interface IEntityDescriptor

All Superinterfaces:
java.io.Serializable
All Known Subinterfaces:
IBaseEntityDescriptor, ICompositeEntityDescriptor
All Known Implementing Classes:
AbstractEntityDescriptor, CompositeEntityDescriptor

public interface IEntityDescriptor
extends java.io.Serializable

Version:
1.00
Author:
Dennis Zikovic

Field Summary
static int CUSTOM_ENTITY
          Used for entities that are composites of other entities and therefore can not specify another entity type.
static java.lang.String DELETE_ACTION
          Code name constant for the delete action.
static int LINK_ENTITY
          Signifies that the purpose of this entity is only to link other entity types together in N to N relationships.
static int MASTER_ENTITY
          Signifies that these enitities are handled as seperate units that can be viewed and handled as isolated units.
static int NO_TIME_LIMIT
          Can be used to chech the result of getCacheTime().
static int SLAVE_ENTITY
          These entities are generally never viewed or handled as an isolated seperate unit.
static int STATIC_ENTITY
          Used for tables storing system constants that rarely or never changes.
static java.lang.String STORE_ACTION
          Code name constant for the store action.
 
Method Summary
 boolean contains(IFieldDescriptor fieldDescriptor)
          Reurns true if the provided field descriptor is a part the called entity descriptor.
 IEntity createEntity()
          Creates an entity with of the type described by this descriptor and loads it with default data.
 IEntity createEntity(IDataProvider propertySource)
          Creates an entity with of the type described by this descriptor and loads it with data from the provided property source.
 IEntityAction getAction(int index)
          Returns the indexed IEntityAction.
 IEntityAction getAction(java.lang.String codeName)
          Returns the IEntityAction with the provided code name.
 int getActionCount()
          Access method that returns the number of IEntityAction objects that are available for access from the called IEntityDescriptor.
 java.util.Iterator getActions()
          Returns an iterator with all contained IEntityAction objects that are available for access from the called IEntityDescriptor.
 int getCacheTime()
          Returns the acceptable time in seconds to cache entities described by the descriptor.
 java.lang.String getCodeName()
          Returns an identifying name that can be used to address the field in client software if the field descriptor for some reason is not available.
 int getDataFieldCount()
          Returns the number of field descriptors that have persistent data or in other words are not descendants to ICalculatedFieldDescriptor's that this entity descriptor contains.
 IDataSourceDescriptor getDataSourceDescriptor()
          Returns the DataSource descriptor that this entity is a part of.
 java.lang.String getDisplayName()
          Returns a displayable name for the entity.
 java.lang.Class getEntityClass()
          Returns the class for the entities described by the entity descriptor.
 IEntityRelation getEntityRelation(int index)
          Access method that returns the indexed IEntityRelation.
 int getEntityRelationCount()
          Access method that returns the number of IEntityRelation:s that has the called entity descriptor as source or target.
 int getEntityRelationIndex(java.lang.String codeName)
          Returns the index of the IEntityRelation with the specified code name, or -1 if no relation is found.
 java.util.Iterator getEntityRelations()
          Access method that returns an interator IEntityRelation with all relation objects that the descriptor is part of.
 int getEntityType()
          Returns the entity type signified by the constants...
 int getFieldCount()
          Returns the number of field descriptors that this entity descriptor contains.
 IFieldDescriptor getFieldDescriptor(int index)
          Returns a specific field descriptor from the entity descriptor addressed by its ordial index.
 IFieldDescriptor getFieldDescriptor(java.lang.String codeName)
          Returns a specific field descriptor from the entity descriptor addressed by its code name.
 java.util.Iterator getFieldDescriptors()
          Returns all field descriptors as an iterator.
 int getFieldIndex(IFieldDescriptor fieldDescriptor)
          Returns the index of the provided field descriptor or a negative value if the field is not a part of the entity descriptor.
 int getFieldIndex(java.lang.String codeName)
          Returns the index of the field descriptor with the provided code name or a negative value if the field is not a part of the entity descriptor.
 java.lang.Class getHomeClass()
          Temporary solution!!!
 java.lang.String getJNDIName()
          Temporary solution!!!
 EntityCollator getNaturalOrder()
          Returns en entity collator defining the natural order for the called entity descriptors entities.
 java.lang.Class getRemoteClass()
          Temporary solution!!!
 java.lang.String getSourceName()
          Returns an identifying name used in communication with the data service layer.
 boolean isCacheable()
          This routine should return true if it "pays" for the system to cache the entire table when accessing a single entity.
 boolean isCreatable()
          Returns true if entities described by the called descriptor may be created.
 boolean isDeletable()
          Returns true if entities described by the called descriptor may be deleted.
 boolean isEditable()
          Returns true if entities described by the called descriptor may be updated.
 boolean isListable()
          This routine should return true if it is meaningfull to display ALL existing entities for a user at the same time.
 boolean isScanable()
          This routine should return true if it is acceptable for the system to for any reason scan all existing entities of this type.
 boolean isSelectable()
          This routine should return true if it possible to view and select between ALL existing entities.
 IEntity loadEntity(Qualifier identityQualifier)
          The load method returnes a single entity object intentified by the provided indentity qualifier that must be able to uniquely identify a single entity instance.
 ISelection loadSelection(Qualifier qualifier)
          Loads a selection of entities of the called descriptors type using the provided entity descriptor.
 

Field Detail

MASTER_ENTITY

public static final int MASTER_ENTITY
Signifies that these enitities are handled as seperate units that can be viewed and handled as isolated units.

See Also:
Constant Field Values

SLAVE_ENTITY

public static final int SLAVE_ENTITY
These entities are generally never viewed or handled as an isolated seperate unit. They are genneraly always viewed and manipulated as slaves or children to another entity type that generaly is a master entity.

See Also:
Constant Field Values

LINK_ENTITY

public static final int LINK_ENTITY
Signifies that the purpose of this entity is only to link other entity types together in N to N relationships.

See Also:
Constant Field Values

STATIC_ENTITY

public static final int STATIC_ENTITY
Used for tables storing system constants that rarely or never changes. These entities are generally cacheable with no time limit.

See Also:
Constant Field Values

CUSTOM_ENTITY

public static final int CUSTOM_ENTITY
Used for entities that are composites of other entities and therefore can not specify another entity type.

See Also:
Constant Field Values

NO_TIME_LIMIT

public static final int NO_TIME_LIMIT
Can be used to chech the result of getCacheTime().

See Also:
Constant Field Values

STORE_ACTION

public static final java.lang.String STORE_ACTION
Code name constant for the store action.

See Also:
Constant Field Values

DELETE_ACTION

public static final java.lang.String DELETE_ACTION
Code name constant for the delete action.

See Also:
Constant Field Values
Method Detail

createEntity

public IEntity createEntity()
Creates an entity with of the type described by this descriptor and loads it with default data.


createEntity

public IEntity createEntity(IDataProvider propertySource)
Creates an entity with of the type described by this descriptor and loads it with data from the provided property source.


loadSelection

public ISelection loadSelection(Qualifier qualifier)
Loads a selection of entities of the called descriptors type using the provided entity descriptor. The method uses the default data source for the entity type.


loadEntity

public IEntity loadEntity(Qualifier identityQualifier)
The load method returnes a single entity object intentified by the provided indentity qualifier that must be able to uniquely identify a single entity instance.


getCodeName

public java.lang.String getCodeName()
Returns an identifying name that can be used to address the field in client software if the field descriptor for some reason is not available.


getSourceName

public java.lang.String getSourceName()
Returns an identifying name used in communication with the data service layer. Should normally never be used by the client developer.


getDisplayName

public java.lang.String getDisplayName()
Returns a displayable name for the entity.


getEntityClass

public java.lang.Class getEntityClass()
Returns the class for the entities described by the entity descriptor.


getEntityType

public int getEntityType()
Returns the entity type signified by the constants...

MASTER_ENTITY = Signifies that these enitities are handled as seperate units that can be viewed and handled as isolated units.
SLAVE_ENTITY = These entities are generally never viewed or handled as an isolated seperate unit. They are genneraly always viewed and manipulated as slaves or children to another entity type that generaly is a master entity.
LINK_ENTITY = Signifies that the purpose of this entity is only to link other entity types together in N to N relationships.
STATIC_ENTITY = Used for tables storing system constants that rarely or never changes. These entities are generally cacheable with no time limit.
CUSTOM_ENTITY = Used for entities that are composites of other entities and therefore can not specify another entity type.


isCreatable

public boolean isCreatable()
Returns true if entities described by the called descriptor may be created. If a store operation is called on a non-persistent entity of the described type an exception should be thrown.


isEditable

public boolean isEditable()
Returns true if entities described by the called descriptor may be updated. If a store operation is called on a persistent entity of the described type an exception should be thrown.


isDeletable

public boolean isDeletable()
Returns true if entities described by the called descriptor may be deleted. If a store operation is called on a persistent entity of the described type an exception should be thrown.


getCacheTime

public int getCacheTime()
Returns the acceptable time in seconds to cache entities described by the descriptor. Zero means no caching is accepable and the constant NO_TIME_LIMIT sinifies that there are no time limit when cacheing.


isSelectable

public boolean isSelectable()
This routine should return true if it possible to view and select between ALL existing entities. In other words if it possible to use for instance a combo box to select between the entities. This is generally true when the entity count is less then 20.


isListable

public boolean isListable()
This routine should return true if it is meaningfull to display ALL existing entities for a user at the same time. This is generally true when the entity count is less then 200.


isCacheable

public boolean isCacheable()
This routine should return true if it "pays" for the system to cache the entire table when accessing a single entity. This depends on many factors, the size of the entities, the bandwith and the frequence of entity access. If the amount of entities exceds 2000 they generaly not considered cachable.


isScanable

public boolean isScanable()
This routine should return true if it is acceptable for the system to for any reason scan all existing entities of this type. In other words if a tablescan is acceptable or should be avoided. If the amount of entities excedes a million this is generally not true.


getFieldCount

public int getFieldCount()
Returns the number of field descriptors that this entity descriptor contains. This includes both data and calculated field descriptors.


getDataFieldCount

public int getDataFieldCount()
Returns the number of field descriptors that have persistent data or in other words are not descendants to ICalculatedFieldDescriptor's that this entity descriptor contains.


getFieldDescriptor

public IFieldDescriptor getFieldDescriptor(int index)
Returns a specific field descriptor from the entity descriptor addressed by its ordial index. May cast OutOfBoundException.


getFieldDescriptor

public IFieldDescriptor getFieldDescriptor(java.lang.String codeName)
Returns a specific field descriptor from the entity descriptor addressed by its code name. May return null if the codeName was not identified.


getFieldDescriptors

public java.util.Iterator getFieldDescriptors()
Returns all field descriptors as an iterator.


getDataSourceDescriptor

public IDataSourceDescriptor getDataSourceDescriptor()
Returns the DataSource descriptor that this entity is a part of.


contains

public boolean contains(IFieldDescriptor fieldDescriptor)
Reurns true if the provided field descriptor is a part the called entity descriptor.


getFieldIndex

public int getFieldIndex(IFieldDescriptor fieldDescriptor)
Returns the index of the provided field descriptor or a negative value if the field is not a part of the entity descriptor.


getFieldIndex

public int getFieldIndex(java.lang.String codeName)
Returns the index of the field descriptor with the provided code name or a negative value if the field is not a part of the entity descriptor.


getEntityRelationCount

public int getEntityRelationCount()
Access method that returns the number of IEntityRelation:s that has the called entity descriptor as source or target.


getEntityRelation

public IEntityRelation getEntityRelation(int index)
Access method that returns the indexed IEntityRelation.


getEntityRelationIndex

public int getEntityRelationIndex(java.lang.String codeName)
Returns the index of the IEntityRelation with the specified code name, or -1 if no relation is found.


getEntityRelations

public java.util.Iterator getEntityRelations()
Access method that returns an interator IEntityRelation with all relation objects that the descriptor is part of.


getActionCount

public int getActionCount()
Access method that returns the number of IEntityAction objects that are available for access from the called IEntityDescriptor.


getAction

public IEntityAction getAction(int index)
Returns the indexed IEntityAction.


getAction

public IEntityAction getAction(java.lang.String codeName)
Returns the IEntityAction with the provided code name. Returns null if the code name could not be identified.


getActions

public java.util.Iterator getActions()
Returns an iterator with all contained IEntityAction objects that are available for access from the called IEntityDescriptor.


getNaturalOrder

public EntityCollator getNaturalOrder()
Returns en entity collator defining the natural order for the called entity descriptors entities.


getHomeClass

public java.lang.Class getHomeClass()
Temporary solution!!! Should be moved!


getRemoteClass

public java.lang.Class getRemoteClass()
Temporary solution!!! Should be moved!


getJNDIName

public java.lang.String getJNDIName()
Temporary solution!!! Should be moved!



Copyright © 2005 Caleigo. All Rights Reserved.