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


Java AssociationStorageType类代码示例

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


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

示例1: ttlOnPropertyLevel

import org.hibernate.ogm.datastore.document.options.AssociationStorageType; //导入依赖的package包/类
@Test
public void ttlOnPropertyLevel() throws Exception {
	Map<String, Object> settings = new HashMap<String, Object>();

	TestHelper.configureOptionsFor( settings, Redis.class )
			.associationStorage( AssociationStorageType.ASSOCIATION_DOCUMENT )
			.entity( Cloud.class )
			.property( "backupSnowFlakes", ElementType.METHOD )
			.ttl( 1, TimeUnit.DAYS );

	setupSessionFactory( settings );
	createCloudWithTwoProducedAndOneBackupSnowflake();

	// property-level options are applied to the type as well.
	// not sure, whether this is a good idea.
	assertThat( cloudTtl() ).isGreaterThan( TimeUnit.HOURS.toMillis( 23 ) )
			.isLessThanOrEqualTo( TimeUnit.HOURS.toMillis( 24 ) );

	assertThat( associationTtl() ).isGreaterThan( TimeUnit.HOURS.toMillis( 23 ) )
			.isLessThanOrEqualTo( TimeUnit.HOURS.toMillis( 24 ) );
}
 
开发者ID:hibernate,项目名称:hibernate-ogm-redis,代码行数:22,代码来源:TTLConfiguredProgrammaticallyTest.java

示例2: getNumberOfAssociations

import org.hibernate.ogm.datastore.document.options.AssociationStorageType; //导入依赖的package包/类
@Override
public long getNumberOfAssociations(SessionFactory sessionFactory, AssociationStorageType type) {
	int asscociationCount = 0;
	Set<IgniteCache<Object, BinaryObject>> processedCaches = Collections.newSetFromMap( new IdentityHashMap<IgniteCache<Object, BinaryObject>, Boolean>() );

	for ( CollectionPersister collectionPersister : ( (SessionFactoryImplementor) sessionFactory ).getCollectionPersisters().values() ) {
		AssociationKeyMetadata associationKeyMetadata = ( (OgmCollectionPersister) collectionPersister ).getAssociationKeyMetadata();
		IgniteCache<Object, BinaryObject> associationCache = getAssociationCache( sessionFactory, associationKeyMetadata );
		if ( !processedCaches.contains( associationCache ) ) {
			asscociationCount += associationCache.size();
			processedCaches.add( associationCache );
		}
	}

	return asscociationCount;
}
 
开发者ID:hibernate,项目名称:hibernate-ogm-ignite,代码行数:17,代码来源:IgniteTestHelper.java

示例3: isStoredInEntityStructure

import org.hibernate.ogm.datastore.document.options.AssociationStorageType; //导入依赖的package包/类
@Override
public boolean isStoredInEntityStructure(
		AssociationKeyMetadata keyMetadata,
		AssociationTypeContext associationTypeContext) {

	AssociationStorageType associationStorage = getAssociationStorageType( associationTypeContext );

	if ( keyMetadata.getAssociationType() == AssociationType.ONE_TO_ONE || keyMetadata.getAssociationKind() == AssociationKind.EMBEDDED_COLLECTION || associationStorage == AssociationStorageType.IN_ENTITY ) {
		return true;
	}

	return false;
}
 
开发者ID:hibernate,项目名称:hibernate-ogm-redis,代码行数:14,代码来源:RedisJsonDialect.java

示例4: getNumberOfAssociations

import org.hibernate.ogm.datastore.document.options.AssociationStorageType; //导入依赖的package包/类
@Override
public long getNumberOfAssociations(SessionFactory sessionFactory, AssociationStorageType type) {
	switch ( type ) {
		case ASSOCIATION_DOCUMENT:
			return getNumberOfGlobalAssociations( sessionFactory );
		case IN_ENTITY:
			return getNumberOfEmbeddedAssociations( sessionFactory );
		default:
			throw new IllegalArgumentException( "Unexpected association storaget type " + type );
	}
}
 
