Search in sources :

Example 1 with AuditLogEntity

use of com.pratilipi.data.type.gae.AuditLogEntity in project pratilipi by Pratilipi.

the class TestApi method get.

@Get
public static GenericResponse get(GenericRequest request) throws UnexpectedServerException {
    String primaryContentId = 4920371378651136L + "";
    Query<AuditLogEntity> query = ObjectifyService.ofy().load().type(AuditLogEntity.class).filter("PRIMARY_CONTENT_ID", primaryContentId).filter("CREATION_DATE >=", new Date(new Date().getTime() - TimeUnit.DAYS.toMillis(1))).order("CREATION_DATE").chunk(100).limit(100);
    List<AuditLog> responseList = new ArrayList<AuditLog>();
    QueryResultIterator<AuditLogEntity> iterator = query.iterator();
    while (iterator.hasNext()) responseList.add(iterator.next());
    System.out.println(responseList.size());
    return new GenericResponse();
}
Also used : GenericResponse(com.pratilipi.api.shared.GenericResponse) ArrayList(java.util.ArrayList) Date(java.util.Date) AuditLog(com.pratilipi.data.type.AuditLog) AuditLogEntity(com.pratilipi.data.type.gae.AuditLogEntity) Get(com.pratilipi.api.annotation.Get)

Aggregations

Get (com.pratilipi.api.annotation.Get)1 GenericResponse (com.pratilipi.api.shared.GenericResponse)1 AuditLog (com.pratilipi.data.type.AuditLog)1 AuditLogEntity (com.pratilipi.data.type.gae.AuditLogEntity)1 ArrayList (java.util.ArrayList)1 Date (java.util.Date)1