spring-data


Alternatives to finder methods for every property in Spring JpaRepository


I use Spring Data JPA for my repository layer. I need to query entities by every possible property and combinations of its properties. So my typical repository looks like this.
public interface UserRepository extends JpaRepository<User, Long> {
User findByLogin(String login);
User findByEmail(String email);
User findByName(String name);
User findByLoginAndEmail(String login, String email);
User findByLoginAndName(String login, String name);
User findByLoginAndEmailAndName(String login, String email, String name);
//and so on
}
Even with three properties it looks ugly enough.
Are there any more flexible alternatives to this approach? Or this design is OK(at least I do not have to implements all of these methods)?
Found query by example. Seems it is what I was looking for.

Related Links

Spring-data-neo4j v4, why no index
Use of Domain Objects in Spring Integration
int-jpa:retrieving-outbound-gateway and caching the result
why do we need add annotation #Transactional in springdata for update function?
Couchbase BulkGet in spring data couchbase
Saving an Iterable of a Spring Data Cassandra entity yields exception
Can i return a Stream from a spring jpa repository using a querydsl predicate argument
Grails JSON deserialization
spring-data-redis 1.7.x and lettuce 4.1.x - java.lang.IncompatibleClassChangeError
Spring DATA REST generated endpoints not appearing in actuator mappings
Is there a spring-data module for EMC Documentum?
Handling double quotes in parameter with #Query annotation
Couchbase - Data Eviction
Couchbase - Full Eviction vs Value Eviction
Spring XD - Unable to undeploy & destroy stream through --cmdfile option
Writing custom n1ql queries in spring

Categories

HOME
jboss
automapper
functional-programming
long-integer
foaf
braintree
gentelella
moodle-api
ontology
tiff
bootstrap-switch
mpu6050
stimulsoft
pygobject
boomi
significance
amazon-mws
opam
backtracking
connection-refused
rxjs5
animated-gif
background-color
adapter
splunk-query
monitor
payeezy
db2-luw
subclassing
uivisualeffectview
cartopy
mv
android-alarms
selenide
resampling
jqgrid-asp.net
expandablelistview
julius-speech
music21
viewmodel
cloudwatch
nonlinear-functions
sonatype
sigsegv
google-news
popen
nivo-slider
connect-direct
clrs
kendo-editor
dex
allegro
yui3
nclam
xmlbeans
wininet
nvda
coovachilli
conan
xcode8-beta4
adp
odp.net-managed
facebook-ios-sdk
textblock
android-expansion-files
textpattern
dsa
blank-line
ampersand
sablecc
google-hangouts
thoughtworks-go
string.format
iodocs
adwords-apiv201402
qt5.4
back
webmethod
siena
hyperloglog
zend-search-lucene
spring-social-linkedin
profiles
code39
colon
ldif
bcdedit
web-frameworks
android-authenticator
jquery-dialog
gwt-celltable
mmc3
ninject-interception
cassini
self-tracking-entities
rational-unified-process
xap
accumulator
rakudo

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App