List of usage examples for javax.persistence.criteria CriteriaBuilder currentTimestamp
Expression<java.sql.Timestamp> currentTimestamp();
From source file:org.finra.dm.dao.impl.DmDaoImpl.java
private Timestamp getCurrentTimestamp() { // Create the criteria builder and the criteria. CriteriaBuilder builder = entityManager.getCriteriaBuilder(); CriteriaQuery<Timestamp> criteria = builder.createQuery(Timestamp.class); // Add the clauses for the query. criteria.select(builder.currentTimestamp()).from(ConfigurationEntity.class); return entityManager.createQuery(criteria).getSingleResult(); }
From source file:org.finra.herd.dao.impl.BaseJpaDaoImpl.java
@Override public Timestamp getCurrentTimestamp() { // Create the criteria builder and the criteria. CriteriaBuilder builder = entityManager.getCriteriaBuilder(); CriteriaQuery<Timestamp> criteria = builder.createQuery(Timestamp.class); // Add the clauses for the query. criteria.select(builder.currentTimestamp()).from(ConfigurationEntity.class); return entityManager.createQuery(criteria).setMaxResults(1).getSingleResult(); }
From source file:org.finra.herd.dao.impl.HerdDaoImpl.java
/** * {@inheritDoc}//www .j a v a 2 s . c o m */ @Override public Timestamp getCurrentTimestamp() { // Create the criteria builder and the criteria. CriteriaBuilder builder = entityManager.getCriteriaBuilder(); CriteriaQuery<Timestamp> criteria = builder.createQuery(Timestamp.class); // Add the clauses for the query. criteria.select(builder.currentTimestamp()).from(ConfigurationEntity.class); return entityManager.createQuery(criteria).getSingleResult(); }