public class FenixQueryLookupStrategy extends Object implements org.springframework.data.repository.query.QueryLookupStrategy
QueryFenix 注解的查找策略类,该策略类实现了 QueryLookupStrategy 接口.
该类主要重写了 resolveQuery(java.lang.reflect.Method, org.springframework.data.repository.core.RepositoryMetadata, org.springframework.data.projection.ProjectionFactory, org.springframework.data.repository.core.NamedQueries) 这个方法,用来监测 JPA 的接口方法是否标注了 QueryFenix 注解.
QueryFenix 注解,就需要本 Fenix 扩展类库识别处理 XML 文件或 Java 中的 JPQL 语句;QueryFenix 注解,就使用 JPA 默认的 QueryLookupStrategy.| 限定符和类型 | 方法和说明 |
|---|---|
org.springframework.data.repository.query.RepositoryQuery |
resolveQuery(Method method,
org.springframework.data.repository.core.RepositoryMetadata metadata,
org.springframework.data.projection.ProjectionFactory factory,
org.springframework.data.repository.core.NamedQueries namedQueries)
判断执行的方法上是否有
QueryFenix 注解,如果有的话,就构造 FenixJpaQuery 实例,否则就是用 JPA 默认的处理方式. |
public org.springframework.data.repository.query.RepositoryQuery resolveQuery(Method method, org.springframework.data.repository.core.RepositoryMetadata metadata, org.springframework.data.projection.ProjectionFactory factory, org.springframework.data.repository.core.NamedQueries namedQueries)
QueryFenix 注解,如果有的话,就构造 FenixJpaQuery 实例,否则就是用 JPA 默认的处理方式.resolveQuery 在接口中 org.springframework.data.repository.query.QueryLookupStrategymethod - will never be null.metadata - will never be null.factory - will never be null.namedQueries - will never be null.Copyright © 2019. All rights reserved.