Skip to content

Commit f87596a

Browse files
committed
HHH-7846 : Add messages and throw NotYetImplementedException to help categorize test failures
1 parent 1ca4be9 commit f87596a

File tree

7 files changed

+26
-9
lines changed

7 files changed

+26
-9
lines changed

hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/AbstractEntitySourceImpl.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import java.util.Set;
3131

3232
import org.hibernate.EntityMode;
33+
import org.hibernate.cfg.NotYetImplementedException;
3334
import org.hibernate.internal.util.StringHelper;
3435
import org.hibernate.internal.util.collections.CollectionHelper;
3536
import org.hibernate.jaxb.spi.Origin;
@@ -47,7 +48,6 @@
4748
import org.hibernate.jaxb.spi.hbm.JaxbOneToOneElement;
4849
import org.hibernate.jaxb.spi.hbm.JaxbPropertyElement;
4950
import org.hibernate.jaxb.spi.hbm.JaxbSetElement;
50-
import org.hibernate.jaxb.spi.hbm.JaxbSynchronizeElement;
5151
import org.hibernate.jaxb.spi.hbm.JaxbTuplizerElement;
5252
import org.hibernate.jaxb.spi.hbm.JoinElementSource;
5353
import org.hibernate.metamodel.spi.binding.CustomSQL;
@@ -280,7 +280,10 @@ protected void processSetAttributes(List<AttributeSource> results,
280280
}
281281
protected void processIdBagAttributes(List<AttributeSource> results,
282282
List<JaxbIdbagElement> propertyElements){
283-
// todo : implement
283+
284+
if ( !propertyElements.isEmpty() ) {
285+
throw new NotYetImplementedException( "<idbag> is not supported yet" );
286+
}
284287
}
285288
protected void processBagAttributes(List<AttributeSource> results,
286289
List<JaxbBagElement> propertyElements) {

hibernate-core/src/main/java/org/hibernate/persister/entity/SingleTableEntityPersister.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import org.hibernate.MappingException;
3535
import org.hibernate.cache.spi.access.EntityRegionAccessStrategy;
3636
import org.hibernate.cache.spi.access.NaturalIdRegionAccessStrategy;
37+
import org.hibernate.cfg.NotYetImplementedException;
3738
import org.hibernate.engine.spi.ExecuteUpdateResultCheckStyle;
3839
import org.hibernate.engine.spi.Mapping;
3940
import org.hibernate.engine.spi.SessionFactoryImplementor;
@@ -622,6 +623,19 @@ else if ( entityBinding.isDiscriminatorMatchValueNotNull() ) {
622623
continue; // skip identifier binding
623624
}
624625
propertyTableNumbers[ i++ ] = 0;
626+
627+
if ( attributeBinding.getAttribute().isSingular() ) {
628+
SingularAttributeBinding singularAttributeBinding = (SingularAttributeBinding) attributeBinding;
629+
for ( RelationalValueBinding relationalValueBinding : singularAttributeBinding.getRelationalValueBindings() ) {
630+
if ( ! relationalValueBinding.isDerived() ) {
631+
org.hibernate.metamodel.spi.relational.Column column =
632+
(org.hibernate.metamodel.spi.relational.Column) relationalValueBinding.getValue();
633+
if ( ! entityBinding.getPrimaryTable().equals( column.getTable() ) ) {
634+
throw new NotYetImplementedException( "joined attributes are not supported yet." );
635+
}
636+
}
637+
}
638+
}
625639
}
626640

627641
//TODO: code duplication with JoinedSubclassEntityPersister

hibernate-core/src/test/java/org/hibernate/test/collection/idbag/PersistentIdBagTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@
3939
*
4040
* @author Steve Ebersole
4141
*/
42+
@FailureExpectedWithNewMetamodel( message = "<idbag> not supported" )
4243
public class PersistentIdBagTest extends BaseCoreFunctionalTestCase {
4344
@Override
4445
public String[] getMappings() {
4546
return new String[] { "collection/idbag/Mappings.hbm.xml" };
4647
}
4748

4849
@Test
49-
@FailureExpectedWithNewMetamodel
5050
public void testWriteMethodDirtying() {
5151
IdbagOwner parent = new IdbagOwner( "root" );
5252
IdbagOwner child = new IdbagOwner( "c1" );

hibernate-core/src/test/java/org/hibernate/test/idbag/IdBagTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
/**
4141
* @author Gavin King
4242
*/
43+
@FailureExpectedWithNewMetamodel( message = "<idbag> not supported" )
4344
public class IdBagTest extends BaseCoreFunctionalTestCase {
4445
@Override
4546
public String[] getMappings() {
@@ -86,7 +87,6 @@ public void testUpdateIdBag() throws HibernateException, SQLException {
8687
}
8788

8889
@Test
89-
@FailureExpectedWithNewMetamodel
9090
public void testJoin() throws HibernateException, SQLException {
9191
Session s = openSession();
9292
Transaction t = s.beginTransaction();

hibernate-core/src/test/java/org/hibernate/test/manytomanyassociationclass/compositeid/ManyToManyAssociationClassCompositeIdTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
*
3636
* @author Gail Badner
3737
*/
38-
@FailureExpectedWithNewMetamodel
38+
@FailureExpectedWithNewMetamodel( message = "Bug with qualified entity class not in specified package" )
3939
public class ManyToManyAssociationClassCompositeIdTest extends AbstractManyToManyAssociationClassTest {
4040
@Override
4141
public String[] getMappings() {
@@ -56,5 +56,5 @@ public void deleteMembership(User u, Group g, Membership ug) {
5656
g.getMemberships().remove( ug );
5757
ug.setId(null);
5858
}
59-
60-
}
59+
60+
}

hibernate-core/src/test/java/org/hibernate/test/onetomany/OneToManyTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
/**
3838
* @author Gavin King
3939
*/
40+
@FailureExpectedWithNewMetamodel( message = "Joined attributes are not supported yet" )
4041
public class OneToManyTest extends BaseCoreFunctionalTestCase {
4142
@Override
4243
public String[] getMappings() {
@@ -51,7 +52,6 @@ public String[] getMappings() {
5152
"HibernateException: cannot doAfterTransactionCompletion multi-table deletes using dialect not supporting temp tables"
5253
)
5354

54-
@FailureExpectedWithNewMetamodel
5555
public void testOneToManyLinkTable() {
5656
Session s = openSession();
5757
Transaction t = s.beginTransaction();

hibernate-core/src/test/java/org/hibernate/test/onetoone/link/OneToOneLinkTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@
4242
/**
4343
* @author Gavin King
4444
*/
45+
@FailureExpectedWithNewMetamodel( message = "Joined attributes are not supported yet" )
4546
public class OneToOneLinkTest extends BaseCoreFunctionalTestCase {
4647
@Override
4748
public String[] getMappings() {
4849
return new String[] { "onetoone/link/Person.hbm.xml" };
4950
}
5051

5152
@Test
52-
@FailureExpectedWithNewMetamodel
5353
public void testOneToOneViaAssociationTable() {
5454
Person p = new Person();
5555
p.setName("Gavin King");

0 commit comments

Comments
 (0)