private byte[] processConstant(DboColumnMeta info, ExpressionNode node) {
//constant is either BigDecimal, BigInteger or a String
Object constant = node.getState();
if (info.isJodaType()) {
DateTimeFormatter fmt;
if (info.getClassType().getName().equals("org.joda.time.DateTime")) {
fmt = ISODateTimeFormat.dateTime();
DateTime dateTime = fmt.parseDateTime(constant.toString());
return StandardConverters.convertToBytes(dateTime);
} else if (info.getClassType().getName().equals("org.joda.time.LocalDateTime")) {
fmt = ISODateTimeFormat.dateTime();
LocalDateTime localDateTime = fmt.parseLocalDateTime(constant.toString());
return StandardConverters.convertToBytes(localDateTime);
} else if (info.getClassType().getName().equals("org.joda.time.LocalDate")) {
fmt = ISODateTimeFormat.date();
LocalDate localDate = fmt.parseLocalDate(constant.toString());
return StandardConverters.convertToBytes(localDate);
} else if (info.getClassType().getName().equals("org.joda.time.LocalTime")) {
fmt = ISODateTimeFormat.time();
LocalTime localTime = fmt.parseLocalTime(constant.toString());
return StandardConverters.convertToBytes(localTime);
}
}
return info.convertToStorage2(constant);
}