當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。