NPersistence Reference Guide
Assembly: NPersistence (in NPersistence.dll) Version: 2.0.0.0 (2.0.0.0)
References name of a column in the SELECT clause of a SQL query -
i.e., column alias, if applicable. Scalar result types can be
included in the query result by specifying this annotation in
the metadata.
Namespace: NPersistenceExamples
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")]
Assembly: NPersistence (in NPersistence.dll) Version: 2.0.0.0 (2.0.0.0)
Syntax
C# |
public sealed class ColumnResult : Attribute
Members
All Members | Constructors | Fields |
Public Protected | Instance Static | Declared Inherited | XNA Framework Only .NET Compact Framework Only |
Member | Description | |
---|---|---|
ColumnResult()()()() | Initializes a new instance of the ColumnResult class | |
Name | (Required) The name of a column in the SELECT clause of a SQL query
| |
ResultSetRef | (Required)
Points to the SqlResultSetMapping this ColumnResult belongs to.
| |
Type | (Required) The type of the scalar
|
Inheritance Hierarchy
System..::..Object
System..::..Attribute
NPersistence..::..ColumnResult
System..::..Attribute
NPersistence..::..ColumnResult