当前位置: 首页>>代码示例>>Java>>正文


Java Temporal类代码示例

本文整理汇总了Java中javax.persistence.Temporal的典型用法代码示例。如果您正苦于以下问题:Java Temporal类的具体用法?Java Temporal怎么用?Java Temporal使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Temporal类属于javax.persistence包,在下文中一共展示了Temporal类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getAnnotationBasedDateCategory

import javax.persistence.Temporal; //导入依赖的package包/类
/**
 * @return DATE or TIMESTAMP based on presence of @OrcTemporal annotation.
 */
protected Category getAnnotationBasedDateCategory() {
    OrcTemporal orcTemporal = getAnnotation(OrcTemporal.class);
    if (orcTemporal == null) {
        Temporal jpaTemporal = getAnnotation(Temporal.class);
        if (jpaTemporal == null) {
            return Category.TIMESTAMP;
        }
        switch (jpaTemporal.value()) {
            case DATE:
                return Category.DATE;
            case TIME:
            case TIMESTAMP:
                return Category.TIMESTAMP;
        }
    }
    switch (orcTemporal.value()) {
        case DATE:
            return Category.DATE;
        case TIMESTAMP:
            return Category.TIMESTAMP;
    }
    return Category.TIMESTAMP;
}
 
开发者ID:eclecticlogic,项目名称:eclectic-orc,代码行数:27,代码来源:AbstractSchemaColumn.java

示例2: getTemporal

import javax.persistence.Temporal; //导入依赖的package包/类
private void getTemporal(List<Annotation> annotationList, Element element) {
	Element subElement = element != null ? element.element( "temporal" ) : null;
	if ( subElement != null ) {
		AnnotationDescriptor ad = new AnnotationDescriptor( Temporal.class );
		String temporal = subElement.getTextTrim();
		if ( "DATE".equalsIgnoreCase( temporal ) ) {
			ad.setValue( "value", TemporalType.DATE );
		}
		else if ( "TIME".equalsIgnoreCase( temporal ) ) {
			ad.setValue( "value", TemporalType.TIME );
		}
		else if ( "TIMESTAMP".equalsIgnoreCase( temporal ) ) {
			ad.setValue( "value", TemporalType.TIMESTAMP );
		}
		else if ( StringHelper.isNotEmpty( temporal ) ) {
			throw new AnnotationException( "Unknown TemporalType: " + temporal + ". " + SCHEMA_VALIDATION );
		}
		annotationList.add( AnnotationFactory.create( ad ) );
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:21,代码来源:JPAOverriddenAnnotationReader.java

示例3: getCreatedDate

import javax.persistence.Temporal; //导入依赖的package包/类
@Temporal(TemporalType.DATE)
@Column(name = "created_date", length = 10)
public Date getCreatedDate() {
	return this.createdDate;
}
 
开发者ID:sarfarazengglb,项目名称:spring-data,代码行数:6,代码来源:Profile.java

示例4: getLastUpdated

import javax.persistence.Temporal; //导入依赖的package包/类
@Temporal(TemporalType.DATE)
@Column(name = "last_updated", length = 10)
public Date getLastUpdated() {
	return this.lastUpdated;
}
 
开发者ID:sarfarazengglb,项目名称:spring-data,代码行数:6,代码来源:Profile.java

示例5: getLastRequestFailedDate

import javax.persistence.Temporal; //导入依赖的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

示例6: getLastIndexTime

import javax.persistence.Temporal; //导入依赖的package包/类
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "LastIndexTime", nullable = false, length = 19)
public Date getLastIndexTime() {
    return this.lastIndexTime;
}
 
开发者ID:zhaoxi1988,项目名称:sjk,代码行数:6,代码来源:AppHistory4Index.java

示例7: getUpdateDate

import javax.persistence.Temporal; //导入依赖的package包/类
/** @return null. */
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "UPDATE_DATE", length = 26)
public Date getUpdateDate() {
    return this.updateDate;
}
 
开发者ID:zhaojunfei,项目名称:lemon,代码行数:7,代码来源:SequenceInfo.java

示例8: getIncrementLastTime

import javax.persistence.Temporal; //导入依赖的package包/类
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "IncrementLastTime", length = 19)
public Date getIncrementLastTime() {
    return this.incrementLastTime;
}
 
开发者ID:zhaoxi1988,项目名称:sjk,代码行数:6,代码来源:Market.java

示例9: getRevisionDate

import javax.persistence.Temporal; //导入依赖的package包/类
@Temporal(DATE)
public Date getRevisionDate() {
    return revisionDate;
}
 
开发者ID:wwu-pi,项目名称:tap17-muggl-javaee,代码行数:5,代码来源:Part.java

示例10: getWelcomeTime

import javax.persistence.Temporal; //导入依赖的package包/类
@Column(name = "welcome_time")
@Temporal(TemporalType.TIMESTAMP)
public Date getWelcomeTime() {
    return welcomeTime;
}
 
开发者ID:bcgov,项目名称:sbc-qsystem,代码行数:6,代码来源:QCustomer.java

示例11: getCreatedAt

import javax.persistence.Temporal; //导入依赖的package包/类
/**
 * Returns creation date for current blog entry.
 * 
 * @return Creation date for curretn blog entry.
 */
@Temporal(TemporalType.TIMESTAMP)
@Column(nullable = false)
public Date getCreatedAt() {
    return createdAt;
}
 
开发者ID:fgulan,项目名称:java-course,代码行数:11,代码来源:BlogEntry.java

示例12: getPublishDate

import javax.persistence.Temporal; //导入依赖的package包/类
/** @return null. */
@Temporal(TemporalType.DATE)
@Column(name = "PUBLISH_DATE", length = 10)
public Date getPublishDate() {
    return this.publishDate;
}
 
开发者ID:zhaojunfei,项目名称:lemon,代码行数:7,代码来源:BookInfo.java

示例13: getAddTime

import javax.persistence.Temporal; //导入依赖的package包/类
/** @return null. */
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "ADD_TIME", length = 26)
public Date getAddTime() {
    return this.addTime;
}
 
开发者ID:zhaojunfei,项目名称:lemon,代码行数:7,代码来源:BookInfo.java

示例14: getEndTime

import javax.persistence.Temporal; //导入依赖的package包/类
/** @return null. */
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "END_TIME", length = 26)
public Date getEndTime() {
    return this.endTime;
}
 
开发者ID:zhaojunfei,项目名称:lemon,代码行数:7,代码来源:SalaryInfo.java

示例15: getReturnTime

import javax.persistence.Temporal; //导入依赖的package包/类
/** @return null. */
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "RETURN_TIME", length = 26)
public Date getReturnTime() {
    return this.returnTime;
}
 
开发者ID:zhaojunfei,项目名称:lemon,代码行数:7,代码来源:BookBorrow.java


注:本文中的javax.persistence.Temporal类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。