コード例 #1
0
ファイル: PersistentLocalDate.java プロジェクト: webueye/ueye
  public Object nullSafeGet(
      ResultSet resultSet, String string, SessionImplementor sessionImplementor)
      throws SQLException {
    Object timestamp =
        StandardBasicTypes.TIMESTAMP.nullSafeGet(resultSet, string, sessionImplementor);
    if (timestamp == null) {
      return null;
    }

    return new LocalDate(timestamp);
  }
コード例 #2
0
 @Override
 public Object nullSafeGet(
     ResultSet resultSet, String[] names, SessionImplementor session, Object owner)
     throws HibernateException, SQLException {
   Object timestamp = StandardBasicTypes.TIMESTAMP.nullSafeGet(resultSet, names, session, owner);
   if (timestamp == null) {
     return null;
   }
   Date ts = (Date) timestamp;
   Instant instant = Instant.ofEpochMilli(ts.getTime());
   return LocalDateTime.ofInstant(instant, ZoneId.systemDefault());
 }
コード例 #3
0
  @Override
  public Object nullSafeGet(
      ResultSet rs,
      String[] names,
      SharedSessionContractImplementor sharedSessionContractImplementor,
      Object owner)
      throws HibernateException, SQLException {
    Timestamp timestamp =
        (Timestamp)
            StandardBasicTypes.TIMESTAMP.nullSafeGet(
                rs, names[0], sharedSessionContractImplementor, owner);
    String timezone =
        (String)
            StandardBasicTypes.STRING.nullSafeGet(
                rs, names[1], sharedSessionContractImplementor, owner);

    if (timestamp == null || timezone == null) return null;
    else return new DateTime(timestamp, DateTimeZone.forID(timezone));
  }