本文整理汇总了Java中org.hibernate.ogm.model.key.spi.EntityKeyMetadata.getTable方法的典型用法代码示例。如果您正苦于以下问题:Java EntityKeyMetadata.getTable方法的具体用法?Java EntityKeyMetadata.getTable怎么用?Java EntityKeyMetadata.getTable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.hibernate.ogm.model.key.spi.EntityKeyMetadata
的用法示例。
在下文中一共展示了EntityKeyMetadata.getTable方法的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() );
}
示例2: forEachTuple
import org.hibernate.ogm.model.key.spi.EntityKeyMetadata; //导入方法依赖的package包/类
@Override
public void forEachTuple(final ModelConsumer consumer, TupleTypeContext tupleTypeContext, EntityKeyMetadata entityKeyMetadata) {
KeyScanCursor<String> cursor = null;
String prefix = entityKeyMetadata.getTable() + ":";
ScanArgs scanArgs = ScanArgs.Builder.matches( prefix + "*" );
do {
cursor = scan( cursor, scanArgs );
consumer.consume( new RedisJsonDialectTuplesSupplier( cursor, entityStorageStrategy, prefix, entityKeyMetadata ) );
} while ( !cursor.isFinished() );
}
示例3: forEachTuple
import org.hibernate.ogm.model.key.spi.EntityKeyMetadata; //导入方法依赖的package包/类
@Override
public void forEachTuple(ModelConsumer consumer, TupleTypeContext tupleTypeContext, EntityKeyMetadata entityKeyMetadata) {
KeyScanCursor<String> cursor = null;
String prefix = entityKeyMetadata.getTable() + ":";
ScanArgs scanArgs = ScanArgs.Builder.matches( prefix + "*" );
do {
cursor = scan( cursor, scanArgs );
consumer.consume( new RedisHashDialectTuplesSupplier( cursor, connection, prefix, entityKeyMetadata ) );
} while ( !cursor.isFinished() );
}
示例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;
}
}