Hibernate ORM TimestampType - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Hibernate ORM TimestampType class.

This code example shows how to use the following methods:
    return nullSafeGet(resultSet, names[0]);
  } 
 
  @SuppressWarnings("deprecation") 
  public Object nullSafeGet(ResultSet resultSet, String name) throws SQLException {
    java.sql.Timestamp value = (java.sql.Timestamp) (new TimestampType()).nullSafeGet(resultSet, name);
    if (value == null) {
      return null; 
    } 
    return DbDateUtils.fromSqlTimestamp(value);
  } 
 
  @SuppressWarnings("deprecation") 
  public void nullSafeSet(PreparedStatement preparedStatement, Object value, int index) throws HibernateException, SQLException {
    if (value == null) { 
      s_logger.debug("INSTANT -> TIMESTAMP : NULL -> NULL"); 
      (new TimestampType()).nullSafeSet(preparedStatement, null, index);
    } else { 
      s_logger.debug("INSTANT -> TIMESTAMP : {}   ->  {}", value, DbDateUtils.toSqlTimestamp((Instant) value));
      (new TimestampType()).nullSafeSet(preparedStatement, DbDateUtils.toSqlTimestamp((Instant) value), index);
Full Snippet Info
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java