本文整理汇总了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;
}
示例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;
}
示例3: add
private void add(InMemoryValueGenerationStrategy inMemoryStrategy) {
if ( inMemoryStrategies == null ) {
inMemoryStrategies = new ArrayList<InMemoryValueGenerationStrategy>();
}
inMemoryStrategies.add( inMemoryStrategy );
if ( inMemoryStrategy.getGenerationTiming() != GenerationTiming.NEVER ) {
hadInMemoryGeneration = true;
}
}
示例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;
}
示例5: getGenerationTiming
@Override
public GenerationTiming getGenerationTiming() {
return GenerationTiming.NEVER;
}
示例6: isInsertGenerated
private boolean isInsertGenerated(NonIdentifierAttribute property) {
return property.getValueGenerationStrategy() != null
&& property.getValueGenerationStrategy().getGenerationTiming() != GenerationTiming.NEVER;
}
示例7: isVersionGenerated
public boolean isVersionGenerated() {
final InDatabaseValueGenerationStrategy strategy = inDatabaseValueGenerationStrategies[ versionPropertyIndex ];
return strategy != null && strategy.getGenerationTiming() != GenerationTiming.NEVER;
}