spring-data-couchbase
是否支持将querydsl
集成到存储库类中?如果可以的话,有人可以帮我吗?
This documentation没有向我提供要使用的annotation processor
和maven goals
的详细信息。
谢谢!
spring-data-couchbase
是否支持将querydsl
集成到存储库类中?如果可以的话,有人可以帮我吗?
This documentation没有向我提供要使用的annotation processor
和maven goals
的详细信息。
谢谢!
希望这会帮助您更相关的方式
1)在这里我附加了pom.xml文件
<dependency>
<groupId>com.mysema.querydsl</groupId>
<artifactId>querydsl-core</artifactId>
<version>3.3.2</version>
</dependency>
<dependency>
<groupId>com.mysema.querydsl</groupId>
<artifactId>querydsl-apt</artifactId>
<version>3.3.2</version>
</dependency>
<dependency>
<groupId>com.mysema.querydsl</groupId>
<artifactId>querydsl-jpa</artifactId>
<version>3.3.2</version>
</dependency>
2)使用QueryDslPredicateExecutor扩展了存储库类
@Repository
public interface EmployeeRepository extends CrudRepository<Employee,Integer>,QueryDslPredicateExecutor<Employee>{
public Employee findByEmployeeId(Integer id); }
Click here for relevant configuration
,是的,我们可以将spring数据存储库与querydsl集成。
它确实支持与存储库类集成。
用于mvn目标-生成和用于注释处理器
<plugin>
<groupId>com.mysema.maven</groupId>
<artifactId>maven-apt-plugin</artifactId>
<version>1.0</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>process</goal>
</goals>
<configuration>
<outputDirectory>target/generated-sources</outputDirectory>
<processor>com.mysema.query.apt.jpa.JPAAnnotationProcessor</processor>
</configuration>
</execution>
</executions>
</plugin>
了解更多具体信息 进一步浏览此博客https://spring.io/blog/2011/04/26/advanced-spring-data-jpa-specifications-and-querydsl/