本文整理汇总了Java中org.hibernate.annotations.GenerationTime类的典型用法代码示例。如果您正苦于以下问题:Java GenerationTime类的具体用法?Java GenerationTime怎么用?Java GenerationTime使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GenerationTime类属于org.hibernate.annotations包,在下文中一共展示了GenerationTime类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkGeneratedAnnotation
import org.hibernate.annotations.GenerationTime; //导入依赖的package包/类
private void checkGeneratedAnnotation() {
AnnotationInstance generatedAnnotation = JandexHelper.getSingleAnnotation(
annotations(),
HibernateDotNames.GENERATED
);
if ( generatedAnnotation != null ) {
this.isInsertable = false;
AnnotationValue generationTimeValue = generatedAnnotation.value();
if ( generationTimeValue != null ) {
GenerationTime genTime = Enum.valueOf( GenerationTime.class, generationTimeValue.asEnum() );
if ( GenerationTime.ALWAYS.equals( genTime ) ) {
this.isUpdatable = false;
this.propertyGeneration = PropertyGeneration.parse( genTime.toString().toLowerCase() );
}
}
}
}
示例2: getUpdatedTimestamp
import org.hibernate.annotations.GenerationTime; //导入依赖的package包/类
/** MySQL 에서 레코드별로 최신 갱신일자를 표현합니다. */
@Column( updatable = false, insertable = false, columnDefinition = "timestamp default current_timestamp on update current_timestamp" )
@Generated( GenerationTime.ALWAYS )
Timestamp getUpdatedTimestamp();
示例3: getReceivedAt
import org.hibernate.annotations.GenerationTime; //导入依赖的package包/类
/**
* Returns time stamp value at which the log message was received from
* the OEE service. This value is automatically generated when the log
* message is inserted into database.
*
* @return time at which the log message was received
*/
@Column(columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
@Generated(GenerationTime.INSERT)
public Date getReceivedAt() {
return receivedAt;
}