本文整理匯總了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;
}
示例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 ) );
}
}
示例3: getCreatedDate
import javax.persistence.Temporal; //導入依賴的package包/類
@Temporal(TemporalType.DATE)
@Column(name = "created_date", length = 10)
public Date getCreatedDate() {
return this.createdDate;
}
示例4: getLastUpdated
import javax.persistence.Temporal; //導入依賴的package包/類
@Temporal(TemporalType.DATE)
@Column(name = "last_updated", length = 10)
public Date getLastUpdated() {
return this.lastUpdated;
}
示例5: getLastRequestFailedDate
import javax.persistence.Temporal; //導入依賴的package包/類
@Temporal(TemporalType.DATE)
@Column(name = "last_request_failed_date", length = 10)
public Date getLastRequestFailedDate() {
return this.lastRequestFailedDate;
}
示例6: getLastIndexTime
import javax.persistence.Temporal; //導入依賴的package包/類
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "LastIndexTime", nullable = false, length = 19)
public Date getLastIndexTime() {
return this.lastIndexTime;
}
示例7: getUpdateDate
import javax.persistence.Temporal; //導入依賴的package包/類
/** @return null. */
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "UPDATE_DATE", length = 26)
public Date getUpdateDate() {
return this.updateDate;
}
示例8: getIncrementLastTime
import javax.persistence.Temporal; //導入依賴的package包/類
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "IncrementLastTime", length = 19)
public Date getIncrementLastTime() {
return this.incrementLastTime;
}
示例9: getRevisionDate
import javax.persistence.Temporal; //導入依賴的package包/類
@Temporal(DATE)
public Date getRevisionDate() {
return revisionDate;
}
示例10: getWelcomeTime
import javax.persistence.Temporal; //導入依賴的package包/類
@Column(name = "welcome_time")
@Temporal(TemporalType.TIMESTAMP)
public Date getWelcomeTime() {
return welcomeTime;
}
示例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;
}
示例12: getPublishDate
import javax.persistence.Temporal; //導入依賴的package包/類
/** @return null. */
@Temporal(TemporalType.DATE)
@Column(name = "PUBLISH_DATE", length = 10)
public Date getPublishDate() {
return this.publishDate;
}
示例13: getAddTime
import javax.persistence.Temporal; //導入依賴的package包/類
/** @return null. */
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "ADD_TIME", length = 26)
public Date getAddTime() {
return this.addTime;
}
示例14: getEndTime
import javax.persistence.Temporal; //導入依賴的package包/類
/** @return null. */
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "END_TIME", length = 26)
public Date getEndTime() {
return this.endTime;
}
示例15: getReturnTime
import javax.persistence.Temporal; //導入依賴的package包/類
/** @return null. */
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "RETURN_TIME", length = 26)
public Date getReturnTime() {
return this.returnTime;
}