3
타임 스탬프 열을 검토 Querydsl에서 where 절을 작성하는 경우 (내가 검사 where 절을 만들려고하고
public final DateTimePath<java.sql.Timestamp> startDate = createDateTime("StartDate", java.sql.Timestamp.class);
로 "Q"클래스에서 식별) 컬럼에 저장된 값 은 제공된 값보다 크거나 같습니다.
값은 길지만 자연스럽게 검사하기 전에 필요한 데이터 유형을 만들 수 있습니다.
는{
....
final QViewVETFullList fullList = QViewVETFullList.viewVETFullList;
....
final String startDate = "28.05.2012"; // test data
final BooleanExpression startDateExp = getDateGTEExpression(fullList.startDate, startDate);
.....
query = query.from(fullList);
query = query.where(startDateExp); // this is where it falls over
...
}
public static BooleanExpression getDateGTEExpression(
DateTimePath<Timestamp> path, String dateStr) {
// this seems to be the problem??
final DateTimePath<Timestamp> datePath = Expressions.dateTimePath(
java.sql.Timestamp.class, dateStr);
// this syntax works successfully with other data types
return BooleanOperation.create(Ops.GOE, path, datePath);
}
코드는 컴파일하고 절이 추가 ""지점까지 실행 :
나는 다음과 같은 노력했다. 은 다음과 전복 :
이....
Caused by: java.lang.IllegalArgumentException: Undeclared path 28.05.2012
at com.mysema.query.types.ValidatingVisitor.visit(ValidatingVisitor.java:48)
at com.mysema.query.types.ValidatingVisitor.visit(ValidatingVisitor.java:10)
at com.mysema.query.types.path.DateTimePath.accept(DateTimePath.java:46)
at com.mysema.query.types.ValidatingVisitor.visit(ValidatingVisitor.java:101)
at com.mysema.query.types.ValidatingVisitor.visit(ValidatingVisitor.java:36)
at com.mysema.query.types.ValidatingVisitor.visit(ValidatingVisitor.java:10)
at com.mysema.query.types.expr.BooleanOperation.accept(BooleanOperation.java:44)
at com.mysema.query.DefaultQueryMetadata.validate(DefaultQueryMetadata.java:296)
at com.mysema.query.DefaultQueryMetadata.addWhere(DefaultQueryMetadata.java:138)
at com.mysema.query.support.QueryMixin.where(QueryMixin.java:375)
at com.mysema.query.support.QueryBase.where(QueryBase.java:44)
at com.***.***.***.***.***DAOBean.get*****(***tDAOBean.java:185)
나는이 문제에 대해 어떤 생각에 감사 할 것이다.
문제에 대한 진행 상황이 있습니까? –