Date threeDaysAgo = now.getTime();
// Create statement to only select line items for the given order that
// have been modified in the last 3 days.
Statement filterStatement =
new StatementBuilder(
"WHERE lastModifiedDateTime >= :dateTimeString AND orderId = :orderId LIMIT 500")
.putValue("orderId", orderId)
.putValue("dateTimeString", DATE_TIME_FORMAT.format(threeDaysAgo)).toStatement();
// Get line items by statement.