|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
@Documented @Target(value=CONSTRUCTOR) @Retention(value=RUNTIME) public @interface QueryProjection
Annotation for APT based query type generation. Annotate constructors with this annotation.
Example
class UserInfo {
private String firstName, lastName;
@QueryProjection
public UserInfo(String firstName, String lastName) {
this.firstName = firstName;
this.lastName = lastName;
}
// getters and setters
}
The projection can then be used like this
QUser user = QUser.user;
List <UserInfo> result = query.from(user)
.where(user.valid.eq(true))
.list(new QUserInfo(user.firstName, user.lastName));
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |