APISonar


org.hibernate.Hibernate.DATE

> org > hibernate > Hibernate > DATE
org APIs hibernate APIs Hibernate APIs DATE APIs

Example 1
public Query setDate(String name, Date date) {
		setParameter(name, date, Hibernate.DATE);
		return this;
	}
Example 2
public ProfileStatus getUserStatus(final String userId, final Date oldestDate) {
		
		HibernateCallback hcb = new HibernateCallback() {
	  		public Object doInHibernate(Session session) throws HibernateException, SQLException {
	  			Query q = session.getNamedQuery(QUERY_GET_USER_STATUS);
	  			q.setParameter(USER_UUID, userId, Hibernate.STRING);
	  			q.setParameter(OLDEST_STATUS_DATE, oldestDate, Hibernate.DATE);
	  			q.setMaxResults(1);
	  			return q.uniqueResult();
			}
		};
	
		return (ProfileStatus) getHibernateTemplate().execute(hcb);
	}