FieldResult Class
NPersistence Reference Guide
Is used to map the columns specified in the SELECT list of the query to the properties or fields of the entity class.

Examples

CopyC#
Example:
  Query q = em.createNativeQuery(
      "SELECT o.id AS order_id, " +
          "o.quantity AS order_quantity, " +
          "o.item AS order_item, " +
        "FROM Order o, Item i " +
        "WHERE (order_quantity > 25) AND (order_item = i.id)",
      "OrderResults");

  [SqlResultSetMapping(name="OrderResults")]
          [EntityResult(ResultSetRef = "OrderResults", Name="OrderEntityResult", EntityClass=com.acme.Order.class)]
              [FieldResult(EntityRef = "OrderEntityResult", Name="id", Column="ordeR_ID")]
              [FieldResult(EntityRef = "OrderEntityResult", Name="quantity", Column="order_quantity")]
              [FieldResult(EntityRef = "OrderEntityResult", Name="item", Column="order_item")]

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

Syntax

   
 C# 
public sealed class FieldResult : Attribute

Members

         
 All Members  Constructors   Fields  
 Public

 Protected
 Instance

 Static 
 Declared

 Inherited
 XNA Framework Only 

 .NET Compact Framework Only 

 MemberDescription
FieldResult()()()()
Initializes a new instance of the FieldResult class
Column
Name of the column in the SELECT clause - i.e., column aliases, if applicable.
EntityRef
Required. Points to the EntityResult this FieldResult belongs to.
Name
Name of the persistent field or property of the class.

Inheritance Hierarchy

System..::..Object
  System..::..Attribute
    NPersistence..::..FieldResult

See Also