HHH-7373 : Remove commented out code from unit test
This commit is contained in:
parent
48cd1e2f81
commit
92c7b2d04f
|
@ -132,72 +132,6 @@ public class BasicCollectionBindingTests extends BaseUnitTestCase {
|
||||||
FetchTiming.DELAYED,
|
FetchTiming.DELAYED,
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
|
||||||
PluralAttributeBinding propertyRefSetBinding = metadata.getCollection( EntityWithBasicCollections.class.getName() + ".thePropertyRefSet" );
|
|
||||||
assertNotNull( propertyRefSetBinding );
|
|
||||||
assertSame( propertyRefSetBinding, entityBinding.locateAttributeBinding( "thePropertyRefSet" ) );
|
|
||||||
TableSpecification propertyRefSetCollectionTable = propertyRefSetBinding.getPluralAttributeKeyBinding().getCollectionTable();
|
|
||||||
assertNotNull( propertyRefSetCollectionTable );
|
|
||||||
assertEquals( Identifier.toIdentifier( "EntityWithBasicCollections_thePropertyRefSet" ), propertyRefSetCollectionTable.getLogicalName() );
|
|
||||||
PluralAttributeKeyBinding propertyRefSetKeyBinding = propertyRefSetBinding.getPluralAttributeKeyBinding();
|
|
||||||
assertSame( propertyRefSetBinding, propertyRefSetKeyBinding.getPluralAttributeBinding() );
|
|
||||||
HibernateTypeDescriptor propertyRefSetHibernateTypeDescriptor = propertyRefSetBinding.getHibernateTypeDescriptor();
|
|
||||||
assertNull( propertyRefSetHibernateTypeDescriptor.getExplicitTypeName() );
|
|
||||||
assertEquals( Set.class.getName(), propertyRefSetHibernateTypeDescriptor.getJavaTypeName() );
|
|
||||||
assertTrue( propertyRefSetHibernateTypeDescriptor.getTypeParameters().isEmpty() );
|
|
||||||
assertTrue( propertyRefSetHibernateTypeDescriptor.getResolvedTypeMapping() instanceof SetType );
|
|
||||||
assertFalse( propertyRefSetHibernateTypeDescriptor.getResolvedTypeMapping().isComponentType() );
|
|
||||||
assertEquals(
|
|
||||||
EntityWithBasicCollections.class.getName() + ".thePropertyRefSet",
|
|
||||||
( (SetType) propertyRefSetHibernateTypeDescriptor.getResolvedTypeMapping() ).getRole()
|
|
||||||
);
|
|
||||||
assertTrue( propertyRefSetBinding.isLazy() );
|
|
||||||
assertEquals( FetchTiming.DELAYED, propertyRefSetBinding.getFetchTiming() );
|
|
||||||
|
|
||||||
ForeignKey fkPropertyRefSet = propertyRefSetKeyBinding.getForeignKey();
|
|
||||||
assertNotNull( fkPropertyRefSet );
|
|
||||||
assertSame( propertyRefSetCollectionTable, fkPropertyRefSet.getSourceTable() );
|
|
||||||
assertEquals( 1, fkPropertyRefSet.getColumnSpan() );
|
|
||||||
Iterator<Column> fkPropertyRefSetColumnIterator = fkPropertyRefSet.getColumns().iterator();
|
|
||||||
Iterator<Column> fkPropertyRefSetSourceColumnIterator = fkPropertyRefSet.getSourceColumns().iterator();
|
|
||||||
assertNotNull( fkPropertyRefSetColumnIterator );
|
|
||||||
assertNotNull( fkPropertyRefSetSourceColumnIterator );
|
|
||||||
assertTrue( fkPropertyRefSetColumnIterator.hasNext() );
|
|
||||||
assertTrue( fkPropertyRefSetSourceColumnIterator.hasNext() );
|
|
||||||
assertEquals( Identifier.toIdentifier( "pid" ), fkPropertyRefSetColumnIterator.next().getColumnName() );
|
|
||||||
assertEquals( Identifier.toIdentifier( "pid" ), fkPropertyRefSetSourceColumnIterator.next().getColumnName() );
|
|
||||||
assertFalse( fkPropertyRefSetColumnIterator.hasNext() );
|
|
||||||
assertFalse( fkPropertyRefSetSourceColumnIterator.hasNext() );
|
|
||||||
assertSame( entityBinding.getPrimaryTable(), fkPropertyRefSet.getTargetTable() );
|
|
||||||
assertSame( entityBinding.getPrimaryTable().locateColumn( "name" ), fkPropertyRefSet.getTargetColumns().iterator().next() );
|
|
||||||
assertSame( ForeignKey.ReferentialAction.NO_ACTION, fkPropertyRefSet.getDeleteRule() );
|
|
||||||
assertSame( ForeignKey.ReferentialAction.NO_ACTION, fkPropertyRefSet.getUpdateRule() );
|
|
||||||
// FK is null because no default FK name is generated until HHH-7092 is fixed
|
|
||||||
assertNull( fkPropertyRefSet.getName() );
|
|
||||||
checkEquals(
|
|
||||||
entityBinding.locateAttributeBinding( "name" ).getHibernateTypeDescriptor(),
|
|
||||||
propertyRefSetKeyBinding.getHibernateTypeDescriptor()
|
|
||||||
);
|
|
||||||
assertFalse( propertyRefSetKeyBinding.isInverse() );
|
|
||||||
assertEquals( 2, propertyRefSetCollectionTable.getPrimaryKey().getColumnSpan() );
|
|
||||||
Iterator<Column> propertyRefSetPrimaryKeyIterator = propertyRefSetCollectionTable.getPrimaryKey().getColumns().iterator();
|
|
||||||
assertEquals(
|
|
||||||
entityBinding.getPrimaryTable().locateColumn( "name" ).getJdbcDataType(),
|
|
||||||
propertyRefSetPrimaryKeyIterator.next().getJdbcDataType()
|
|
||||||
);
|
|
||||||
assertEquals(
|
|
||||||
propertyRefSetCollectionTable.locateColumn( "property_ref_set_stuff" ).getJdbcDataType(),
|
|
||||||
propertyRefSetPrimaryKeyIterator.next().getJdbcDataType()
|
|
||||||
);
|
|
||||||
assertFalse( propertyRefSetPrimaryKeyIterator.hasNext() );
|
|
||||||
assertSame(
|
|
||||||
propertyRefSetCollectionTable.getPrimaryKey().getColumns().iterator().next(),
|
|
||||||
propertyRefSetKeyBinding.getForeignKey().getColumns().iterator().next()
|
|
||||||
);
|
|
||||||
assertEquals( PluralAttributeElementNature.BASIC, propertyRefSetBinding.getPluralAttributeElementBinding().getPluralAttributeElementNature() );
|
|
||||||
assertEquals( Integer.class.getName(), propertyRefSetBinding.getPluralAttributeElementBinding().getHibernateTypeDescriptor().getJavaTypeName() );
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private <X extends CollectionType> void checkResult(
|
private <X extends CollectionType> void checkResult(
|
||||||
|
|
Loading…
Reference in New Issue