开发者ID:hibernate,项目名称:hibernate-ogm-redis,代码行数:12,代码来源:RedisTestHelper.java

示例5: configure

import org.hibernate.ogm.datastore.document.options.AssociationStorageType; //导入依赖的package包/类
@Override
protected void configure(Map<String, Object> cfg) {
	super.configure( cfg );
	cfg.put(
			DocumentStoreProperties.ASSOCIATIONS_STORE,
			AssociationStorageType.ASSOCIATION_DOCUMENT
	);
}
 
开发者ID:hibernate,项目名称:hibernate-ogm-redis,代码行数:9,代码来源:GlobalPropertyTTLTest.java

示例6: configure

import org.hibernate.ogm.datastore.document.options.AssociationStorageType; //导入依赖的package包/类
@Override
protected void configure(Map<String, Object> cfg) {
	super.configure( cfg );
	cfg.put(
			DocumentStoreProperties.ASSOCIATIONS_STORE,
			AssociationStorageType.IN_ENTITY
	);
}
 
开发者ID:hibernate,项目名称:hibernate-ogm-redis,代码行数:9,代码来源:ManyToManyInEntityTest.java

示例7: associationStorage

import org.hibernate.ogm.datastore.document.options.AssociationStorageType; //导入依赖的package包/类
@Override
public RedisPropertyContext associationStorage(AssociationStorageType associationStorageType) {
	Contracts.assertParameterNotNull( associationStorageType, "associationStorageType" );
	addPropertyOption( new AssociationStorageOption(), associationStorageType );
	return this;
}
 
开发者ID:hibernate,项目名称:hibernate-ogm-redis,代码行数:7,代码来源:RedisPropertyContextImpl.java

示例8: associationStorage

import org.hibernate.ogm.datastore.document.options.AssociationStorageType; //导入依赖的package包/类
@Override
public RedisEntityContext associationStorage(AssociationStorageType associationStorageType) {
	Contracts.assertParameterNotNull( associationStorageType, "associationStorageType" );
	addEntityOption( new AssociationStorageOption(), associationStorageType );
	return this;
}
 
开发者ID:hibernate,项目名称:hibernate-ogm-redis,代码行数:7,代码来源:RedisEntityContextImpl.java

示例9: associationStorage

import org.hibernate.ogm.datastore.document.options.AssociationStorageType; //导入依赖的package包/类
@Override
public RedisGlobalContext associationStorage(AssociationStorageType associationStorageType) {
	Contracts.assertParameterNotNull( associationStorageType, "associationStorageType" );
	addGlobalOption( new AssociationStorageOption(), associationStorageType );
	return this;
}
 
开发者ID:hibernate,项目名称:hibernate-ogm-redis,代码行数:7,代码来源:RedisGlobalContextImpl.java

示例10: getAssociationStorageType

import org.hibernate.ogm.datastore.document.options.AssociationStorageType; //导入依赖的package包/类
private AssociationStorageType getAssociationStorageType(AssociationTypeContext associationTypeContext) {
	return associationTypeContext.getOptionsContext().getUnique(
			AssociationStorageOption.class
	);
}
 
开发者ID:hibernate,项目名称:hibernate-ogm-redis,代码行数:6,代码来源:RedisJsonDialect.java

示例11: configure

import org.hibernate.ogm.datastore.document.options.AssociationStorageType; //导入依赖的package包/类
@Override
protected void configure(GetterPersistenceUnitInfo info) {
	super.configure( info );
	info.getProperties()
			.put( DocumentStoreProperties.ASSOCIATIONS_STORE, AssociationStorageType.IN_ENTITY );
}
 
开发者ID:hibernate,项目名称:hibernate-ogm-redis,代码行数:7,代码来源:CompositeIdInEmbeddedTest.java


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