DATACMNS-106 - Introduced QueryMethod.getReturnedObjectType().
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user