List of usage examples for java.sql Date valueOf
@SuppressWarnings("deprecation") public static Date valueOf(LocalDate date)
From source file:adalid.core.AbstractDataArtifact.java
private Date someDateValue(Field field, String string) { if (StringUtils.isBlank(string)) { return null; }//from w w w . j a va 2s . c o m Date someRelativeDate = someRelativeDateValue(string); if (someRelativeDate != null) { return someRelativeDate; } try { return Date.valueOf(string); } catch (Exception e) { logInvalidDataExpression(field, "date", e); } return null; }
From source file:com.redhat.rhn.manager.system.SystemManager.java
/** * Return a note by ID and Server ID/* w ww . j a va 2 s . co m*/ * @param user User to use to do the lookups * @param nid note ID * @param sid server ID * @return Note object */ public static Note lookupNoteByIdAndSystem(User user, Long nid, Long sid) { SelectMode m = ModeFactory.getMode("System_queries", "note_by_id_and_server"); Note n = new Note(); Map<String, Object> params = new HashMap<String, Object>(); params.put("nid", nid); params.put("sid", sid); DataResult<Map<String, Object>> dr = m.execute(params); for (Map<String, Object> map : dr) { n.setCreator(UserManager.lookupUser(user, (Long) map.get("creator"))); n.setId((Long) map.get("id")); n.setServer(lookupByIdAndUser((Long) map.get("server_id"), user)); n.setSubject((String) map.get("subject")); n.setNote((String) map.get("note")); n.setModified(Date.valueOf((String) map.get("modified"))); } return n; }