@Documented @Retention(value=RUNTIME) @Target(value=METHOD) public @interface Finder
Modifier and Type | Optional Element and Description |
---|---|
String |
query
Use this parameter to specify HQL query.
|
String |
queryName
Use this parameter to specify named query name.
|
Class<? extends Collection> |
returnAs
Use this parameter if finder method wants to return custom collection type.
|
String |
sqlQuery
Use this parameter to specify SQL native query.
|
String |
sqlQueryName
Use this parameter to specify SQL native query name.
|
public abstract String queryName
public abstract String query
public abstract String sqlQueryName
public abstract String sqlQuery
public abstract Class<? extends Collection> returnAs
The only requirements for specified type are: no-arg constructor and implemented Collection.addAll(java.util.Collection)
method.
Example:
@Finder(query = "from Book where id in (:ids)", returnAs = HashSet.class) Set<Book> findByIds(@Named("ids") Set<Long> ids);
Copyright © 2008–2017. All rights reserved.