Package org.apache.cayenne.map

# Class SQLResult

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

public class SQLResult extends Object
A metadata object that defines how a row in a result set can be converted to result objects. SQLResult can be mapped to a single scalar, a single entity or a mix of scalars and entities that is represented as an Object[].

Since:
  3.0

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected String`
  `name`
  `protected List<Object>`
  `resultDescriptors`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SQLResult()`
  Creates an unnamed SQLResultSet.
  `SQLResult(String name)`
  Creates a named SQLResultSet.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addColumnResult(String column)`
  Adds a result set column name to the mapping.
  `void`
  `addEmbeddedResult(EmbeddedResult embeddedResult)`
  `void`
  `addEntityResult(EntityResult entityResult)`
  `List<Object>`
  `getComponents()`
  Returns a list of "uncompiled" result descriptors.
  `String`
  `getName()`
  `List<Object>`
  `getResolvedComponents(EntityResolver resolver)`
  `void`
  `setName(String name)`

  ### Methods inherited from class java.lang.Object

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

- ## Field Details

  - ### name

    protected String name

  - ### resultDescriptors

    protected List<Object> resultDescriptors

- ## Constructor Details

  - ### SQLResult

    public SQLResult()
    Creates an unnamed SQLResultSet.

  - ### SQLResult

    public SQLResult(String name)
    Creates a named SQLResultSet.

- ## Method Details

  - ### getResolvedComponents

    public List<Object> getResolvedComponents(EntityResolver resolver)

  - ### getName

    public String getName()

  - ### setName

    public void setName(String name)

  - ### getComponents

    public List<Object> getComponents()
    Returns a list of "uncompiled" result descriptors. Column descriptors are returned as Strings, entity descriptors - as `EntityResult`. To get fully resolved descriptors, use `getResolvedComponents(EntityResolver)`.

  - ### addEntityResult

    public void addEntityResult(EntityResult entityResult)

  - ### addEmbeddedResult

    public void addEmbeddedResult(EmbeddedResult embeddedResult)

  - ### addColumnResult

    public void addColumnResult(String column)
    Adds a result set column name to the mapping.