try {
return formatter.parse(datestr).getTime();
}
catch (ParseException e) {
throw new HBqlException(e.getMessage());
}
}
case DATEINTERVAL: {
final Number num = (Number)this.getExprArg(0).getValue(conn, object);
final long val = num.longValue();
return val * this.getIntervalType().getIntervalMillis();
}
case DATECONSTANT: {
return this.dateValue.getValue(conn, object);
}
case RANDOMDATE: {
return Math.abs(GenericFunction.randomVal.nextLong());
}
case LONGTODATE: {
final Number num = (Number)this.getExprArg(0).getValue(conn, object);
final long val = num.longValue();
this.dateValue = new DateLiteral(val);
return this.dateValue.getValue(conn, object);
}
default:
throw new HBqlException("Invalid function: " + this.getFunctionType());
}
}