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


Java EntityKeyMetadata.getColumnNames方法代码示例

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


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

示例1: IgniteTupleSnapshot

import org.hibernate.ogm.model.key.spi.EntityKeyMetadata; //导入方法依赖的package包/类
public IgniteTupleSnapshot(Object id, BinaryObject binaryObject, EntityKeyMetadata keyMetadata) {
	this.id = id;
	this.binaryObject = binaryObject;
	this.keyMetadata = keyMetadata;
	Set<String> idColumnNames = new HashSet<>();
	for ( String columnName : keyMetadata.getColumnNames() ) {
		if ( keyMetadata.isKeyColumn( columnName ) ) {
			idColumnNames.add( columnName );
		}
	}
	if ( idColumnNames.isEmpty() ) {
		throw new UnsupportedOperationException( "There is no id column in entity " + keyMetadata.getTable() + ". Hmm..." );
	}
	this.isSimpleId = idColumnNames.size() == 1;
	this.columnNames = CollectionHelper.asSet( keyMetadata.getColumnNames() );
}
 
开发者ID:hibernate,项目名称:hibernate-ogm-ignite,代码行数:17,代码来源:IgniteTupleSnapshot.java

示例2: keyStringToMap

import org.hibernate.ogm.model.key.spi.EntityKeyMetadata; //导入方法依赖的package包/类
/**
 * Deconstruct the key name into its components:
 * Single key: Use the value from the key
 * Multiple keys: De-serialize the JSON map.
 */
protected Map<String, Object> keyStringToMap(EntityKeyMetadata entityKeyMetadata, String key) {
	if ( entityKeyMetadata.getColumnNames().length == 1 ) {
		return Collections.singletonMap( entityKeyMetadata.getColumnNames()[0], (Object) key );
	}
	return strategy.deserialize( key, Map.class );
}
 
开发者ID:hibernate,项目名称:hibernate-ogm-redis,代码行数:12,代码来源:AbstractRedisDialect.java

示例3: keyToMap

import org.hibernate.ogm.model.key.spi.EntityKeyMetadata; //导入方法依赖的package包/类
/**
 * Deconstruct the key name into its components:
 * Single key: Use the value from the key
 * Multiple keys: De-serialize the JSON map.
 */
@SuppressWarnings("unchecked")
protected Map<String, String> keyToMap(EntityKeyMetadata entityKeyMetadata, String key) {
	if ( entityKeyMetadata.getColumnNames().length == 1 ) {
		return Collections.singletonMap( entityKeyMetadata.getColumnNames()[0], key );
	}
	return strategy.deserialize( key, Map.class );
}
 
开发者ID:hibernate,项目名称:hibernate-ogm-redis,代码行数:13,代码来源:AbstractRedisDialect.java

示例4: IgniteAssociationRowSnapshot

import org.hibernate.ogm.model.key.spi.EntityKeyMetadata; //导入方法依赖的package包/类
public IgniteAssociationRowSnapshot(Object id, BinaryObject binaryObject, AssociationKeyMetadata associationMetadata) {
	this.id = id;
	this.binaryObject = binaryObject;
	this.associationMetadata = associationMetadata;
	this.thirdTableLink = IgniteAssociationSnapshot.isThirdTableAssociation( associationMetadata );
	if ( this.thirdTableLink ) {
		Set<String> cn = new HashSet<>();
		Collections.addAll( cn, associationMetadata.getRowKeyColumnNames() );
		Collections.addAll( cn, associationMetadata.getAssociatedEntityKeyMetadata().getAssociationKeyColumns() );
		this.columnNames = Collections.unmodifiableSet( cn );
		this.isSimpleId = true; //vk: not used in this case
	}
	else {
		Set<String> idColumnNames = new HashSet<>();
		EntityKeyMetadata entityKeyMetadata = associationMetadata.getAssociatedEntityKeyMetadata().getEntityKeyMetadata();
		for ( String columnName : entityKeyMetadata.getColumnNames() ) {
			if ( entityKeyMetadata.isKeyColumn( columnName ) ) {
				idColumnNames.add( columnName );
			}
		}
		if ( idColumnNames.isEmpty() ) {
			throw new UnsupportedOperationException( "There is no id column in entity " + entityKeyMetadata.getTable() + ". Hmm..." );
		}
		this.columnNames = CollectionHelper.asSet( entityKeyMetadata.getColumnNames() );
		this.isSimpleId = idColumnNames.size() == 1;
	}
}
 
开发者ID:hibernate,项目名称:hibernate-ogm-ignite,代码行数:28,代码来源:IgniteAssociationRowSnapshot.java


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