List of usage examples for org.hibernate.type DbTimestampType seed
@Override
public Date seed(SharedSessionContractImplementor session)
From source file:com.joe.utilities.core.hibernate.repository.impl.ApplicationConfigurationRepositoryImpl.java
License:Open Source License
public Long retrieveDBTimeOffsetInMilliseconds() { DbTimestampType type = new DbTimestampType(); Timestamp ts = (Timestamp) type.seed((SessionImplementor) getSession()); Calendar cal = Calendar.getInstance(); long actualTimeDiff = cal.getTimeInMillis() - ts.getTime(); //System.out.println("Actual Time Diff in ms(AS - DB)="+actualTimeDiff); return new Long(actualTimeDiff); }
From source file:com.joe.utilities.core.hibernate.repository.impl.ApplicationConfigurationRepositoryImpl.java
License:Open Source License
public Long retrieveDBTimeInMilliseconds() { DbTimestampType type = new DbTimestampType(); Timestamp ts = (Timestamp) type.seed((SessionImplementor) getSession()); return ts.getTime(); }