NPersistence Reference Guide
Specifies the mapping of the result of a native SQL query.

Examples

CopyC#
 Example:

 Query q = em.createNativeQuery(
     "SELECT o.id AS order_id, " +
         "o.quantity AS order_quantity, " +
         "o.item AS order_item, " +
         "i.name AS item_name, " +
     "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")]
        [ColumnResult(ResultSetRef = "OrderResults", Name="item_name", Type = "String")]

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

Syntax

   
 C# 
public sealed class SqlResultSetMapping : Attribute

Members

         
 All Members  Constructors   Fields  
 Public

 Protected
 Instance

 Static 
 Declared

 Inherited
 XNA Framework Only 

 .NET Compact Framework Only 

 MemberDescription
SqlResultSetMapping()()()()
Initializes a new instance of the SqlResultSetMapping class
Name
The name given to the result set mapping, and used to refer to it in the methods of the Query API.

Inheritance Hierarchy

System..::..Object
  System..::..Attribute
    NPersistence..::..SqlResultSetMapping

See Also