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(); }
@Temporal(TemporalType.DATE) @Column(name = "created_date", length = 10) public Date getCreatedDate() { return this.createdDate; }
/** @return null. */ @Temporal(TemporalType.TIMESTAMP) @Column(name = "CREATE_TIME", length = 26) public Date getCreateTime() { return this.createTime; }
@Temporal(TemporalType.DATE) @Column(name = "last_request_failed_date", length = 10) public Date getLastRequestFailedDate() { return this.lastRequestFailedDate; }
@Override public TypedQuery<X> setParameter(String name, Calendar value, TemporalType temporalType) { // TODO Auto-generated method stub return null; }
@Override public TypedQuery<Long> setParameter(final Parameter<Calendar> param, final Calendar value, final TemporalType temporalType) { delegate.setParameter(param, value, temporalType); return this; }
@Override public Query setParameter(int arg0, Date arg1, TemporalType arg2) { throw new UnsupportedOperationException(); }
@Override public TypedQuery<X> setParameter(Parameter<Date> param, Date value, TemporalType temporalType) { // TODO Auto-generated method stub return null; }
@Override public Query setParameter(Parameter<Calendar> arg0, Calendar arg1, TemporalType arg2) { return null; }
@Temporal(TemporalType.TIMESTAMP) @Column(name = "data_fim", nullable = false) public Date getDataFim() { return dataFim; }
@Override public Query setParameter(String arg0, Date arg1, TemporalType arg2) { return null; }
@Temporal(TemporalType.TIMESTAMP) @Column(name = "data", nullable = false) public Date getData() { return data; }
@Override public Query setParameter(int arg0, Date arg1, TemporalType arg2) { return null; }
/** @return null. */ @Temporal(TemporalType.TIMESTAMP) @Column(name = "START_TIME", length = 26) public Date getStartTime() { return this.startTime; }
@Temporal(TemporalType.TIMESTAMP) @Column(name = "LastUpdateTime", length = 19) public Date getLastUpdateTime() { return this.lastUpdateTime; }
@Override public TypedQuery<Long> setParameter(final String name, final Date value, final TemporalType temporalType) { delegate.setParameter(name, value, temporalType); return this; }
@Temporal(TemporalType.TIMESTAMP) @Column(name = "OptTime", nullable = false, length = 19) public Date getOptTime() { return optTime; }
@Temporal(TemporalType.TIMESTAMP) @Column(name = "OpTime", nullable = false, length = 19) public Date getOpTime() { return this.opTime; }
@Temporal(TemporalType.DATE) public Long getDeregistrationDate() { return deregistrationDate; }
/** @return null. */ @Temporal(TemporalType.TIMESTAMP) @Column(name = "END_TIME", length = 26) public Date getEndTime() { return this.endTime; }
@Override public javax.persistence.Query setParameter(String name, Date value, TemporalType temporalType) { return _q.setParameter(name, value, temporalType); }
/** @return null. */ @Temporal(TemporalType.DATE) @Column(name = "PUBLISH_DATE", length = 10) public Date getPublishDate() { return this.publishDate; }
/** @return null. */ @Temporal(TemporalType.TIMESTAMP) @Column(name = "CLOSE_TIME", length = 26) public Date getCloseTime() { return this.closeTime; }
@Override public TypedQuery<X> setParameter(Parameter<Calendar> param, Calendar value, TemporalType temporalType) { // TODO Auto-generated method stub return null; }
/** @return 事件事件. */ @Temporal(TemporalType.TIMESTAMP) @Column(name = "EVENT_TIME", length = 26) public Date getEventTime() { return this.eventTime; }
@Temporal(TemporalType.TIMESTAMP) @Column(name = "data_inicio", nullable = false) public Date getDataInicio() { return dataInicio; }
@Temporal(TemporalType.DATE) @Column(name = "Time", length = 10) public Date getTime() { return this.time; }
@Temporal(TemporalType.TIMESTAMP) @Column(name = "LastOpTime", nullable = false, length = 19) public Date getLastOpTime() { return this.lastOpTime; }
@Column(name = "welcome_time") @Temporal(TemporalType.TIMESTAMP) public Date getWelcomeTime() { return welcomeTime; }