NPersistence Reference Guide
Assembly: NPersistence (in NPersistence.dll) Version: 2.0.0.0 (2.0.0.0)
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.
CopyC#
Namespace: NPersistenceThis should include foreign key columns to related entities. The results obtained when insufficient data is available are undefined.
Examples
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)]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 |
| Member | Description | |
|---|---|---|
| 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
System..::..Attribute
NPersistence..::..EntityResult