나는 몽고 데이터베이스에 봄 데이터와 함께 유지됩니다 엔티티 있습니다봄 데이터
public interface MyEntityRepository extends
MongoRepository<MyEntity, String>,
QueryDslPredicateExecutor<MyEntity> {}
그리고 플러그인이 내 저장소입니다
@Document
public class MyEntity {
@Id
private String id;
@QueryType(PropertyType.DATETIME)
private DateTime lastUpdate;
}
을 QueryDSL 생성을위한 내 pom.xml에
<plugin>
<groupId>com.mysema.maven</groupId>
<artifactId>apt-maven-plugin</artifactId>
<version>1.0.8</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>process</goal>
</goals>
<configuration>
<outputDirectory>target/generated-sources</outputDirectory>
<processor>org.springframework.data.mongodb.repository.support.MongoAnnotationProcessor</processor>
</configuration>
</execution>
</executions>
</plugin>
여전히 DateTime을 일반 엔터티로 취급합니다 (및 QueryType 없음). 나는 날짜로 취급하고 싶습니다, 그래서는 지금 내가 할 수없는, 비교를 수행 할 수 있습니다
물론Predicate predicate = QMyEntity.myentity.lastUpdate... // where are the lessThan or greaterThan methods?
는, 가능하면, 내가 대신 다시 떨어지는, JodaTime에 충실하고 싶습니다 자바 날짜, 또는 날짜를 밀리 초로 저장.
문제가 발생했습니다. https://jira.springsource.org/browse/DATAMONGO-624 – Luciano
Querydsl https : //github.com/mysema/querydsl/issues/364 –