I am using a table with sql container. The container’s data source is a free form query. One of the field is an invoice date and in the sql server, the field is a small date time. I’ve overriden the formatPropertyValue function and when i debugged it “property.getType()” was returning “Timestamp”. so this is what i’ve done within the function.
if (property.getType() == Timestamp.class) {
SimpleDateFormat df = new SimpleDateFormat(“dd/MM/yyyy”);
if (property.getValue() == null) {
return null;
} else {
System.out.println(df.format( (Date) property.getValue()));
return df.format( (Date) property.getValue());
}
}
When I run the application, i get the “com.vaadin.ui.table$cacheupdateexception” error.
I got around by changing the sql statement like "query = “SELECT convert(varchar(10), INVOICE_DATE, 110) as INVOICE_DATE,…” but i was wondering if there was a proper way to format a Timestamp field.
Thanks,
Thomas Kim.