NamedNativeQuery (Java EE 5 SDK)

Java

Java EE 5 SDK

深圳电信培训中心.徐海蛟老师.


javax.persistence Annotation Type NamedNativeQuery


@Target(value=TYPE)
@Retention(value=RUNTIME)
public @interface NamedNativeQuery

Is used to specify a native SQL named query. Query names are scoped to the persistence unit.

从以下版本开始:
Java Persistence 1.0

Required Element Summary
 String name
          Is used to refer to the query when using the EntityManager methods that create query objects.
 String query
          The SQL query string
 
Optional Element Summary
 QueryHint[] hints
          Vendor-specific query hints
 Class resultClass
          The class of the result
 String resultSetMapping
          The name of a SqlResultSetMapping, as defined in metadata
 

元素详细信息

name

public abstract String name
Is used to refer to the query when using the EntityManager methods that create query objects.


query

public abstract String query
The SQL query string

hints

public abstract QueryHint[] hints
Vendor-specific query hints

默认值:
{}

resultClass

public abstract Class resultClass
The class of the result

默认值:
void.class

resultSetMapping

public abstract String resultSetMapping
The name of a SqlResultSetMapping, as defined in metadata

默认值:
""

Java EE 5 SDK

深圳电信培训中心.徐海蛟老师.


提交错误或意见

版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。深圳电信培训中心.徐海蛟老师教学参考.