Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.cayenne.query
Class EntityResult

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

    public class EntityResult

extends Object

A metadata object that provides mapping of a set of result columns to an ObjEntity. Used by `SQLResultSetMapping`.

Since:
  3.0

Field Summary
`protected Class<?>` | `entityClass`
`protected String` | `entityName`
`protected Collection<org.apache.cayenne.query.FieldResult>` | `fields`

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

Method Summary
`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.
`ClassDescriptor` | `getClassDescriptor(EntityResolver resolver)`
`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()`
`Collection<org.apache.cayenne.query.FieldResult>` | `getFields()`
`ObjEntity` | `getRootEntity(EntityResolver resolver)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### entityName

    protected String entityName

### entityClass

    protected Class<?> entityClass

### fields

    protected Collection<org.apache.cayenne.query.FieldResult> fields

Constructor Detail

### EntityResult

    public EntityResult(Class<?> entityClass)

### EntityResult

    public EntityResult(String entityName)

Method Detail

### getClassDescriptor

    public ClassDescriptor getClassDescriptor(EntityResolver resolver)

### getDbFields

    public Map<String,String> getDbFields(EntityResolver resolver)

  Returns a map of result column names to attribute db paths from the root entity.

### getRootEntity

    public ObjEntity getRootEntity(EntityResolver resolver)

### 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()

### getFields

    public Collection<org.apache.cayenne.query.FieldResult> getFields()

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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