Class QueryCreationException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.springframework.core.NestedRuntimeException
org.springframework.dao.DataAccessException
org.springframework.dao.NonTransientDataAccessException
org.springframework.dao.InvalidDataAccessApiUsageException
org.springframework.data.repository.core.RepositoryCreationException
org.springframework.data.repository.query.QueryCreationException
- All Implemented Interfaces:
Serializable
Exception to be thrown if a query cannot be created from a
Method.- Author:
- Oliver Gierke, Mark Paluch
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic QueryCreationExceptioncreate(@Nullable String message, @Nullable Throwable cause, Class<?> repositoryInterface, Method method) static QueryCreationExceptioncreate(QueryMethod method, String message) Creates a newQueryCreationException.static QueryCreationExceptioncreate(QueryMethod method, String message, Throwable cause) static QueryCreationExceptioncreate(QueryMethod method, Throwable cause) static QueryCreationExceptioninvalidProperty(QueryMethod method, String propertyName) Rejects the given domain class property.Methods inherited from class RepositoryCreationException
getRepositoryInterfaceMethods inherited from class NestedRuntimeException
contains, getMostSpecificCause, getRootCauseMethods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Method Details
-
invalidProperty
Rejects the given domain class property.- Parameters:
method- theQueryMethodto create the exception for.propertyName- the property name that could not be found.- Returns:
- the
QueryCreationException.
-
create
Creates a newQueryCreationException.- Parameters:
method- theQueryMethodto create the exception for.message- the message to use.- Returns:
- the
QueryCreationException.
-
create
- Parameters:
method- the query method causing the exception.cause- the root cause from the data access API in use.- Returns:
- the
QueryCreationException.
-
create
- Parameters:
method- the query method causing the exception.message- the detail message.cause- the root cause from the data access API in use.- Returns:
- the
QueryCreationException. - Since:
- 4.0
-
create
public static QueryCreationException create(@Nullable String message, @Nullable Throwable cause, Class<?> repositoryInterface, Method method) - Parameters:
message- the detail message.cause- the root cause from the data access API in use.repositoryInterface- the repository interface.method- the query method causing the exception.- Returns:
- the
QueryCreationException. - Since:
- 2.5
-
getMethod
- Returns:
- the method causing the exception.
- Since:
- 2.5
-
getLocalizedMessage
- Overrides:
getLocalizedMessagein classThrowable
-