public Comment(Integer id, String imie, String nazwisko, String content, Timestamp data) { this.content = content; this.id = id; this.imie = imie; this.nazwisko = nazwisko; this.data = data.toLocalDateTime(); }
@Override protected LocalDate doNormalize(Object value, DbAttribute targetAttribute) { switch (value.getClass().getName()) { case "java.util.Date": { Date date = (Date) value; return date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); } case "java.sql.Date": { java.sql.Date date = (java.sql.Date) value; return date.toLocalDate(); } case "java.sql.Time": { throw new LmRuntimeException( "Will not perform lossy conversion from " + getTypeName() + ": " + value); } case "java.sql.Timestamp": { Timestamp timestamp = (Timestamp) value; return timestamp.toLocalDateTime().toLocalDate(); } default: { throw new LmRuntimeException( "Value can not be mapped to " + getTypeName() + ": " + value); } } }
private void handleEvent(SplitfileProgressEvent ce) { JSONObject response = insertObject.getHandler().createJSONReplyMessage("progress"); response.put("event", "SplitfileProgress"); response.put("finalizedTotal", ce.finalizedTotal); response.put("totalBlocks", ce.totalBlocks); response.put("succeedBlocks", ce.succeedBlocks); response.put("failedBlocks", ce.failedBlocks); response.put("fatallyFailedBlocks", ce.fatallyFailedBlocks); response.put("minSuccessFetchBlocks", ce.minSuccessFetchBlocks); response.put("minSuccessfulBlocks", ce.minSuccessfulBlocks); TimeZone.setDefault(TimeZone.getTimeZone("UTC")); if (ce.latestSuccess != null) { Timestamp latestSuccess = new Timestamp(ce.latestSuccess.getTime()); response.put("latestSuccess", latestSuccess.toLocalDateTime().toString()); } if (ce.latestFailure != null) { Timestamp latestFailure = new Timestamp(ce.latestFailure.getTime()); response.put("latestFailure", latestFailure.toLocalDateTime().toString()); } insertObject.getHandler().getWebSocket().send(response.toJSONString()); }
public LocalDateTime convertToEntityAttribute(Timestamp databaseValue) { if (databaseValue == null) return null; return databaseValue.toLocalDateTime(); }
public String getCreationTimestamp() { if (creationTimestamp == null) { creationTimestamp = DateTimeFormatter.ISO_DATE_TIME.format(createdOn.toLocalDateTime()); } return creationTimestamp; }
@Override public LocalDateTime convertToEntityAttribute(java.sql.Timestamp databaseValue) { return databaseValue.toLocalDateTime(); }
public CommentDetail(Integer id, String content, Timestamp data, Double star) { this.star = FunctionalityHelper.round(star, 1); this.data = data.toLocalDateTime(); this.content = content; this.id = id; }
@Override public LocalDateTime convertToEntityAttribute(Timestamp timestamp) { return timestamp == null ? null : timestamp.toLocalDateTime(); }
public void setDate(Timestamp date) { this.date = date.toLocalDateTime().toString(); }
public Service(int id, Timestamp date, byte[] breakdown, float totalCost) { this.id = id; this.date = date.toLocalDateTime().toString(); this.breakdown = new String(breakdown); this.totalCost = totalCost; }
public void setTransactionDate(Timestamp timestamp) { this.transactionDate = timestamp.toLocalDateTime(); }