本文整理匯總了Java中javax.persistence.TemporalType類的典型用法代碼示例。如果您正苦於以下問題:Java TemporalType類的具體用法?Java TemporalType怎麽用?Java TemporalType使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
TemporalType類屬於javax.persistence包,在下文中一共展示了TemporalType類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: findByDateRange
import javax.persistence.TemporalType; //導入依賴的package包/類
public Collection<EndPointCheck> findByDateRange(final EndPoint endPoint, final Date startDate,
final Date endDate) {
final CriteriaBuilder criteriaBuilder = getEntityManager().getCriteriaBuilder();
final CriteriaQuery<EndPointCheck> criteriaQuery = criteriaBuilder.createQuery(getEntityClass());
final Root<EndPointCheck> root = criteriaQuery
.from(getEntityManager().getMetamodel().entity(getEntityClass()));
final ParameterExpression<EndPoint> endPointParameter = criteriaBuilder.parameter(EndPoint.class);
final ParameterExpression<Date> startDateParameter = criteriaBuilder.parameter(Date.class);
final ParameterExpression<Date> endDateParameter = criteriaBuilder.parameter(Date.class);
final Predicate endPointIdPredicate = criteriaBuilder
.equal(root.get("endPoint"), endPointParameter);
final Path<Date> checkDatePath = root.<Date> get("checkDate");
final Predicate startDatePredicate = criteriaBuilder
.greaterThanOrEqualTo(checkDatePath, startDateParameter);
final Predicate endDatePredicate = criteriaBuilder.lessThanOrEqualTo(
checkDatePath,
endDateParameter);
criteriaQuery.where(criteriaBuilder.and(endPointIdPredicate, startDatePredicate, endDatePredicate));
criteriaQuery.orderBy(Arrays.asList(criteriaBuilder.asc(checkDatePath)));
return getEntityManager().createQuery(criteriaQuery)
.setParameter(endPointParameter, endPoint)
.setParameter(startDateParameter, startDate, TemporalType.DATE)
.setParameter(endDateParameter, endDate, TemporalType.DATE)
.getResultList();
}
示例2: getCreatedDate
import javax.persistence.TemporalType; //導入依賴的package包/類
@Temporal(TemporalType.DATE)
@Column(name = "created_date", length = 10)
public Date getCreatedDate() {
return this.createdDate;
}
示例3: getCreateTime
import javax.persistence.TemporalType; //導入依賴的package包/類
/** @return null. */
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_TIME", length = 26)
public Date getCreateTime() {
return this.createTime;
}
示例4: getLastRequestFailedDate
import javax.persistence.TemporalType; //導入依賴的package包/類
@Temporal(TemporalType.DATE)
@Column(name = "last_request_failed_date", length = 10)
public Date getLastRequestFailedDate() {
return this.lastRequestFailedDate;
}
示例5: setParameter
import javax.persistence.TemporalType; //導入依賴的package包/類
@Override
public TypedQuery<X> setParameter(String name, Calendar value,
TemporalType temporalType) {
// TODO Auto-generated method stub
return null;
}
示例6: setParameter
import javax.persistence.TemporalType; //導入依賴的package包/類
@Override
public TypedQuery<Long> setParameter(final Parameter<Calendar> param, final Calendar value, final TemporalType temporalType) {
delegate.setParameter(param, value, temporalType);
return this;
}
示例7: setParameter
import javax.persistence.TemporalType; //導入依賴的package包/類
@Override
public Query setParameter(int arg0, Date arg1, TemporalType arg2) {
throw new UnsupportedOperationException();
}
示例8: getDataFim
import javax.persistence.TemporalType; //導入依賴的package包/類
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "data_fim", nullable = false)
public Date getDataFim() {
return dataFim;
}
示例9: setParameter
import javax.persistence.TemporalType; //導入依賴的package包/類
@Override
public Query setParameter(String arg0, Date arg1, TemporalType arg2) {
return null;
}
示例10: getData
import javax.persistence.TemporalType; //導入依賴的package包/類
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "data", nullable = false)
public Date getData() {
return data;
}
示例11: getStartTime
import javax.persistence.TemporalType; //導入依賴的package包/類
/** @return null. */
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "START_TIME", length = 26)
public Date getStartTime() {
return this.startTime;
}
示例12: getLastUpdateTime
import javax.persistence.TemporalType; //導入依賴的package包/類
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "LastUpdateTime", length = 19)
public Date getLastUpdateTime() {
return this.lastUpdateTime;
}
示例13: setParameter
import javax.persistence.TemporalType; //導入依賴的package包/類
@Override
public Query setParameter(Parameter<Calendar> arg0, Calendar arg1,
TemporalType arg2) {
return null;
}
示例14: getOptTime
import javax.persistence.TemporalType; //導入依賴的package包/類
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "OptTime", nullable = false, length = 19)
public Date getOptTime() {
return optTime;
}
示例15: getOpTime
import javax.persistence.TemporalType; //導入依賴的package包/類
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "OpTime", nullable = false, length = 19)
public Date getOpTime() {
return this.opTime;
}