|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectthinkmap.datasource.database.EntityResultMapping
public class EntityResultMapping
Simple class that stores mapping from table columns to entities.
For edge mappings this stores information about both the edge and the related node, thus allowing a single query to return both the edge and the related node.
| Field Summary | |
|---|---|
protected boolean |
cache
|
protected Byte |
cacheFlag
|
protected Binding |
entityTypeBinding
|
protected Binding[] |
ids
|
protected Binding[] |
props
|
protected EntityRelation[] |
relations
|
| Constructor Summary | |
|---|---|
EntityResultMapping()
Creates a new EntityResultMapping object. |
|
EntityResultMapping(Binding entityType,
Binding[] ids,
Binding[] props)
Creates a new EntityResultMapping object. |
|
EntityResultMapping(Binding entityType,
Binding[] ids,
Binding[] props,
Binding relatedEntityType,
Binding[] relatedIds,
boolean isReciprocal,
String relation)
Creates a new EntityResultMapping object. |
|
EntityResultMapping(Binding entityType,
Binding[] ids,
Binding[] props,
EntityRelation[] relations)
Creates a new EntityResultMapping object. |
|
| Method Summary | |
|---|---|
boolean |
getCache()
Determine if this mapping can cache its elements |
Binding |
getEntityType()
Get the entity type of mapped entities. |
Binding[] |
getIdBindings()
Get the id column index array. |
boolean |
getIsReciprocal()
Deprecated. |
Binding[] |
getPropertyBindings()
Get the property column index array. |
Binding |
getRelatedEntityType()
Deprecated. |
Binding[] |
getRelatedIdBindings()
Deprecated. |
String |
getRelation()
Deprecated. |
EntityRelation[] |
getRelations()
Get the Relations for this entity. |
void |
outputEntity(IEntityHandler callback,
Message message,
SourceEntity entity,
EntityId id,
Object context)
Output entities to an IEntityHandler |
void |
setCache(boolean b)
Set to true if this mapping can cache its elements |
void |
setEntityType(Binding entityType)
Set the entity type of mapped entities. |
void |
setIdBindings(Binding[] ids)
Set the id column index array. |
void |
setIsReciprocal(boolean isReciprocal)
Deprecated. |
void |
setPropertyBindings(Binding[] props)
Set the property column index array. |
void |
setRelatedEntityType(Binding relatedEntityType)
Deprecated. |
void |
setRelatedIdBindings(Binding[] relatedIds)
Deprecated. |
void |
setRelation(String relation)
Deprecated. |
void |
setRelations(EntityRelation[] relations)
Set the Relations for this entity. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Byte cacheFlag
protected boolean cache
protected Binding entityTypeBinding
protected Binding[] ids
protected Binding[] props
protected EntityRelation[] relations
| Constructor Detail |
|---|
public EntityResultMapping()
public EntityResultMapping(Binding entityType,
Binding[] ids,
Binding[] props)
entityType - entity type of mapped entitiesids - array of id column indicesprops - array of property column indices
public EntityResultMapping(Binding entityType,
Binding[] ids,
Binding[] props,
Binding relatedEntityType,
Binding[] relatedIds,
boolean isReciprocal,
String relation)
entityType - entity type of mapped entitiesids - array of id column indicesprops - array of property column indicesrelatedEntityType - entity type of related entityrelatedIds - array of related id column indicesisReciprocal - true if the relation is reciprocal
public EntityResultMapping(Binding entityType,
Binding[] ids,
Binding[] props,
EntityRelation[] relations)
entityType - entity type of mapped entitiesids - array of id column indicesprops - array of property column indicesrelatedEntityType - entity type of related entityrelatedIds - array of related id column indicesisReciprocal - true if the relation is reciprocal| Method Detail |
|---|
public void setEntityType(Binding entityType)
entityType - entity typepublic Binding getEntityType()
public void setIdBindings(Binding[] ids)
ids - column indicespublic Binding[] getIdBindings()
public void setRelations(EntityRelation[] relations)
relations - The relationspublic EntityRelation[] getRelations()
public void setPropertyBindings(Binding[] props)
props - property column indicespublic Binding[] getPropertyBindings()
public void setRelatedEntityType(Binding relatedEntityType)
relatedEntityType - related entity typepublic Binding getRelatedEntityType()
public void setRelatedIdBindings(Binding[] relatedIds)
relatedIds - related id column indicespublic Binding[] getRelatedIdBindings()
public void setIsReciprocal(boolean isReciprocal)
isReciprocal - true if the relation is reciprocalpublic boolean getIsReciprocal()
public void setCache(boolean b)
b - true if this mapping can cahce its elementspublic boolean getCache()
public String getRelation()
public void setRelation(String relation)
public void outputEntity(IEntityHandler callback,
Message message,
SourceEntity entity,
EntityId id,
Object context)
throws BindingException
IEntityResultMapping
outputEntity in interface IEntityResultMappingcallback - the IEntityHandler that will receive entitiesmessage - the incoming messageentity - the entity being bound (may be null)id - the id of the entity being boundcontext - context object; datasource-specific
BindingException
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||