Closed
Description
Evangelos Parchas opened DATAMONGO-1488 and commented
org.springframework.data.mongodb.repository.support.MongoAnnotationProcessor
does not take under account @Field
annotations (or any other field mapping annotation) when generating Querydsl query types.
For example, given the model:
@QueryEntity
@Document(collection = "connections")
public class Connection {
@Id
private String id;
@Field("ts")
private Long resendTs;
}
The generated Querydsl query type is:
@Generated("com.querydsl.codegen.EntitySerializer")
public class QConnection extends EntityPathBase<Connection> {
private static final long serialVersionUID = -135104363L;
private static final PathInits INITS = PathInits.DIRECT2;
public static final QConnection connection = new QConnection("connection");
public final StringPath id = createString("id");
public final NumberPath<Long> resendTs = createNumber("resendTs", Long.class);
}
and when executing query with:
QConnection qConnection = QConnection.connection;
connectionRepository.findAll(qConnection.resendTs.gt(System.currentTimeMillis()));
the generated condition contains "resendTs
" instead of "ts
"
Affects: 1.9.2 (Hopper SR2)