I am using Spring JPA for database access. I am able to find examples such as findByName and countByName, for which I dont have to write any method implementation. I am hopi
Be carefull when you use derived query for batch delete. It isn't what you expect: DeleteExecution
Yes , deleteBy method is supported To use it you need to annotate method with @Transactional
If you take a look at the source code of Spring Data JPA, and particularly the PartTreeJpaQuery
class, you will see that is tries to instantiate PartTree
.
Inside that class the following regular expression
private static final Pattern PREFIX_TEMPLATE = Pattern.compile("^(find|read|get|count|query)(\\p{Lu}.*?)??By")
should indicate what is allowed and what's not.
Of course if you try to add such a method you will actually see that is does not work and you get the full stacktrace.
I should note that I was using looking at version 1.5.0.RELEASE
of Spring Data JPA