本文整理汇总了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;
}