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


Java GenerationTiming.NEVER属性代码示例

本文整理汇总了Java中org.hibernate.tuple.GenerationTiming.NEVER属性的典型用法代码示例。如果您正苦于以下问题:Java GenerationTiming.NEVER属性的具体用法?Java GenerationTiming.NEVER怎么用?Java GenerationTiming.NEVER使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.hibernate.tuple.GenerationTiming的用法示例。


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

示例1: GenerationStrategyPair

public GenerationStrategyPair(
		InMemoryValueGenerationStrategy inMemoryStrategy,
		InDatabaseValueGenerationStrategy inDatabaseStrategy) {
	// perform some normalization.  Also check that only one (if any) strategy is specified
	if ( inMemoryStrategy == null ) {
		inMemoryStrategy = NoInMemoryValueGenerationStrategy.INSTANCE;
	}
	if ( inDatabaseStrategy == null ) {
		inDatabaseStrategy = NoInDatabaseValueGenerationStrategy.INSTANCE;
	}

	if ( inMemoryStrategy.getGenerationTiming() != GenerationTiming.NEVER
			&& inDatabaseStrategy.getGenerationTiming() != GenerationTiming.NEVER ) {
		throw new ValueGenerationStrategyException(
				"in-memory and in-database value generation are mutually exclusive"
		);
	}

	this.inMemoryStrategy = inMemoryStrategy;
	this.inDatabaseStrategy = inDatabaseStrategy;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:21,代码来源:EntityMetamodel.java

示例2: buildGenerationStrategyPair

private static GenerationStrategyPair buildGenerationStrategyPair(
		final SessionFactoryImplementor sessionFactory,
		final Property mappingProperty) {
	final ValueGeneration valueGeneration = mappingProperty.getValueGenerationStrategy();
	if ( valueGeneration != null && valueGeneration.getGenerationTiming() != GenerationTiming.NEVER ) {
		// the property is generated in full. build the generation strategy pair.
		if ( valueGeneration.getValueGenerator() != null ) {
			// in-memory generation
			return new GenerationStrategyPair(
					FullInMemoryValueGenerationStrategy.create( valueGeneration )
			);
		}
		else {
			// in-db generation
			return new GenerationStrategyPair(
					create(
							sessionFactory,
							mappingProperty,
							valueGeneration
					)
			);
		}
	}
	else if ( mappingProperty.getValue() instanceof Component ) {
		final CompositeGenerationStrategyPairBuilder builder = new CompositeGenerationStrategyPairBuilder( mappingProperty );
		interpretPartialCompositeValueGeneration( sessionFactory, (Component) mappingProperty.getValue(), builder );
		return builder.buildPair();
	}

	return NO_GEN_PAIR;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:31,代码来源:EntityMetamodel.java

示例3: add

private void add(InMemoryValueGenerationStrategy inMemoryStrategy) {
	if ( inMemoryStrategies == null ) {
		inMemoryStrategies = new ArrayList<InMemoryValueGenerationStrategy>();
	}
	inMemoryStrategies.add( inMemoryStrategy );

	if ( inMemoryStrategy.getGenerationTiming() != GenerationTiming.NEVER ) {
		hadInMemoryGeneration = true;
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:EntityMetamodel.java

示例4: isNaturalIdentifierInsertGenerated

public boolean isNaturalIdentifierInsertGenerated() {
	// the intention is for this call to replace the usage of the old ValueInclusion stuff (as exposed from
	// persister) in SelectGenerator to determine if it is safe to use the natural identifier to find the
	// insert-generated identifier.  That wont work if the natural-id is also insert-generated.
	//
	// Assumptions:
	//		* That code checks that there is a natural identifier before making this call, so we assume the same here
	// 		* That code assumes a non-composite natural-id, so we assume the same here
	final InDatabaseValueGenerationStrategy strategy = inDatabaseValueGenerationStrategies[ naturalIdPropertyNumbers[0] ];
	return strategy != null && strategy.getGenerationTiming() != GenerationTiming.NEVER;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:11,代码来源:EntityMetamodel.java

示例5: getGenerationTiming

@Override
public GenerationTiming getGenerationTiming() {
	return GenerationTiming.NEVER;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:4,代码来源:PropertyBinder.java

示例6: isInsertGenerated

private boolean isInsertGenerated(NonIdentifierAttribute property) {
	return property.getValueGenerationStrategy() != null
			&& property.getValueGenerationStrategy().getGenerationTiming() != GenerationTiming.NEVER;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:4,代码来源:EntityMetamodel.java

示例7: isVersionGenerated

public boolean isVersionGenerated() {
	final InDatabaseValueGenerationStrategy strategy = inDatabaseValueGenerationStrategies[ versionPropertyIndex ];
	return strategy != null && strategy.getGenerationTiming() != GenerationTiming.NEVER;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:4,代码来源:EntityMetamodel.java


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