Soda2Consumer consumer = createConsumer();
//
// Check floating timestamp
SoqlQuery query = new SoqlQueryBuilder()
.setWhereClause(new ConditionalExpression(ColumnUtil.getQueryName("Confirmation Vote") + "=to_fixed_timestamp('2012-6-20T07:00:00Z')"))
.build();
final List<NominationWithJoda> results = consumer.query(NOMINATION_DATA_SET, query, NominationWithJoda.LIST_TYPE);
final Set<String> names = Sets.newHashSet("Masumoto, David", "Trottenberg, Polly Ellen");
for (NominationWithJoda n: results) {
TestCase.assertTrue(names.remove(n.getName()));
TestCase.assertEquals(d, n.getNominationDate().toDate());
}
//
// Check greater than floating timestamp
SoqlQuery queryGreater = new SoqlQueryBuilder()
.setWhereClause(new ConditionalExpression(ColumnUtil.getQueryName("Confirmation Vote") + ">to_fixed_timestamp('2012-6-20T07:00:00Z')"))
.build();
final List<NominationWithJoda> resultsGreater = consumer.query(NOMINATION_DATA_SET, queryGreater, NominationWithJoda.LIST_TYPE);
for (NominationWithJoda n: resultsGreater) {
if (n.getConfirmationVoteDate() != null) {
TestCase.assertTrue(d.before(n.getConfirmationVoteDate().toDate()));
}
}
//
// Check greater than floating timestamp
SoqlQuery queryLesser = new SoqlQueryBuilder()
.setWhereClause(new ConditionalExpression(ColumnUtil.getQueryName("Confirmation Vote") + "<to_fixed_timestamp('2012-6-20T07:00:00Z')"))
.build();
final List<NominationWithJoda> resultsLesser = consumer.query(NOMINATION_DATA_SET, queryLesser, NominationWithJoda.LIST_TYPE);