java


Possible to configure more repositoryFactoryBeanClass in a spring boot, or need another work around?


I have a class which extend the standard spring data jparepository with some more functionality, it's work fine, i successfully manage to configure it, but now i created an another repository, with some more functionality.
#Configuration
#EnableJpaRepositories(entityManagerFactoryRef = "appmainEntityManagerFactory",
transactionManagerRef = "appmainTransactionManager", basePackages = {"hu.rfit.some.repositoy", "hu.rfit.some.more....."},
repositoryFactoryBeanClass = AjaxSearchRepositoryFactoryBean.class)
public class DatasourceConfig {
//some irrelevant other settings...
}
I created my repositories, and my repository factory bean according to this article, It's work fine, but then when i created an another repository and want to use both it's instantly break at start up. I have no idea how to configure it since repositoryFactoryBeanClass only accept one class.
this is the repositories in question:
#NoRepositoryBean
public interface AddressRepository<T, ID extends Serializable> {
AjaxSearchOutput<String> getAddresses(AjaxSearchInput input, String addressPath);
}
#NoRepositoryBean
public interface AjaxSearchRepository<T, ID extends Serializable> extends PagingAndSortingRepository<T, ID>, JpaSpecificationExecutor<T> {
AjaxSearchOutput<T> findAll(AjaxSearchInput input);
AjaxSearchOutput<T> findAll(AjaxSearchInput input, Specification<T> additionalSpecification);
}
Whenever i wan to use both how it's ment to be used my app fail during startup with BeanCreationException
#Repository
public interface EmptyplaceRepository extends AjaxSearchRepository<EmptyplaceEntity, Long>, AddressRepository<EmptyplaceEntity, Long> {}
Caused by: org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'emptyplaceRepository': Invocation of
init method failed; nested exception is
org.springframework.data.mapping.PropertyReferenceException: No
property getAddresses found for type EmptyplaceEntity! at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1578)
~[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE]
...
Caused by:
org.springframework.data.mapping.PropertyReferenceException: No
property getAddresses found for type EmptyplaceEntity!
How can i create and use more repository in my spring boot app?

Related Links

Is there any way to add multiple reminders for the same event in android?
JDO update operation on a list not working
Java regex: why numbers [0-9], comma etc. is not an unicode?
How to sort query results based on specific field in mongodb
Counting and Grouping Strings in Drools Expert 6.5, with accumulate or collect keyword
JSON Parsing Into TextView Android API
Android DrawerLayout with NullPointerException
How to drag and drop tabs of the SAME tabpane?
Keeping a finished 'background' on canvases?
Spark Sql query fails
How is a SOAP response treated different in Java 8 vs Java 6?
Java Play 2.5.x JavaCache - How to get the current cache instance?
What is the function of JobBuilderFactory.get(job).incrementer(RunIdIncrementer)?
Java: Array of List<MyClass>
401 Unauthorized -cannot list Google Drive files
How to replace String value with regex

Categories

HOME
ibm-bluemix
compiler-construction
amazon-ec2
tizen
comparison
layout
hashmap
gis
at-command
sharepoint-designer
rubygems
electronics
adobe-analytics
collectd
quickfix
graphlab
highlight.js
windows-7-x64
serilog
database-replication
one-hot-encoding
clickonce
jasonette
extjs5
core-text
numerical-methods
status
tooltipster
applozic
vision
gsoap
nat
junit5
semantic-versioning
fog
avcapturesession
repo
gammu
http-digest
appfabric
dartium
xcode-extension
hilbert-curve
cookiecutter-django
isbn
unixodbc
cubic-spline
parentheses
multipeer-connectivity
alphabet
tizen-native-app
mplayer
worker-thread
imanage
mcafee
orthogonal
google-cdn
pintos
fody
player
freedesktop.org
unity-networking
tcpserver
sdhc
icu4j
intellij-14
citrus-pay
rgeo
varargs
ideamart
web-controls
sonarqube5.1.2
clipperlib
typekit
socketexception
mesa
eol
undefined-reference
resty-gwt
mbr
stxxl
page-layout
jplaton
cos
jquery-knob
bluepill
jspinclude
dmx512
perfect-hash
kdbg
sector
multiple-languages

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App