SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");if (field.getAnnotation(Temporal.class) != null) {Temporal temporal = field.getAnnotation(Temporal.class);switch (temporal.value()) {case DATE:sdf = new SimpleDateFormat("yyyy-MM-dd");break;case TIME:sdf = new SimpleDateFormat("hh:mm:ss");break;case TIMESTAMP:sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");break;}}Date myDate = (Date) sdf.parse(field.get(jpaBase).toString());