本文整理汇总了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;
}