当前位置: 首页>>代码示例>>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;未经允许,请勿转载。