Java 类org.hibernate.annotations.Generated 实例源码

项目:lams    文件:PropertyBinder.java   
/**
 * In case the given annotation is a value generator annotation, the corresponding value generation strategy to be
 * applied to the given property is returned, {@code null} otherwise.
 */
private <A extends Annotation> AnnotationValueGeneration<A> getValueGenerationFromAnnotation(
        XProperty property,
        A annotation) {
    ValueGenerationType generatorAnnotation = annotation.annotationType()
            .getAnnotation( ValueGenerationType.class );

    if ( generatorAnnotation == null ) {
        return null;
    }

    Class<? extends AnnotationValueGeneration<?>> generationType = generatorAnnotation.generatedBy();
    AnnotationValueGeneration<A> valueGeneration = instantiateAndInitializeValueGeneration(
            annotation, generationType, property
    );

    if ( annotation.annotationType() == Generated.class &&
            property.isAnnotationPresent( javax.persistence.Version.class ) &&
            valueGeneration.getGenerationTiming() == GenerationTiming.INSERT ) {

        throw new AnnotationException(
                "@Generated(INSERT) on a @Version property not allowed, use ALWAYS (or NEVER): "
                        + StringHelper.qualify( holder.getPath(), name )
        );
    }

    return valueGeneration;
}
项目:lams    文件:GeneratedValueGeneration.java   
@Override
public void initialize(Generated annotation, Class<?> propertyType) {
    this.timing = annotation.value().getEquivalent();
}
项目:debop4j    文件:IMySqlUpdatedTimestamp.java   
/** MySQL 에서 레코드별로 최신 갱신일자를 표현합니다. */
@Column( updatable = false, insertable = false, columnDefinition = "timestamp default current_timestamp on update current_timestamp" )
@Generated( GenerationTime.ALWAYS )
Timestamp getUpdatedTimestamp();
项目:fiware-ppl    文件:EventLog.java   
/**
 * 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;
}