argos/dmp-backend/data/src/main/java/eu/eudat/query/UserQueryOld.java

38 lines
895 B
Java

package eu.eudat.query;
import eu.eudat.data.dao.DatabaseAccessLayer;
import eu.eudat.data.UserEntity;
import eu.eudat.queryable.QueryableList;
import java.util.List;
import java.util.UUID;
public class UserQueryOld extends Query<UserEntity, UUID> {
private UUID id;
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public UserQueryOld(DatabaseAccessLayer<UserEntity, UUID> databaseAccessLayer) {
super(databaseAccessLayer);
}
public UserQueryOld(DatabaseAccessLayer<UserEntity, UUID> databaseAccessLayer, List<String> selectionFields) {
super(databaseAccessLayer, selectionFields);
}
@Override
public QueryableList<UserEntity> getQuery() {
QueryableList<UserEntity> query = this.databaseAccessLayer.asQueryable();
if (this.id != null)
query.where((builder, root) -> builder.equal(root.get("id"), this.id));
return query;
}
}