当前位置: 首页>>代码示例>>Java>>正文


Java Generated类代码示例

本文整理汇总了Java中org.hibernate.annotations.Generated的典型用法代码示例。如果您正苦于以下问题:Java Generated类的具体用法?Java Generated怎么用?Java Generated使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Generated类属于org.hibernate.annotations包,在下文中一共展示了Generated类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getValueGenerationFromAnnotation

import org.hibernate.annotations.Generated; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:32,代码来源:PropertyBinder.java

示例2: initialize

import org.hibernate.annotations.Generated; //导入依赖的package包/类
@Override
public void initialize(Generated annotation, Class<?> propertyType) {
	this.timing = annotation.value().getEquivalent();
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:GeneratedValueGeneration.java

示例3: getUpdatedTimestamp

import org.hibernate.annotations.Generated; //导入依赖的package包/类
/** MySQL 에서 레코드별로 최신 갱신일자를 표현합니다. */
@Column( updatable = false, insertable = false, columnDefinition = "timestamp default current_timestamp on update current_timestamp" )
@Generated( GenerationTime.ALWAYS )
Timestamp getUpdatedTimestamp();
 
开发者ID:debop,项目名称:debop4j,代码行数:5,代码来源:IMySqlUpdatedTimestamp.java

示例4: getReceivedAt

import org.hibernate.annotations.Generated; //导入依赖的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;
}
 
开发者ID:fdicerbo,项目名称:fiware-ppl,代码行数:13,代码来源:EventLog.java


注:本文中的org.hibernate.annotations.Generated类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。