DATACMNS-106 - Introduced QueryMethod.getReturnedObjectType().

This commit is contained in:
Oliver Gierke
2011-12-02 23:31:07 +01:00
parent 4a8d7a6f7c
commit e6431fccc7

View File

@@ -120,6 +120,11 @@ public class QueryMethod {
return String.format("%s.%s", domainClass.getSimpleName(), method.getName());
}
/**
* Returns the domain class the query method is targeted at.
*
* @return
*/
protected Class<?> getDomainClass() {
Class<?> repositoryDomainClass = metadata.getDomainClass();
@@ -128,6 +133,15 @@ public class QueryMethod {
return repositoryDomainClass == null || repositoryDomainClass.isAssignableFrom(methodDomainClass) ? methodDomainClass
: repositoryDomainClass;
}
/**
* Returns the type of the object that will be returned.
*
* @return
*/
public Class<?> getReturnedObjectType() {
return metadata.getReturnedDomainClass(method);
}
/**
* Returns whether the finder will actually return a collection of entities or a single one.