# Class EntityResult

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

public class EntityResult extends 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

  Fields
  Modifier and Type
  Field
  Description
  `protected Class<?>`
  `entityClass`
  `protected String`
  `entityName`
  `protected Collection<org.apache.cayenne.map.EntityResult.FieldResult>`
  `fields`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `EntityResult(Class<?> entityClass)`
  `EntityResult(String entityName)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addDbField(String dbAttributeName, String column)`
  Adds a result set column mapping for a single DbAttribute.
  `void`
  `addObjectField(String attributeName, String column)`
  Adds a result set column mapping for a single object property of the root entity.
  `void`
  `addObjectField(String entityName, String attributeName, 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.
  `Map<String,String>`
  `getDbFields(EntityResolver resolver)`
  Returns a map of result column names to attribute db paths from the root entity.
  `Class<?>`
  `getEntityClass()`
  `String`
  `getEntityName()`

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### entityName

    protected String entityName

  - ### entityClass

    protected Class<?> entityClass

  - ### fields

    protected Collection<org.apache.cayenne.map.EntityResult.FieldResult> fields

- ## Constructor Details

  - ### EntityResult

    public EntityResult(Class<?> entityClass)

  - ### EntityResult

    public EntityResult(String entityName)

- ## Method Details

  - ### getDbFields

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

  - ### addObjectField

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

  - ### addObjectField

    public void addObjectField(String entityName, String attributeName, 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(String dbAttributeName, String column)
    Adds a result set column mapping for a single DbAttribute.

  - ### getEntityName

    public String getEntityName()

  - ### getEntityClass

    public Class<?> getEntityClass()