FailureExpectedWithNewMetamodel cleanup
This commit is contained in:
parent
8ed0bbcd52
commit
1dd12ec9e9
|
@ -1074,7 +1074,15 @@ public class Binder {
|
|||
}
|
||||
// If any entity hierarchies cannot be resolved, then throw exception.
|
||||
if ( ! unresolvedEntityHierarchies.isEmpty() ) {
|
||||
throw new IllegalStateException( "could not resolve all EntityHierarchies." );
|
||||
StringBuilder buffer = new StringBuilder();
|
||||
String sep = "";
|
||||
for ( EntityHierarchySource unresolved : unresolvedEntityHierarchies ) {
|
||||
buffer.append( sep ).append( unresolved.getRoot().getEntityName() );
|
||||
sep = ", ";
|
||||
}
|
||||
throw new IllegalStateException(
|
||||
"Could not resolve all EntityHierarchies; remaining = {" + buffer.toString() + "}"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -568,6 +568,10 @@ public final class PropertyFactory {
|
|||
|
||||
final Type type = property.getHibernateTypeDescriptor().getResolvedTypeMapping();
|
||||
|
||||
if ( type == null ) {
|
||||
throw new HibernateException( "Unable to determine attribute type : " + property.getAttributeRole().getFullPath() );
|
||||
}
|
||||
|
||||
// we need to dirty check collections, since they can cause an owner
|
||||
// version number increment
|
||||
|
||||
|
|
|
@ -47,8 +47,10 @@ import static org.junit.Assert.assertNotNull;
|
|||
* @author Emmanuel Bernard
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel(
|
||||
message = "Problem processing one of the composite ids, but as there are sooooooooooo many its " +
|
||||
"hard to tell which specifically causes the problem"
|
||||
message = "Part of the problem is how some of the composite ids are defined. For example, " +
|
||||
"quite a few map a logical `@Id @ManyToOne` combo without the @ManyToOne. Fixing those " +
|
||||
"leads to an not being able to bind the org.hibernate.test.annotations.cid.A entity; it " +
|
||||
"has composite id made up of 2 @OneToOnes (need to research that, why not @ManyToOne?)."
|
||||
)
|
||||
public class CompositeIdTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
|
|
|
@ -2,6 +2,7 @@ package org.hibernate.test.annotations.cid;
|
|||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.IdClass;
|
||||
import javax.persistence.ManyToOne;
|
||||
|
||||
/**
|
||||
* @author Emmanuel Bernard
|
||||
|
@ -10,7 +11,9 @@ import javax.persistence.IdClass;
|
|||
@IdClass(OrderLinePk.class)
|
||||
public class OrderLine {
|
||||
@Id
|
||||
@ManyToOne
|
||||
public Order order;
|
||||
@Id
|
||||
@ManyToOne
|
||||
public Product product;
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ import javax.persistence.Entity;
|
|||
import javax.persistence.Id;
|
||||
import javax.persistence.IdClass;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.PrimaryKeyJoinColumn;
|
||||
import javax.persistence.SecondaryTable;
|
||||
import javax.persistence.Temporal;
|
||||
|
@ -20,9 +21,11 @@ import javax.persistence.TemporalType;
|
|||
@IdClass( TvMagazinPk.class )
|
||||
public class TvProgramIdClass {
|
||||
@Id
|
||||
@ManyToOne
|
||||
@JoinColumn(nullable=false)
|
||||
public Channel channel;
|
||||
@Id
|
||||
@ManyToOne
|
||||
@JoinColumn(nullable=false)
|
||||
public Presenter presenter;
|
||||
|
||||
|
|
Loading…
Reference in New Issue