spring - querydsl default customize method cannot load -


i add bindings in customize method, referring below code snap. there strange issue, when restarting program, customize method loaded, method can called successfully, cannot loaded, leads wrong query results. debugged resource injecting adminrepository. when unloading customize method, spring's jdkdynamictarget class has no method cached:

public interface adminrepository extends crudrepository<monthgprs, string>,     querydslpredicateexecutor<monthgprs>, querydslbindercustomizer<qmonthgprs> { logger log = loggerfactory.getlogger (adminrepository.class); @override default public void customize(querydslbindings bindings, qmonthgprs root) {      log.debug ("adminrepository");      bindings.bind (root.appleftgprs).all (((path, value) -> {         iterator = value.iterator ( );         return path.goe ((float) it.next ( )).and (path.loe ((float) it.next ( )));     }));      bindings.bind (root.wifileftgprs).all (((path, value) -> {         iterator = value.iterator ( );         return path.between ((float) it.next ( ), (float) it.next ( ));     }));      bindings.bind (root.siminfo.createddate).all (((path, value) -> {         iterator = value.iterator ( );         return path.after ((zoneddatetime) it.next ( )).and (path.before ((zoneddatetime)                 .next ( )));     }));      bindings.bind (string.class)             .first ((stringpath path, string value) -> path.containsignorecase (value)); } 

} btw, use com.querydsl:querydsl-mongodb:jar:4.1.4, org.springframework.boot:spring-boot-devtools:jar:1.4.1.release, org.springframework:spring-context-support:jar:4.3.3.release.

i have found reason defined 2 repositories 1 domain model, in

org.springframework.data.repository.support.repositories 

private final map<class<?>, string> repositorybeannames;

this map maintains key-value pairs, in using class key, repository name value. if application context has more 1 repository same domain model, 1 repository class loaded. if query dsl repository loaded, customize method called, or other repository loaded.


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -