站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Java Platform, Enterprise Edition v5.0 API Specifications

NamedNativeQuery (Java EE 5 SDK) - Java Platform, Enterprise Edition v5.0 API Specifications

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.

Since:
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
 

Element Detail

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

Default:
{}

resultClass

public abstract Class resultClass
The class of the result

Default:
void.class

resultSetMapping

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

Default:
""

Java EE 5 SDK

Submit a bug or feature

Copyright 2006 Sun Microsystems, Inc. All rights reserved.