|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectthinkmap.client.Entity
thinkmap.client.SourceEntity
public class SourceEntity
Source Entities are created by the SourceManager and generally represent the root of the Entity chain. One source entity is created (on demand) for each entity in the datasource. SourceEntities have an EntityId, which is used to uniquely identify them to the datasource. They also have a set of relations which describes their relationship to other related Entities.
Source entities fetch their relations from the datasource lazily.
Source Entities can be serialized to a DataSource via the writeTo() method.
| Nested Class Summary | |
|---|---|
class |
SourceEntity.Relation
A Relation defines a relationship between two entities in the source manager. |
| Field Summary | |
|---|---|
protected long |
createdOnRevision
|
protected boolean |
dataFetched
Whether the actual data of the SourceEntity has been fetched. |
static String |
ENTITY_ID
|
protected boolean |
hasRelations
|
protected Hashtable |
providedProperties
|
static String |
RELATED_ENTITIES
|
protected long |
relatedFetchedOnRevision
|
protected byte |
relatedFlag
|
| Fields inherited from class thinkmap.client.Entity |
|---|
phDeferred |
| Constructor Summary | |
|---|---|
SourceEntity()
|
|
| Method Summary | |
|---|---|
void |
addProperty(Property pp)
Adds a property that was configured via xml. |
void |
addRelation(SourceEntity.Relation re)
Add a relation to this SourceEntity. |
void |
clearRelatedEntities()
Remove all the related entities from this entity, and mark the relations as needing to be loaded from the datasource. |
Property |
createProperty()
Create a new property for xml configuration that will eventually be added via the addProperty() method. |
SourceEntity.Relation |
createRelation()
Create a relation that will be added via the addRelation() method. |
Object |
getAttribute(String name)
Get an attribute from the SourceEntity |
EntityId |
getEntityId()
Get the entity id of this entity |
Object |
getPropertyAttribute(String propertyName,
String attributeName)
Get an attribute of a provided property |
Property[] |
getProvidedProperties()
|
byte |
getRelatedFlags()
|
SourceEntity.Relation |
getRelation(int i)
Get a relation at a particular index. |
int |
getRelationCount()
Get the number of relations that this entity has. |
void |
invalidateRelations()
Mark the relations as needing to be (re)fetched from the datasource. |
void |
setAttribute(String name,
Object value)
Set an attribute on the SourceEntity |
void |
setAttributes(Hashtable cache)
Set many attributes at once |
void |
setEntityId(EntityId id)
Set the entity id of this entity. |
void |
setEntityId(String[] s)
Set the id of the entity, which uniquely identifies the entity. |
void |
setEntityType(String s)
Set the type of the entity. |
void |
setHasRelations(boolean val)
|
void |
setRelatedFlags(byte i)
|
String |
toString()
|
void |
writeTo(IEntityHandler handler,
boolean writeRelations)
|
| Methods inherited from class thinkmap.client.Entity |
|---|
getProperty, getPropertyNames, removeProperty, setProperty |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String ENTITY_ID
public static final String RELATED_ENTITIES
protected Hashtable providedProperties
protected byte relatedFlag
protected boolean hasRelations
protected long relatedFetchedOnRevision
protected long createdOnRevision
protected boolean dataFetched
| Constructor Detail |
|---|
public SourceEntity()
| Method Detail |
|---|
public String toString()
toString in class Objectpublic Property createProperty()
public void addProperty(Property pp)
throws Exception
pp - a property that was configured via xml.
Exceptionpublic void setEntityId(String[] s)
s - the entity's IDpublic void setEntityType(String s)
s - the entity's typepublic void setEntityId(EntityId id)
id - public EntityId getEntityId()
public void clearRelatedEntities()
public int getRelationCount()
public SourceEntity.Relation getRelation(int i)
i - the index of the relation to retrieve
public SourceEntity.Relation createRelation()
public void addRelation(SourceEntity.Relation re)
re - the relation to addpublic void invalidateRelations()
public void writeTo(IEntityHandler handler,
boolean writeRelations)
public byte getRelatedFlags()
public void setRelatedFlags(byte i)
public void setHasRelations(boolean val)
public Property[] getProvidedProperties()
public Object getPropertyAttribute(String propertyName,
String attributeName)
public void setAttribute(String name,
Object value)
public void setAttributes(Hashtable cache)
public Object getAttribute(String name)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||