HHH-7736 join subclass support and set mutable property to the plural attribute binding

This commit is contained in:
Strong Liu 2013-01-14 02:19:40 +08:00
parent 9b7462c39c
commit 0bed7eaad9
34 changed files with 205 additions and 186 deletions

View File

@ -513,7 +513,7 @@ public final class StringHelper {
*/
public static String generateAlias(String description, int unique) {
return generateAliasRoot(description) +
Integer.toString(unique) +
unique +
'_';
}

View File

@ -182,6 +182,7 @@ import org.jboss.logging.Logger;
* @author Hardy Ferentschik
* @author Gail Badner
* @author Brett Meyer
* @author Strong Liu
*/
public class Binder {
private static final CoreMessageLogger log = Logger.getMessageLogger(
@ -1410,7 +1411,7 @@ public class Binder {
attributeBinding.setCustomSqlDelete( attributeSource.getCustomSqlDelete() );
attributeBinding.setCustomSqlDeleteAll( attributeSource.getCustomSqlDeleteAll() );
attributeBinding.setWhere( attributeSource.getWhere() );
attributeBinding.setMutable( attributeSource.isMutable() );
switch ( attributeSource.getElementSource().getNature() ) {
case BASIC:
bindBasicPluralAttribute( attributeSource, attributeBinding, reflectedCollectionJavaTypes );

View File

@ -257,6 +257,11 @@ public class PluralAttributeSourceImpl implements PluralAttributeSource, Orderab
return associationAttribute.getOrderBy();
}
@Override
public boolean isMutable() {
return associationAttribute.isMutable();
}
@Override
public boolean isOrdered() {
return StringHelper.isNotEmpty( getOrder() );

View File

@ -85,6 +85,7 @@ public class PluralAssociationAttribute extends AssociationAttribute {
private LazyCollectionOption lazyOption;
private final boolean isCollectionIdPresent;
private final boolean mutable;
public static PluralAssociationAttribute createPluralAssociationAttribute(
@ -207,6 +208,8 @@ public class PluralAssociationAttribute extends AssociationAttribute {
inverseForeignKeyName = null;
}
this.mutable = JandexHelper.getSingleAnnotation( annotations(), HibernateDotNames.IMMUTABLE ) == null;
this.caching = determineCachingSettings();
this.isExtraLazy = lazyOption == LazyCollectionOption.EXTRA;
this.customPersister = determineCustomPersister();
@ -487,6 +490,9 @@ public class PluralAssociationAttribute extends AssociationAttribute {
}
public boolean isMutable() {
return mutable;
}
}

View File

@ -334,13 +334,7 @@ public class EntityClass extends ConfiguredClass {
HibernateDotNames.IMMUTABLE,
ClassInfo.class
);
if ( hibernateImmutableAnnotation != null ) {
isImmutable = true;
}
else {
isImmutable = false;
}
isImmutable = hibernateImmutableAnnotation != null ;
final AnnotationInstance whereAnnotation = JandexHelper.getSingleAnnotation(
getClassInfo(), HibernateDotNames.WHERE
);

View File

@ -191,6 +191,11 @@ public abstract class AbstractPluralAttributeSourceImpl
return elementClassReference;
}
@Override
public boolean isMutable() {
return pluralAttributeElement.isMutable();
}
@Override
public String getMappedBy() {
return null;

View File

@ -98,9 +98,9 @@ class ColumnSourceImpl
@Override
public Size getSize() {
return new Size(
Helper.getValue( columnElement.getPrecision(), -1 ),
Helper.getValue( columnElement.getScale(), -1 ),
Helper.getValue( columnElement.getLength(), -1 ),
Helper.getValue( columnElement.getPrecision(), Size.DEFAULT_PRECISION ),
Helper.getValue( columnElement.getScale(), Size.DEFAULT_SCALE ),
Helper.getValue( columnElement.getLength(), Size.DEFAULT_LENGTH ),
Size.LobMultiplier.NONE
);
}

View File

@ -26,7 +26,6 @@ package org.hibernate.metamodel.spi.binding;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@ -38,9 +37,6 @@ import org.hibernate.internal.FilterConfiguration;
import org.hibernate.internal.util.StringHelper;
import org.hibernate.internal.util.ValueHolder;
import org.hibernate.internal.util.collections.ArrayHelper;
import org.hibernate.internal.util.collections.JoinedIterable;
import org.hibernate.internal.util.collections.JoinedIterator;
import org.hibernate.internal.util.collections.SingletonIterator;
import org.hibernate.metamodel.spi.domain.AttributeContainer;
import org.hibernate.metamodel.spi.domain.Entity;
import org.hibernate.metamodel.spi.domain.SingularAttribute;
@ -58,6 +54,7 @@ import org.hibernate.tuple.entity.EntityTuplizer;
* @author Steve Ebersole
* @author Hardy Ferentschik
* @author Gail Badner
* @author Strong Liu
*/
public class EntityBinding extends AbstractAttributeBindingContainer implements Filterable {
private static final String NULL_DISCRIMINATOR_MATCH_VALUE = "null";
@ -592,8 +589,7 @@ public class EntityBinding extends AbstractAttributeBindingContainer implements
*/
public int getAttributeBindingClosureSpan() {
// TODO: update account for join attribute bindings
return isRoot() ? getNonIdAttributeBindingClosure().length :
superEntityBinding.getAttributeBindingClosureSpan() + getNonIdAttributeBindingClosure().length;
return getAttributeBindingClosure().length;
}
/**
@ -606,23 +602,35 @@ public class EntityBinding extends AbstractAttributeBindingContainer implements
public AttributeBinding[] getAttributeBindingClosure() {
// TODO: update size to account for joins
if ( isRoot() ) {
return getNonIdAttributeBindingClosure();
return attributeBindingMapInternal().values()
.toArray( new AttributeBinding[attributeBindingMapInternal().size()] );
}
else {
return ArrayHelper.join(
superEntityBinding.getAttributeBindingClosure(),
getNonIdAttributeBindingClosure()
attributeBindingMapInternal().values()
.toArray( new AttributeBinding[attributeBindingMapInternal().size()] )
);
}
}
private AttributeBinding[] getNonIdAttributeBindingClosure() {
List<AttributeBinding> list = new ArrayList<AttributeBinding>();
attributeBindings();
for ( final AttributeBinding ab : attributeBindings() ) {
if(ab instanceof CompositeAttributeBinding){
public AttributeBinding[] getNonIdAttributeBindingClosure(){
// TODO: update size to account for joins
if ( isRoot() ) {
return internalGetNonIdAttributeBindingClosure();
}
else {
return ArrayHelper.join(
superEntityBinding.getNonIdAttributeBindingClosure(),
internalGetNonIdAttributeBindingClosure()
);
}
}
}
private AttributeBinding[] internalGetNonIdAttributeBindingClosure() {
List<AttributeBinding> list = new ArrayList<AttributeBinding>();
for ( final AttributeBinding ab : attributeBindings() ) {
boolean isId = getHierarchyDetails().getEntityIdentifier().isIdentifierAttributeBinding( ab );
if ( !isId ) {
list.add( ab );
@ -739,13 +747,26 @@ public class EntityBinding extends AbstractAttributeBindingContainer implements
results = ArrayHelper.join(
results,
subEntityBinding.getNonIdAttributeBindingClosure()
subEntityBinding.attributeBindingMapInternal().values().toArray( new AttributeBinding[subEntityBinding.attributeBindingMapInternal().size()] )
);
// TODO: if EntityBinding.attributeBindings() excludes joined attributes, then they need to be added here
}
return results;
}
public AttributeBinding[] getNonIdEntitiesAttributeBindingClosure() {
AttributeBinding[] results = getNonIdAttributeBindingClosure();
for ( EntityBinding subEntityBinding : getPreOrderSubEntityBindingClosure() ) {
// only add attribute bindings declared for the subEntityBinding
results = ArrayHelper.join(
results,
subEntityBinding.internalGetNonIdAttributeBindingClosure()
);
// TODO: if EntityBinding.attributeBindings() excludes joined attributes, then they need to be added here
}
return results;
}
public boolean isClassOrSuperclassSecondaryTable(SecondaryTable secondaryTable) {
String secondaryTableName = secondaryTable.getSecondaryTableReference().getLogicalName().getText();

View File

@ -140,19 +140,17 @@ public class EntityIdentifier {
public Class getIdClassClass() {
ensureBound();
if ( ! isNonAggregatedComposite() ) {
throw new UnsupportedOperationException(
String.format(
"Entity identifiers of nature %s does not support idClasses.",
entityIdentifierBinding.getNature()
)
);
}
ensureNonAggregatedComposite();
return ( (NonAggregatedCompositeIdentifierBindingImpl) entityIdentifierBinding ).getIdClassClass();
}
public String getIdClassPropertyAccessorName() {
ensureBound();
ensureNonAggregatedComposite();
return ( (NonAggregatedCompositeIdentifierBindingImpl) entityIdentifierBinding ).getIdClassPropertyAccessorName();
}
private void ensureNonAggregatedComposite() {
if ( ! isNonAggregatedComposite() ) {
throw new UnsupportedOperationException(
String.format(
@ -161,7 +159,6 @@ public class EntityIdentifier {
)
);
}
return ( (NonAggregatedCompositeIdentifierBindingImpl) entityIdentifierBinding ).getIdClassPropertyAccessorName();
}
public boolean isIdentifierMapper() {
@ -409,6 +406,10 @@ public class EntityIdentifier {
return (CompositeAttributeBinding) getAttributeBinding();
}
public boolean isIdentifierAttributeBinding(AttributeBinding attributeBinding) {
if ( !isIdentifierMapper() && getNonAggregatedCompositeAttributeBinding().equals( attributeBinding ) ) {
return true;
}
for ( AttributeBinding idAttributeBindings : getNonAggregatedCompositeAttributeBinding().attributeBindings() ) {
if ( idAttributeBindings.equals( attributeBinding ) ) {
return true;

View File

@ -43,7 +43,7 @@ import org.hibernate.dialect.Dialect;
* @author Gavin King
* @author Steve Ebersole
*/
public class ForeignKey extends AbstractConstraint implements Constraint, Exportable {
public class ForeignKey extends AbstractConstraint {
private static final Logger LOG = Logger.getLogger( ForeignKey.class );
private static final String ON_DELETE = " on delete ";

View File

@ -31,7 +31,7 @@ import org.hibernate.dialect.Dialect;
* @author Gavin King
* @author Steve Ebersole
*/
public class Index extends AbstractConstraint implements Constraint {
public class Index extends AbstractConstraint{
protected Index(Table table, String name) {
super( table, name );
}

View File

@ -34,7 +34,7 @@ import org.hibernate.dialect.Dialect;
* @author Gavin King
* @author Steve Ebersole
*/
public class PrimaryKey extends AbstractConstraint implements Constraint, Exportable {
public class PrimaryKey extends AbstractConstraint {
private static final String GENERATED_NAME_PREFIX = "PK";

View File

@ -31,7 +31,7 @@ import org.hibernate.dialect.Dialect;
* @author Gavin King
* @author Steve Ebersole
*/
public class UniqueKey extends AbstractConstraint implements Constraint {
public class UniqueKey extends AbstractConstraint {
private static final String GENERATED_NAME_PREFIX = "UK";
protected UniqueKey(Table table, String name) {

View File

@ -61,6 +61,8 @@ public interface PluralAttributeSource
public boolean isInverse();
public boolean isMutable();
public String getCustomLoaderName();
public CustomSQL getCustomSqlInsert();

View File

@ -851,10 +851,10 @@ public abstract class AbstractEntityPersister
this.factory = factory;
this.cacheAccessStrategy = cacheAccessStrategy;
this.naturalIdRegionAccessStrategy = naturalIdRegionAccessStrategy;
this.isLazyPropertiesCacheable =
entityBinding.getHierarchyDetails().getCaching() == null ?
false :
entityBinding.getHierarchyDetails().getCaching().isCacheLazyProperties();
this.isLazyPropertiesCacheable = entityBinding.getHierarchyDetails()
.getCaching() == null || entityBinding.getHierarchyDetails()
.getCaching()
.isCacheLazyProperties();
this.entityMetamodel = new EntityMetamodel( entityBinding, factory );
this.entityTuplizer = this.entityMetamodel.getTuplizer();
int batch = entityBinding.getBatchSize();
@ -951,12 +951,7 @@ public abstract class AbstractEntityPersister
int i = 0;
boolean foundFormula = false;
for ( AttributeBinding attributeBinding : entityBinding.getAttributeBindingClosure() ) {
if ( entityBinding.getHierarchyDetails().getEntityIdentifier().isIdentifierAttributeBinding( attributeBinding ) ) {
// entity identifier is not considered a "normal" property
continue;
}
for ( AttributeBinding attributeBinding : entityBinding.getNonIdAttributeBindingClosure() ) {
thisClassProperties.add( attributeBinding );
propertySubclassNames[i] = ( (EntityBinding) attributeBinding.getContainer() ).getEntity().getName();
@ -1054,12 +1049,7 @@ public abstract class AbstractEntityPersister
List<Boolean> columnSelectables = new ArrayList<Boolean>();
List<Boolean> propNullables = new ArrayList<Boolean>();
for ( AttributeBinding attributeBinding : entityBinding.getEntitiesAttributeBindingClosure() ) {
if ( entityBinding.getHierarchyDetails().getEntityIdentifier().isIdentifierAttributeBinding( attributeBinding ) ) {
// entity identifier is not considered a "normal" property
continue;
}
for ( AttributeBinding attributeBinding : entityBinding.getNonIdEntitiesAttributeBindingClosure() ) {
names.add( attributeBinding.getAttribute().getName() );
classes.add( ( (EntityBinding) attributeBinding.getContainer() ).getEntity().getName() );
boolean isDefinedBySubclass = ! thisClassProperties.contains( attributeBinding );
@ -1199,6 +1189,9 @@ public abstract class AbstractEntityPersister
this.cacheEntryHelper = buildCacheEntryHelper();
}
protected static String getTemplateFromString(String string, SessionFactoryImplementor factory) {
return string == null ?
null :
@ -4384,10 +4377,6 @@ public abstract class AbstractEntityPersister
return entityMetamodel.getTuplizer().createProxy( id, session );
}
public String toString() {
return StringHelper.unqualify( getClass().getName() ) +
'(' + entityMetamodel.getName() + ')';
}
public final String selectFragment(
Joinable rhs,
@ -4989,6 +4978,11 @@ public abstract class AbstractEntityPersister
return lazyPropertyColumnAliases;
}
public String toString() {
return StringHelper.unqualify( getClass().getName() ) +
'(' + entityMetamodel.getName() + ')';
}
/**
* Consolidated these onto a single helper because the 2 pieces work in tandem.
*/

View File

@ -25,6 +25,8 @@ package org.hibernate.persister.entity;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
@ -54,7 +56,6 @@ import org.hibernate.mapping.Subclass;
import org.hibernate.mapping.Table;
import org.hibernate.metamodel.spi.binding.AttributeBinding;
import org.hibernate.metamodel.spi.binding.EntityBinding;
import org.hibernate.metamodel.spi.binding.PluralAttributeBinding;
import org.hibernate.metamodel.spi.binding.RelationalValueBinding;
import org.hibernate.metamodel.spi.binding.SecondaryTable;
import org.hibernate.metamodel.spi.binding.SingularAttributeBinding;
@ -62,13 +63,15 @@ import org.hibernate.metamodel.spi.relational.PrimaryKey;
import org.hibernate.metamodel.spi.relational.TableSpecification;
import org.hibernate.sql.CaseFragment;
import org.hibernate.sql.SelectFragment;
import org.hibernate.type.*;
import org.hibernate.type.StandardBasicTypes;
import org.hibernate.type.Type;
/**
* An <tt>EntityPersister</tt> implementing the normalized "table-per-subclass"
* mapping strategy
*
* @author Gavin King
* @author Strong Liu
*/
public class JoinedSubclassEntityPersister extends AbstractEntityPersister {
@ -689,13 +692,13 @@ public class JoinedSubclassEntityPersister extends AbstractEntityPersister {
final TableSpecification[] tables = entityBinding.getTableClosure();
final SecondaryTable[] secondaryTables = entityBinding.getSecondaryTableClosure();
final String[] synchronizedTableNames = entityBinding.getSynchronizedTableNameClosure();
final AttributeBinding[] attributeBindings = entityBinding.getAttributeBindingClosure();
final AttributeBinding[] attributeBindings = entityBinding.getNonIdAttributeBindingClosure();
//todo the count of these two are not equal, which they should be
final EntityBinding[] preOrderSubEntityBindings = entityBinding.getPreOrderSubEntityBindingClosure();
final EntityBinding[] postOrderSubEntityBindings = entityBinding.getPostOrderSubEntityBindingClosure();
final TableSpecification[] subTables = entityBinding.getPreOrderSubTableClosure();
final SecondaryTable[] subSecondaryTables = entityBinding.getSubEntitySecondaryTables();
final AttributeBinding[] allAttributeBindings = entityBinding.getEntitiesAttributeBindingClosure();
final AttributeBinding[] allAttributeBindings = entityBinding.getNonIdEntitiesAttributeBindingClosure();
final int idColumnSpan = getIdentifierColumnSpan();
coreTableSpan = tables.length;
@ -924,11 +927,9 @@ public class JoinedSubclassEntityPersister extends AbstractEntityPersister {
valueBindings = singularAttributeBinding.getRelationalValueBindings();
}
else {
PluralAttributeBinding pluralAttributeBinding = PluralAttributeBinding.class.cast( attributeBinding );
valueBindings = pluralAttributeBinding.getPluralAttributeElementBinding().getRelationalValueBindings();
valueBindings = Collections.EMPTY_LIST;
}
RelationalValueBinding valueBinding = valueBindings.get( 0 );
TableSpecification table = valueBinding.getValue().getTable();
TableSpecification table = attributeBinding.getContainer().seekEntityBinding().getPrimaryTable();// valueBinding.getValue().getTable();
final String tableName = table.getQualifiedName( factory.getDialect() );
if ( i < hydrateSpan ) {
propertyTableNumbers[i] = getTableId( tableName, tableNames );

View File

@ -23,8 +23,10 @@
*
*/
package org.hibernate.persister.entity;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
@ -53,9 +55,9 @@ import org.hibernate.mapping.Subclass;
import org.hibernate.mapping.Table;
import org.hibernate.mapping.Value;
import org.hibernate.metamodel.spi.binding.AttributeBinding;
import org.hibernate.metamodel.spi.binding.CustomSQL;
import org.hibernate.metamodel.spi.binding.EntityBinding;
import org.hibernate.metamodel.spi.binding.EntityDiscriminator;
import org.hibernate.metamodel.spi.binding.EntityIdentifier;
import org.hibernate.metamodel.spi.binding.RelationalValueBinding;
import org.hibernate.metamodel.spi.binding.SecondaryTable;
import org.hibernate.metamodel.spi.binding.SingularAttributeBinding;
@ -648,16 +650,11 @@ public class SingleTableEntityPersister extends AbstractEntityPersister {
}
// PROPERTIES
propertyTableNumbers = new int[ getPropertySpan() ];
int i=0;
for( AttributeBinding attributeBinding : entityBinding.getAttributeBindingClosure() ) {
for( AttributeBinding attributeBinding : entityBinding.getNonIdAttributeBindingClosure() ) {
// TODO: fix when joins are working (HHH-6391)
//propertyTableNumbers[i++] = entityBinding.getJoinNumber( attributeBinding);
if ( entityBinding.getHierarchyDetails().getEntityIdentifier().isIdentifierAttributeBinding( attributeBinding ) ) {
continue; // skip identifier binding
}
final int tableNumber;
if ( attributeBinding.getAttribute().isSingular() ) {
SingularAttributeBinding singularAttributeBinding = (SingularAttributeBinding) attributeBinding;
@ -675,11 +672,7 @@ public class SingleTableEntityPersister extends AbstractEntityPersister {
ArrayList<Integer> formulaJoinedNumbers = new ArrayList<Integer>();
ArrayList<Integer> propertyJoinNumbers = new ArrayList<Integer>();
for ( AttributeBinding attributeBinding : entityBinding.getEntitiesAttributeBindingClosure() ) {
if ( entityBinding.getHierarchyDetails().getEntityIdentifier().isIdentifierAttributeBinding( attributeBinding ) ) {
continue; // skip identifier binding
}
for ( AttributeBinding attributeBinding : entityBinding.getNonIdEntitiesAttributeBindingClosure() ) {
if ( attributeBinding.getAttribute().isSingular() ) {
SingularAttributeBinding singularAttributeBinding = (SingularAttributeBinding) attributeBinding;
int join = entityBinding.getSecondaryTableNumber( singularAttributeBinding );
@ -752,7 +745,6 @@ public class SingleTableEntityPersister extends AbstractEntityPersister {
postConstruct( mapping );
}
protected boolean isInverseTable(int j) {
return isInverseTable[j];
}

View File

@ -27,7 +27,10 @@ import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
import org.jboss.logging.Logger;
import org.hibernate.dialect.Dialect;
import org.hibernate.internal.CoreMessageLogger;
import org.hibernate.type.LiteralType;
/**
@ -39,7 +42,9 @@ public class Insert {
private Dialect dialect;
private String tableName;
private String comment;
private Map columns = new LinkedHashMap();
private Map<String, String> columns = new LinkedHashMap<String, String>();
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class,
Insert.class.getName());
public Insert(Dialect dialect) {
this.dialect = dialect;
@ -59,8 +64,8 @@ public class Insert {
}
public Insert addColumns(String[] columnNames) {
for ( int i=0; i<columnNames.length; i++ ) {
addColumn( columnNames[i] );
for ( String columnName : columnNames ) {
addColumn( columnName );
}
return this;
}
@ -84,7 +89,10 @@ public class Insert {
}
public Insert addColumn(String columnName, String valueExpression) {
columns.put(columnName, valueExpression);
String old = columns.put( columnName, valueExpression );
if ( old != null ) {
LOG.warn( "Duplicated column name " + columnName + " is being added into Insert, this is more likely a hibernate internal issue" );
}
return this;
}
@ -112,12 +120,12 @@ public class Insert {
}
buf.append("insert into ")
.append(tableName);
if ( columns.size()==0 ) {
if ( columns.isEmpty() ) {
buf.append(' ').append( dialect.getNoColumnsInsertString() );
}
else {
buf.append(" (");
Iterator iter = columns.keySet().iterator();
Iterator<String> iter = columns.keySet().iterator();
while ( iter.hasNext() ) {
buf.append( iter.next() );
if ( iter.hasNext() ) {

View File

@ -241,11 +241,7 @@ public abstract class AbstractEntityTuplizer implements EntityTuplizer {
boolean foundCustomAccessor = false;
int i = 0;
for ( AttributeBinding property : mappingInfo.getAttributeBindingClosure() ) {
if ( mappingInfo.getHierarchyDetails().getEntityIdentifier().isIdentifierAttributeBinding( property ) ) {
continue; // ID binding processed above
}
for ( AttributeBinding property : mappingInfo.getNonIdAttributeBindingClosure() ) {
//TODO: redesign how PropertyAccessors are acquired...
getters[ i ] = buildPropertyGetter( property );
setters[ i ] = buildPropertySetter( property );

View File

@ -398,22 +398,7 @@ public class EntityMetamodel implements Serializable {
boolean hasLazy = false;
// TODO: Fix after HHH-6337 is fixed; for now assume entityBinding is the root binding
final EntityIdentifier rootEntityIdentifier = entityBinding.getHierarchyDetails().getEntityIdentifier();
// entityBinding.getAttributeClosureSpan() includes the identifier binding;
// "properties" here excludes the ID, so subtract 1 if the identifier binding is non-null
int identifierAttributeBindingSpan;
if ( rootEntityIdentifier.getAttributeBinding() == null ) {
identifierAttributeBindingSpan = 0;
}
else if ( rootEntityIdentifier.isNonAggregatedComposite() ) {
identifierAttributeBindingSpan =
( (CompositeAttributeBinding) rootEntityIdentifier.getAttributeBinding() ).attributeBindingSpan();
}
else {
identifierAttributeBindingSpan = 1;
}
final AttributeBinding [] attributeBindings = entityBinding.getAttributeBindingClosure();
final AttributeBinding [] attributeBindings = entityBinding.getNonIdAttributeBindingClosure();
propertySpan = attributeBindings.length;
properties = new StandardProperty[propertySpan];
@ -445,11 +430,6 @@ public class EntityMetamodel implements Serializable {
boolean foundUpdateableNaturalIdProperty = false;
for ( AttributeBinding attributeBinding : attributeBindings ) {
if ( entityBinding.getHierarchyDetails().getEntityIdentifier().isIdentifierAttributeBinding( attributeBinding ) ) {
// skip the identifier attribute binding
continue;
}
if ( attributeBinding == entityBinding.getHierarchyDetails().getEntityVersion().getVersioningAttributeBinding() ) {
tempVersionProperty = i;
properties[i] = PropertyFactory.buildVersionProperty(

View File

@ -135,22 +135,22 @@ public class InheritanceBindingTest extends BaseAnnotationBindingTestCase {
noInheritanceEntityBinding.getHierarchyDetails().getEntityIdentifier().getAttributeBinding(),
directAttributeBindings.iterator().next()
);
assertEquals( 0, noInheritanceEntityBinding.getAttributeBindingClosureSpan() );
assertEquals( 1, noInheritanceEntityBinding.getAttributeBindingClosureSpan() );
Iterator<AttributeBinding> iterator = noInheritanceEntityBinding.attributeBindings().iterator();
assertTrue( iterator.hasNext() );
assertSame( noInheritanceEntityBinding.getHierarchyDetails().getEntityIdentifier().getAttributeBinding(), iterator.next() );
assertFalse( iterator.hasNext() );
AttributeBinding[] attributeBindings = noInheritanceEntityBinding.getAttributeBindingClosure();
assertTrue( attributeBindings.length == 0 );
// int index =0;
// assertSame( noInheritanceEntityBinding.getHierarchyDetails().getEntityIdentifier().getAttributeBinding(), attributeBindings[index++] );
// assertFalse( index < attributeBindings.length );
assertTrue( attributeBindings.length > 0 );
int index =0;
assertSame( noInheritanceEntityBinding.getHierarchyDetails().getEntityIdentifier().getAttributeBinding(), attributeBindings[index++] );
assertFalse( index < attributeBindings.length );
attributeBindings = noInheritanceEntityBinding.getEntitiesAttributeBindingClosure();
// int index = 0;
assertFalse( attributeBindings.length > 0 );
// assertSame( noInheritanceEntityBinding.getHierarchyDetails().getEntityIdentifier().getAttributeBinding(), attributeBindings[index++] );
// assertFalse( index < attributeBindings.length );
index = 0;
assertTrue( attributeBindings.length > 0 );
assertSame( noInheritanceEntityBinding.getHierarchyDetails().getEntityIdentifier().getAttributeBinding(), attributeBindings[index++] );
assertFalse( index < attributeBindings.length );
}
@Test
@ -193,19 +193,19 @@ public class InheritanceBindingTest extends BaseAnnotationBindingTestCase {
}
assertEquals( 1, directAttributeBindings.size() );
assertTrue( directAttributeBindings.contains( rootEntityBinding.locateAttributeBinding( "id" ) ) );
assertEquals( 0, rootEntityBinding.getAttributeBindingClosureSpan() );
assertEquals( 1, rootEntityBinding.getAttributeBindingClosureSpan() );
Set<AttributeBinding> attributeBindingClosure = new HashSet<AttributeBinding>();
for ( AttributeBinding attributeBinding : rootEntityBinding.getAttributeBindingClosure() ) {
assertTrue( attributeBindingClosure.add( attributeBinding ) );
}
assertEquals( 0, attributeBindingClosure.size() );
assertFalse( attributeBindingClosure.contains( rootEntityBinding.locateAttributeBinding( "id" ) ) );
assertEquals( 1, attributeBindingClosure.size() );
assertTrue( attributeBindingClosure.contains( rootEntityBinding.locateAttributeBinding( "id" ) ) );
Set<AttributeBinding> subAttributeBindings = new HashSet<AttributeBinding>();
for ( AttributeBinding subAttributeBinding : rootEntityBinding.getEntitiesAttributeBindingClosure() ) {
assertTrue( subAttributeBindings.add( subAttributeBinding ) );
}
assertEquals( 3, subAttributeBindings.size() );
assertFalse( subAttributeBindings.contains( rootEntityBinding.locateAttributeBinding( "id" ) ) );
assertEquals( 4, subAttributeBindings.size() );
assertTrue( subAttributeBindings.contains( rootEntityBinding.locateAttributeBinding( "id" ) ) );
assertTrue( subAttributeBindings.contains( subclassEntityBinding.locateAttributeBinding( "name" ) ) );
assertTrue( subAttributeBindings.contains( subclassOfSubclassEntityBinding.locateAttributeBinding( "otherOtherName" ) ) );
assertTrue( subAttributeBindings.contains( otherSubclassEntityBinding.locateAttributeBinding( "otherName" ) ) );
@ -310,20 +310,20 @@ public class InheritanceBindingTest extends BaseAnnotationBindingTestCase {
}
assertEquals( 1, directAttributeBindings.size() );
assertTrue( directAttributeBindings.contains( otherSubclassEntityBinding.locateAttributeBinding( "otherName" ) ) );
assertEquals( 1, otherSubclassEntityBinding.getAttributeBindingClosureSpan() );
assertEquals( 2, otherSubclassEntityBinding.getAttributeBindingClosureSpan() );
Set<AttributeBinding> attributeBindingClosure = new HashSet<AttributeBinding>();
for ( AttributeBinding attributeBinding : otherSubclassEntityBinding.getAttributeBindingClosure() ) {
assertTrue( attributeBindingClosure.add( attributeBinding ) );
}
assertEquals(1, attributeBindingClosure.size() );
assertFalse( attributeBindingClosure.contains( rootEntityBinding.locateAttributeBinding( "id" ) ) );
assertEquals(2, attributeBindingClosure.size() );
assertTrue( attributeBindingClosure.contains( rootEntityBinding.locateAttributeBinding( "id" ) ) );
assertTrue( attributeBindingClosure.contains( otherSubclassEntityBinding.locateAttributeBinding( "otherName" ) ) );
Set<AttributeBinding> subAttributeBindings = new HashSet<AttributeBinding>();
for ( AttributeBinding subAttributeBinding : otherSubclassEntityBinding.getEntitiesAttributeBindingClosure() ) {
assertTrue( subAttributeBindings.add( subAttributeBinding ) );
}
assertEquals( 1, subAttributeBindings.size() );
assertFalse( subAttributeBindings.contains( rootEntityBinding.locateAttributeBinding( "id" ) ) );
assertEquals( 2, subAttributeBindings.size() );
assertTrue( subAttributeBindings.contains( rootEntityBinding.locateAttributeBinding( "id" ) ) );
assertTrue( subAttributeBindings.contains( otherSubclassEntityBinding.locateAttributeBinding( "otherName" ) ) );
}
@ -364,20 +364,20 @@ public class InheritanceBindingTest extends BaseAnnotationBindingTestCase {
}
assertEquals( 1, directAttributeBindings.size() );
assertTrue( directAttributeBindings.contains( subclassEntityBinding.locateAttributeBinding( "name" ) ) );
assertEquals( 1, subclassEntityBinding.getAttributeBindingClosureSpan() );
assertEquals( 2, subclassEntityBinding.getAttributeBindingClosureSpan() );
Set<AttributeBinding> attributeBindingClosure = new HashSet<AttributeBinding>();
for ( AttributeBinding attributeBinding : subclassEntityBinding.getAttributeBindingClosure() ) {
assertTrue( attributeBindingClosure.add( attributeBinding ) );
}
assertEquals( 1, attributeBindingClosure.size() );
assertFalse( attributeBindingClosure.contains( rootEntityBinding.locateAttributeBinding( "id" ) ) );
assertEquals( 2, attributeBindingClosure.size() );
assertTrue( attributeBindingClosure.contains( rootEntityBinding.locateAttributeBinding( "id" ) ) );
assertTrue( attributeBindingClosure.contains( subclassEntityBinding.locateAttributeBinding( "name" ) ) );
Set<AttributeBinding> subAttributeBindings = new HashSet<AttributeBinding>();
for ( AttributeBinding subAttributeBinding : subclassEntityBinding.getEntitiesAttributeBindingClosure() ) {
assertTrue( subAttributeBindings.add( subAttributeBinding ) );
}
assertEquals( 2, subAttributeBindings.size() );
assertFalse( subAttributeBindings.contains( rootEntityBinding.locateAttributeBinding( "id" ) ) );
assertEquals( 3, subAttributeBindings.size() );
assertTrue( subAttributeBindings.contains( rootEntityBinding.locateAttributeBinding( "id" ) ) );
assertTrue( subAttributeBindings.contains( subclassEntityBinding.locateAttributeBinding( "name" ) ) );
assertTrue( subAttributeBindings.contains( subclassOfSubclassEntityBinding.locateAttributeBinding( "otherOtherName" ) ) );
}
@ -411,21 +411,21 @@ public class InheritanceBindingTest extends BaseAnnotationBindingTestCase {
}
assertEquals( 1, directAttributeBindings.size() );
assertTrue( directAttributeBindings.contains( subclassOfSubclassEntityBinding.locateAttributeBinding( "otherOtherName" ) ) );
assertEquals( 2, subclassOfSubclassEntityBinding.getAttributeBindingClosureSpan() );
assertEquals( 3, subclassOfSubclassEntityBinding.getAttributeBindingClosureSpan() );
Set<AttributeBinding> attributeBindingClosure = new HashSet<AttributeBinding>();
for ( AttributeBinding attributeBinding : subclassOfSubclassEntityBinding.getAttributeBindingClosure() ) {
assertTrue( attributeBindingClosure.add( attributeBinding ) );
}
assertEquals( 2, attributeBindingClosure.size() );
assertFalse( attributeBindingClosure.contains( rootEntityBinding.locateAttributeBinding( "id" ) ) );
assertEquals( 3, attributeBindingClosure.size() );
assertTrue( attributeBindingClosure.contains( rootEntityBinding.locateAttributeBinding( "id" ) ) );
assertTrue( attributeBindingClosure.contains( subclassEntityBinding.locateAttributeBinding( "name" ) ) );
assertTrue( attributeBindingClosure.contains( subclassOfSubclassEntityBinding.locateAttributeBinding( "otherOtherName" ) ) );
Set<AttributeBinding> subAttributeBindings = new HashSet<AttributeBinding>();
for ( AttributeBinding subAttributeBinding : subclassOfSubclassEntityBinding.getEntitiesAttributeBindingClosure() ) {
assertTrue( subAttributeBindings.add( subAttributeBinding ) );
}
assertEquals( 2, subAttributeBindings.size() );
assertFalse( subAttributeBindings.contains( rootEntityBinding.locateAttributeBinding( "id" ) ) );
assertEquals( 3, subAttributeBindings.size() );
assertTrue( subAttributeBindings.contains( rootEntityBinding.locateAttributeBinding( "id" ) ) );
assertTrue( subAttributeBindings.contains( subclassEntityBinding.locateAttributeBinding( "name" ) ) );
assertTrue( subAttributeBindings.contains( subclassOfSubclassEntityBinding.locateAttributeBinding( "otherOtherName" ) ) );
}
@ -455,23 +455,23 @@ public class InheritanceBindingTest extends BaseAnnotationBindingTestCase {
assertEquals( "base", rootEntityBinding.getDiscriminatorMatchValue() );
}
@Test
@Resources(annotatedClasses = { Fruit.class, Apple.class })
public void testDiscriminatorFormula() {
EntityBinding rootEntityBinding = getEntityBinding( Fruit.class );
assertTrue( rootEntityBinding.isRoot() );
EntityBinding entityBinding = getEntityBinding( Apple.class );
assertFalse( entityBinding.isRoot() );
@Test
@Resources(annotatedClasses = { Fruit.class, Apple.class })
public void testDiscriminatorFormula() {
EntityBinding rootEntityBinding = getEntityBinding( Fruit.class );
assertTrue( rootEntityBinding.isRoot() );
EntityBinding entityBinding = getEntityBinding( Apple.class );
assertFalse( entityBinding.isRoot() );
EntityDiscriminator discriminator = rootEntityBinding.getHierarchyDetails().getEntityDiscriminator();
Value simpleValue = discriminator.getRelationalValue();
assertTrue( simpleValue instanceof DerivedValue);
DerivedValue derivedValue = (DerivedValue)simpleValue;
assertEquals( "case when zik_type is null then 0 else zik_type end", derivedValue.getExpression() );
Value simpleValue = discriminator.getRelationalValue();
assertTrue( simpleValue instanceof DerivedValue);
DerivedValue derivedValue = (DerivedValue)simpleValue;
assertEquals( "case when zik_type is null then 0 else zik_type end", derivedValue.getExpression() );
assertTrue( "Wrong default value", discriminator.isForced() );
assertFalse( "Wrong default value", discriminator.isInserted() );
}
}
@Entity
@Entity
class SingleEntity {
@Id
@GeneratedValue
@ -516,19 +516,19 @@ public class InheritanceBindingTest extends BaseAnnotationBindingTestCase {
class Jump extends Base {
}
@Entity
@DiscriminatorColumn(discriminatorType = DiscriminatorType.INTEGER)
@DiscriminatorFormula("case when zik_type is null then 0 else zik_type end")
@DiscriminatorOptions(force = true, insert = false)
class Fruit {
@Id
private int id;
}
@Entity
@DiscriminatorColumn(discriminatorType = DiscriminatorType.INTEGER)
@DiscriminatorFormula("case when zik_type is null then 0 else zik_type end")
@DiscriminatorOptions(force = true, insert = false)
class Fruit {
@Id
private int id;
}
@Entity
class Apple extends Fruit {
@Entity
class Apple extends Fruit {
}
}
}

View File

@ -40,9 +40,10 @@ import static org.junit.Assert.assertTrue;
/**
* @author Emmanuel Bernard
*/
public class DerivedIdentitySimpleParentIdClassDepTest extends BaseCoreFunctionalTestCase {
@FailureExpectedWithNewMetamodel
@Test
@FailureExpectedWithNewMetamodel
public void testManyToOne() throws Exception {
assertTrue( SchemaUtil.isColumnPresent( "Dependent", "emp_empId", metadata() ) );
assertTrue( ! SchemaUtil.isColumnPresent( "Dependent", "emp", metadata() ) );

View File

@ -34,7 +34,6 @@ import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.cfg.Configuration;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.ServiceRegistryBuilder;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
@ -84,7 +83,6 @@ public class ImmutableTest extends BaseCoreFunctionalTestCase {
}
@Test
@FailureExpectedWithNewMetamodel
public void testImmutableCollection() {
Country country = new Country();
country.setName("Germany");

View File

@ -82,7 +82,6 @@ import static org.junit.Assert.fail;
* @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com)
*/
@RequiresDialectFeature(DialectChecks.SupportsSequences.class)
@FailureExpectedWithNewMetamodel
public class CriteriaQueryTest extends BaseCoreFunctionalTestCase {
@Override
public String[] getMappings() {
@ -1733,6 +1732,7 @@ public class CriteriaQueryTest extends BaseCoreFunctionalTestCase {
}
@Test
@FailureExpectedWithNewMetamodel
public void testCriteriaCollectionOfValue() {
Session session = openSession();
Transaction t = session.beginTransaction();

View File

@ -47,7 +47,7 @@ import static org.junit.Assert.assertTrue;
*
* @author Gail Badner
*/
@FailureExpectedWithNewMetamodel
//@FailureExpectedWithNewMetamodel
public class ASTParserLoadingOrderByTest extends BaseCoreFunctionalTestCase {
StateProvince stateProvince;
private Zoo zoo1;
@ -205,6 +205,7 @@ public class ASTParserLoadingOrderByTest extends BaseCoreFunctionalTestCase {
}
@Test
@FailureExpectedWithNewMetamodel
public void testOrderByNoSelectAliasRef() {
createData();
@ -346,6 +347,7 @@ public class ASTParserLoadingOrderByTest extends BaseCoreFunctionalTestCase {
}
@Test
@FailureExpectedWithNewMetamodel
public void testOrderBySelectAliasRef() {
createData();
@ -523,6 +525,7 @@ public class ASTParserLoadingOrderByTest extends BaseCoreFunctionalTestCase {
}
@Test
@FailureExpectedWithNewMetamodel
public void testOrderByEntityWithFetchJoinedCollection() {
createData();
@ -544,6 +547,7 @@ public class ASTParserLoadingOrderByTest extends BaseCoreFunctionalTestCase {
}
@Test
@FailureExpectedWithNewMetamodel
public void testOrderBySelectNewArgAliasRef() {
createData();
@ -588,6 +592,7 @@ public class ASTParserLoadingOrderByTest extends BaseCoreFunctionalTestCase {
}
@Test(timeout = 5 * 60 * 1000)
@FailureExpectedWithNewMetamodel
public void testOrderBySelectNewMapArgAliasRef() {
createData();
@ -638,6 +643,7 @@ public class ASTParserLoadingOrderByTest extends BaseCoreFunctionalTestCase {
}
@Test
@FailureExpectedWithNewMetamodel
public void testOrderByAggregatedArgAliasRef() {
createData();

View File

@ -56,7 +56,7 @@ import static org.junit.Assert.fail;
*
* @author Max Rydahl Andersen
*/
@FailureExpectedWithNewMetamodel
//@FailureExpectedWithNewMetamodel
public class CriteriaHQLAlignmentTest extends QueryTranslatorTestCase {
private boolean initialVersion2SqlFlagValue;
@ -161,6 +161,7 @@ public class CriteriaHQLAlignmentTest extends QueryTranslatorTestCase {
@Test
@TestForIssue( jiraKey = "HHH-1724" )
@FailureExpectedWithNewMetamodel
public void testCriteriaAggregationReturnType() {
Session s = openSession();
s.beginTransaction();
@ -222,6 +223,7 @@ public class CriteriaHQLAlignmentTest extends QueryTranslatorTestCase {
}
@Test
@FailureExpectedWithNewMetamodel
public void testCountReturnValues() {
Session s = openSession();
Transaction t = s.beginTransaction();

View File

@ -50,7 +50,6 @@ import static org.junit.Assert.fail;
*
* @author Steve Ebersole
*/
@FailureExpectedWithNewMetamodel
public class ScrollableCollectionFetchingTest extends BaseCoreFunctionalTestCase {
@Override
public String[] getMappings() {
@ -148,6 +147,7 @@ public class ScrollableCollectionFetchingTest extends BaseCoreFunctionalTestCase
comment = "As of verion 8.4.1 CUBRID doesn't support temporary tables. This test fails with" +
"HibernateException: cannot doAfterTransactionCompletion multi-table deletes using dialect not supporting temp tables"
)
@FailureExpectedWithNewMetamodel
public void testScrollingJoinFetchesSingleRowResultSet() {
Session s = openSession();
Transaction txn = s.beginTransaction();
@ -274,6 +274,7 @@ public class ScrollableCollectionFetchingTest extends BaseCoreFunctionalTestCase
value = DialectChecks.SupportsResultSetPositioningOnForwardOnlyCursorCheck.class,
comment = "Driver does not support result set positioning methods on forward-only cursors"
)
@FailureExpectedWithNewMetamodel
public void testScrollingJoinFetchesForward() {
TestData data = new TestData();
data.prepare();
@ -306,6 +307,7 @@ public class ScrollableCollectionFetchingTest extends BaseCoreFunctionalTestCase
comment = "As of verion 8.4.1 CUBRID doesn't support temporary tables. This test fails with" +
"HibernateException: cannot doAfterTransactionCompletion multi-table deletes using dialect not supporting temp tables"
)
@FailureExpectedWithNewMetamodel
public void testScrollingJoinFetchesReverse() {
TestData data = new TestData();
data.prepare();
@ -340,6 +342,7 @@ public class ScrollableCollectionFetchingTest extends BaseCoreFunctionalTestCase
comment = "As of verion 8.4.1 CUBRID doesn't support temporary tables. This test fails with" +
"HibernateException: cannot doAfterTransactionCompletion multi-table deletes using dialect not supporting temp tables"
)
@FailureExpectedWithNewMetamodel
public void testScrollingJoinFetchesPositioning() {
TestData data = new TestData();
data.prepare();

View File

@ -42,7 +42,7 @@ import static org.junit.Assert.fail;
*
* @author Steve Ebersole
*/
@FailureExpectedWithNewMetamodel
//@FailureExpectedWithNewMetamodel
public class WithClauseTest extends BaseCoreFunctionalTestCase {
@Override
public String[] getMappings() {
@ -50,6 +50,7 @@ public class WithClauseTest extends BaseCoreFunctionalTestCase {
}
@Test
@FailureExpectedWithNewMetamodel
public void testWithClauseFailsWithFetch() {
TestData data = new TestData();
data.prepare();
@ -113,6 +114,7 @@ public class WithClauseTest extends BaseCoreFunctionalTestCase {
}
@Test
@FailureExpectedWithNewMetamodel
public void testWithClause() {
TestData data = new TestData();
data.prepare();

View File

@ -35,7 +35,6 @@ import org.hibernate.cfg.Environment;
import org.hibernate.criterion.Projections;
import org.hibernate.dialect.Oracle8iDialect;
import org.hibernate.proxy.HibernateProxy;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import org.hibernate.type.AbstractSingleColumnStandardBasicType;
import org.hibernate.type.TextType;
@ -852,7 +851,6 @@ public class ImmutableTest extends BaseCoreFunctionalTestCase {
}
@Test
@FailureExpectedWithNewMetamodel
public void testImmutableCollectionWithUpdate() {
clearCounts();
@ -1074,7 +1072,6 @@ public class ImmutableTest extends BaseCoreFunctionalTestCase {
}
@Test
@FailureExpectedWithNewMetamodel
public void testImmutableCollectionWithMerge() {
clearCounts();

View File

@ -31,7 +31,6 @@ import org.hibernate.Session;
import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.Environment;
import org.hibernate.criterion.Restrictions;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import org.junit.Test;
@ -51,7 +50,6 @@ public class KeyManyToOneTest extends BaseCoreFunctionalTestCase {
}
@Test
@FailureExpectedWithNewMetamodel
public void testCriteriaRestrictionOnKeyManyToOne() {
Session s = openSession();
s.beginTransaction();

View File

@ -28,7 +28,6 @@ import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
@FailureExpectedWithNewMetamodel
public class MultiTableTest extends LegacyTestCase {
@Override
protected boolean isCleanupTestDataRequired() {
@ -59,6 +58,7 @@ public class MultiTableTest extends LegacyTestCase {
}
@Test
@FailureExpectedWithNewMetamodel
public void testFetchOneToMany() throws Exception {
Session s = openSession();
s.beginTransaction();
@ -69,6 +69,7 @@ public class MultiTableTest extends LegacyTestCase {
}
@Test
@FailureExpectedWithNewMetamodel
public void testNarrow() throws Exception {
Session s = openSession();
s.beginTransaction();
@ -80,6 +81,7 @@ public class MultiTableTest extends LegacyTestCase {
}
@Test
@FailureExpectedWithNewMetamodel
public void testJoins() throws Exception {
Session s = openSession();
s.beginTransaction();
@ -103,6 +105,7 @@ public class MultiTableTest extends LegacyTestCase {
}
@Test
@FailureExpectedWithNewMetamodel
public void testSubclassCollection() throws Exception {
//if ( getDialect() instanceof HSQLDialect ) return; //TODO: figure out why!?
Session s = openSession();
@ -194,6 +197,7 @@ public class MultiTableTest extends LegacyTestCase {
}
@Test
@FailureExpectedWithNewMetamodel
public void testQueries() throws Exception {
Session s = openSession();
s.beginTransaction();
@ -220,6 +224,7 @@ public class MultiTableTest extends LegacyTestCase {
}
@Test
@FailureExpectedWithNewMetamodel
public void testConstraints() throws Exception {
Session s = openSession();
Transaction t = s.beginTransaction();
@ -239,6 +244,7 @@ public class MultiTableTest extends LegacyTestCase {
}
@Test
@FailureExpectedWithNewMetamodel
public void testMultiTable() throws Exception {
Session s = openSession();
Transaction t = s.beginTransaction();
@ -377,6 +383,7 @@ public class MultiTableTest extends LegacyTestCase {
}
@Test
@FailureExpectedWithNewMetamodel
public void testMultiTableGeneratedId() throws Exception {
Session s = openSession();
Transaction t = s.beginTransaction();
@ -495,6 +502,7 @@ public class MultiTableTest extends LegacyTestCase {
}
@Test
@FailureExpectedWithNewMetamodel
public void testMultiTableCollections() throws Exception {
Session s = openSession();
Transaction t = s.beginTransaction();
@ -543,6 +551,7 @@ public class MultiTableTest extends LegacyTestCase {
}
@Test
@FailureExpectedWithNewMetamodel
public void testMultiTableManyToOne() throws Exception {
Session s = openSession();
Transaction t = s.beginTransaction();
@ -576,6 +585,7 @@ public class MultiTableTest extends LegacyTestCase {
}
@Test
@FailureExpectedWithNewMetamodel
public void testMultiTableNativeId() throws Exception {
Session s = openSession();
Transaction t = s.beginTransaction();
@ -589,6 +599,7 @@ public class MultiTableTest extends LegacyTestCase {
}
@Test
@FailureExpectedWithNewMetamodel
public void testCollection() throws Exception {
Session s = openSession();
Transaction t = s.beginTransaction();

View File

@ -51,7 +51,6 @@ import org.hibernate.dialect.SybaseAnywhereDialect;
import org.hibernate.dialect.SybaseDialect;
import org.hibernate.dialect.TimesTenDialect;
import org.hibernate.dialect.function.SQLFunction;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
@ -59,7 +58,6 @@ import static org.junit.Assert.assertTrue;
@SuppressWarnings( {"UnnecessaryUnboxing", "UnnecessaryBoxing"})
//@FailureExpectedWithNewMetamodel
public class SQLFunctionsTest extends LegacyTestCase {
private static final Logger log = Logger.getLogger( SQLFunctionsTest.class );
@ -217,7 +215,6 @@ public class SQLFunctionsTest extends LegacyTestCase {
}
@Test
@FailureExpectedWithNewMetamodel
public void testBroken() throws Exception {
Session s = openSession();
Transaction t = s.beginTransaction();

View File

@ -49,7 +49,6 @@ import static org.junit.Assert.assertTrue;
/**
* @author Gavin King
*/
@FailureExpectedWithNewMetamodel
public class OneToOneFormulaTest extends BaseCoreFunctionalTestCase {
private static class TextAsMaterializedClobType extends AbstractSingleColumnStandardBasicType<String> {
public final static TextAsMaterializedClobType INSTANCE = new TextAsMaterializedClobType();
@ -77,6 +76,7 @@ public class OneToOneFormulaTest extends BaseCoreFunctionalTestCase {
}
@Test
@FailureExpectedWithNewMetamodel
public void testOneToOneFormula() {
Person p = new Person();
p.setName("Gavin King");

View File

@ -28,7 +28,6 @@ import org.junit.Test;
import org.hibernate.Session;
import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.Environment;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertNull;
@ -36,7 +35,6 @@ import static org.junit.Assert.assertNull;
/**
* @author Gavin King
*/
@FailureExpectedWithNewMetamodel
public class OptionalOneToOneTest extends BaseCoreFunctionalTestCase {
@Override
public String[] getMappings() {