本文整理了Java中org.hibernate.ogm.model.spi.Association.get()
方法的一些代码示例,展示了Association.get()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Association.get()
方法的具体详情如下:
包路径:org.hibernate.ogm.model.spi.Association
类名称:Association
方法名:get
[英]Returns the association row with the given key.
[中]返回具有给定键的关联行。
代码示例来源:origin: hibernate/hibernate-ogm
@Override
public String toString() {
StringBuilder sb = new StringBuilder( "Association[" ).append( StringHelper.lineSeparator() );
Iterator<RowKey> rowKeys = getKeys().iterator();
while ( rowKeys.hasNext() ) {
RowKey rowKey = rowKeys.next();
sb.append( " " ).append( rowKey ).append( "=" ).append( get( rowKey ) );
if ( rowKeys.hasNext() ) {
sb.append( "," ).append( StringHelper.lineSeparator() );
}
}
sb.append( StringHelper.lineSeparator() ).append( "]" );
return sb.toString();
}
}
代码示例来源:origin: hibernate/hibernate-ogm
Tuple assocEntryTuple = associationPersister.getAssociation().get( assocEntryKey );
if ( assocEntryTuple == null ) {
throw new AssertionFailure( "Deleting a collection tuple that is not present: " + "table {" + getTableName() + "} collectionKey {" + id + "} entry {" + entry + "}" );
代码示例来源:origin: org.hibernate.ogm/hibernate-ogm-couchdb
Map<String, Object> row = (Map<String, Object>) getAssociationRow( association.get( rowKey ), associationKey );
rows.add( getAssociationRow( association.get( rowKey ), associationKey ) );
代码示例来源:origin: hibernate/hibernate-ogm
Tuple assocEntryTuple = associationPersister.getAssociation().get( assocEntryKey );
if ( assocEntryTuple == null ) {
throw new AssertionFailure( "Updating a collection tuple that is not present: " + "table {" + getTableName() + "} collectionKey {" + key + "} entry {" + entry + "}" );
代码示例来源:origin: hibernate/hibernate-ogm
Document row = (Document) getAssociationRow( association.get( rowKey ), key );
rows.add( getAssociationRow( association.get( rowKey ), key ) );
代码示例来源:origin: org.hibernate.ogm/hibernate-ogm-mongodb
Document row = (Document) getAssociationRow( association.get( rowKey ), key );
rows.add( getAssociationRow( association.get( rowKey ), key ) );
代码示例来源:origin: hibernate/hibernate-ogm
private String toShortString(Association association) {
if ( association == null ) {
return null;
}
StringBuilder sb = new StringBuilder( "Association[" );
Iterator<RowKey> rowKeys = association.getKeys().iterator();
while ( rowKeys.hasNext() ) {
RowKey rowKey = rowKeys.next();
sb.append( toShortString( rowKey ) ).append( "=" ).append( toShortString( association.get( rowKey ) ) );
if ( rowKeys.hasNext() ) {
sb.append( "," ).append( StringHelper.lineSeparator() );
}
}
sb.append( "]" );
return sb.toString();
}
代码示例来源:origin: hibernate/hibernate-ogm
/**
* Whether the rows of the given association should be stored in a hash using the single row key column as key or
* not.
*/
public static boolean organizeAssociationMapByRowKey(
org.hibernate.ogm.model.spi.Association association,
AssociationKey key,
AssociationContext associationContext) {
if ( association.isEmpty() ) {
return false;
}
if ( key.getMetadata().getRowKeyIndexColumnNames().length != 1 ) {
return false;
}
Object valueOfFirstRow = association.get( association.getKeys().iterator().next() )
.get( key.getMetadata().getRowKeyIndexColumnNames()[0] );
if ( !( valueOfFirstRow instanceof String ) ) {
return false;
}
// The list style may be explicitly enforced for compatibility reasons
return getMapStorage( associationContext ) == MapStorageType.BY_KEY;
}
代码示例来源:origin: hibernate/hibernate-ogm
Tuple associationRow = association.get( assocEntryKey );
Serializable entityId = (Serializable) gridTypeOfAssociatedId.nullSafeGet( associationRow, getElementColumnNames(), session, null );
@SuppressWarnings("unchecked")
代码示例来源:origin: hibernate/hibernate-ogm
Tuple tuple = ids.get( ids.getKeys().iterator().next() );
final Serializable id = (Serializable) getGridIdentifierType().nullSafeGet( tuple, getIdentifierColumnNames(), session, null );
return load( id, null, LockMode.NONE, session );
代码示例来源:origin: hibernate/hibernate-ogm
if ( assoc != null ) {
for ( RowKey rowKey : assoc.getKeys() ) {
resultset.addTuple( assoc.get( rowKey ) );
内容来源于网络,如有侵权,请联系作者删除!