org.apache.cayenne.map
Class EntityResult

java.lang.Object
  extended by org.apache.cayenne.map.EntityResult

public class EntityResult
extends java.lang.Object

A metadata object that provides mapping of a set of result columns to an ObjEntity. Used by SQLResult. Note that fields in the EntityResult are not required to follow the order of columns in the actual query, and can be added in the arbitrary order.

Since:
3.0

Field Summary
protected  java.lang.Class<?> entityClass
           
protected  java.lang.String entityName
           
protected  java.util.Collection<org.apache.cayenne.map.EntityResult.FieldResult> fields
           
 
Constructor Summary
EntityResult(java.lang.Class<?> entityClass)
           
EntityResult(java.lang.String entityName)
           
 
Method Summary
 void addDbField(java.lang.String dbAttributeName, java.lang.String column)
          Adds a result set column mapping for a single DbAttribute.
 void addObjectField(java.lang.String attributeName, java.lang.String column)
          Adds a result set column mapping for a single object property of the root entity.
 void addObjectField(java.lang.String entityName, java.lang.String attributeName, java.lang.String column)
          Adds a result set column mapping for a single object property of a specified entity that may differ from the root entity if inheritance is involved.
 java.util.Map<java.lang.String,java.lang.String> getDbFields(EntityResolver resolver)
          Returns a map of result column names to attribute db paths from the root entity.
 java.lang.Class<?> getEntityClass()
           
 java.lang.String getEntityName()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

entityName

protected java.lang.String entityName

entityClass

protected java.lang.Class<?> entityClass

fields

protected java.util.Collection<org.apache.cayenne.map.EntityResult.FieldResult> fields
Constructor Detail

EntityResult

public EntityResult(java.lang.Class<?> entityClass)

EntityResult

public EntityResult(java.lang.String entityName)
Method Detail

getDbFields

public java.util.Map<java.lang.String,java.lang.String> getDbFields(EntityResolver resolver)
Returns a map of result column names to attribute db paths from the root entity.


addObjectField

public void addObjectField(java.lang.String attributeName,
                           java.lang.String column)
Adds a result set column mapping for a single object property of the root entity.


addObjectField

public void addObjectField(java.lang.String entityName,
                           java.lang.String attributeName,
                           java.lang.String column)
Adds a result set column mapping for a single object property of a specified entity that may differ from the root entity if inheritance is involved.


addDbField

public void addDbField(java.lang.String dbAttributeName,
                       java.lang.String column)
Adds a result set column mapping for a single DbAttribute.


getEntityName

public java.lang.String getEntityName()

getEntityClass

public java.lang.Class<?> getEntityClass()


Copyright © 2001-2012 Apache Cayenne. All Rights Reserved.