NPersistence Reference Guide
Used to map the SELECT clause of a SQL query to an entity result. If this annotation is used, the SQL statement should select all of the columns that are mapped to the entity object.

This should include foreign key columns to related entities. The results obtained when insufficient data is available are undefined.

Examples

CopyC#
Example:

Query q = em.createNativeQuery(
    "SELECT o.id, o.quantity, o.item, i.id, i.name, i.description "+
        "FROM Order o, Item i " +
        "WHERE (o.quantity > 25) AND (o.item = i.id)",
    "OrderItemResults");
[SqlResultSetMapping(name="OrderItemResults")]
        [EntityResult(ResultSetRef = "OrderItemResults", entityClass=com.acme.Order.class)]
        [EntityResult(ResultSetRef = "OrderItemResults", entityClass=com.acme.Item.class)]

Namespace: NPersistence
Assembly: NPersistence (in NPersistence.dll) Version: 2.0.0.0 (2.0.0.0)

Syntax

   
 C# 
public sealed class EntityResult : Attribute

Members

         
 All Members  Constructors   Fields  
 Public

 Protected
 Instance

 Static 
 Declared

 Inherited
 XNA Framework Only 

 .NET Compact Framework Only 

 MemberDescription
EntityResult()()()()
Initializes a new instance of the EntityResult class
DiscriminatorColumn
Specifies the column name (or alias) of the column in the SELECT list that is used to determine the type of the entity instance.
EntityClass
The class of the result.
Name
Required Name of this EntityResult, the name is used by FieldResults to reference this object.
ResultSetRef
Required. Points to the SqlResultSetMapping this EntityResult belongs to.

Inheritance Hierarchy

System..::..Object
  System..::..Attribute
    NPersistence..::..EntityResult

See Also