*/
public class EntryParser extends Parser<Entry> {
@Override
public Entry parse(Element element) {
Entry entry = new Entry();
try {
entry.setId(getInt(element, "id"));
entry.setTaskId(getInt(element, "task_id"));
entry.setUserId(getInt(element, "user_id"));
entry.setDate(getDate(element, "date"));
entry.setHours(getDecimal(element, "hours"));
entry.setNotes(get(element, "notes"));
entry.setCreatedAt(getDatetime(element, "created_at"));
entry.setUpdatedAt(getDatetime(element, "updated_at"));
entry.setUserEmail(get(element, "user_email"));
entry.setTask(parseTask(element));
}
catch (PropertyVetoException ex) {
throw new RuntimeException(
"PANIC! This is a new object - there should be no vetoing",
ex);