當前位置: 首頁>>代碼示例>>Java>>正文


Java TemporalType類代碼示例

本文整理匯總了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();
}
 
開發者ID:spypunk,項目名稱:endpoint-health,代碼行數:34,代碼來源:EndPointCheckDao.java

示例2: getCreatedDate

import javax.persistence.TemporalType; //導入依賴的package包/類
@Temporal(TemporalType.DATE)
@Column(name = "created_date", length = 10)
public Date getCreatedDate() {
	return this.createdDate;
}
 
開發者ID:sarfarazengglb,項目名稱:spring-data,代碼行數:6,代碼來源:Profile.java

示例3: getCreateTime

import javax.persistence.TemporalType; //導入依賴的package包/類
/** @return null. */
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_TIME", length = 26)
public Date getCreateTime() {
    return this.createTime;
}
 
開發者ID:zhaojunfei,項目名稱:lemon,代碼行數:7,代碼來源:PurchaseInfo.java

示例4: getLastRequestFailedDate

import javax.persistence.TemporalType; //導入依賴的package包/類
@Temporal(TemporalType.DATE)
@Column(name = "last_request_failed_date", length = 10)
public Date getLastRequestFailedDate() {
	return this.lastRequestFailedDate;
}
 
開發者ID:sarfarazengglb,項目名稱:spring-data,代碼行數:6,代碼來源:Profile.java

示例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;
}
 
開發者ID:wwu-pi,項目名稱:tap17-muggl-javaee,代碼行數:7,代碼來源:MugglTypedQuery.java

示例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;
}
 
開發者ID:MinBZK,項目名稱:OperatieBRP,代碼行數:6,代碼來源:CustomCountQueryWrapper.java

示例7: setParameter

import javax.persistence.TemporalType; //導入依賴的package包/類
@Override
public Query setParameter(int arg0, Date arg1, TemporalType arg2) {
    throw new UnsupportedOperationException();
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:5,代碼來源:QueryStub.java

示例8: getDataFim

import javax.persistence.TemporalType; //導入依賴的package包/類
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "data_fim", nullable = false)
public Date getDataFim() {
	return dataFim;
}
 
開發者ID:SergioColetto,項目名稱:borabeber-api,代碼行數:6,代碼來源:Promocao.java

示例9: setParameter

import javax.persistence.TemporalType; //導入依賴的package包/類
@Override
public Query setParameter(String arg0, Date arg1, TemporalType arg2) {
    return null;
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:5,代碼來源:QueryStub.java

示例10: getData

import javax.persistence.TemporalType; //導入依賴的package包/類
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "data", nullable = false)
public Date getData() {
	return data;
}
 
開發者ID:m4rciosouza,項目名稱:ponto-inteligente-api,代碼行數:6,代碼來源:Lancamento.java

示例11: getStartTime

import javax.persistence.TemporalType; //導入依賴的package包/類
/** @return null. */
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "START_TIME", length = 26)
public Date getStartTime() {
    return this.startTime;
}
 
開發者ID:zhaojunfei,項目名稱:lemon,代碼行數:7,代碼來源:ActivityInfo.java

示例12: getLastUpdateTime

import javax.persistence.TemporalType; //導入依賴的package包/類
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "LastUpdateTime", length = 19)
public Date getLastUpdateTime() {
    return this.lastUpdateTime;
}
 
開發者ID:zhaoxi1988,項目名稱:sjk,代碼行數:6,代碼來源:ComparableBaseApp.java

示例13: setParameter

import javax.persistence.TemporalType; //導入依賴的package包/類
@Override
public Query setParameter(Parameter<Calendar> arg0, Calendar arg1,
        TemporalType arg2) {

    return null;
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:7,代碼來源:QueryStub.java

示例14: getOptTime

import javax.persistence.TemporalType; //導入依賴的package包/類
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "OptTime", nullable = false, length = 19)
public Date getOptTime() {
    return optTime;
}
 
開發者ID:zhaoxi1988,項目名稱:sjk,代碼行數:6,代碼來源:MonUserChannelApp.java

示例15: getOpTime

import javax.persistence.TemporalType; //導入依賴的package包/類
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "OpTime", nullable = false, length = 19)
public Date getOpTime() {
    return this.opTime;
}
 
開發者ID:zhaoxi1988,項目名稱:sjk,代碼行數:6,代碼來源:Metro.java


注:本文中的javax.persistence.TemporalType類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。