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 any entity hierarchies cannot be resolved, then throw exception.
|
||||||
if ( ! unresolvedEntityHierarchies.isEmpty() ) {
|
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();
|
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
|
// we need to dirty check collections, since they can cause an owner
|
||||||
// version number increment
|
// version number increment
|
||||||
|
|
||||||
|
|
|
@ -47,8 +47,10 @@ import static org.junit.Assert.assertNotNull;
|
||||||
* @author Emmanuel Bernard
|
* @author Emmanuel Bernard
|
||||||
*/
|
*/
|
||||||
@FailureExpectedWithNewMetamodel(
|
@FailureExpectedWithNewMetamodel(
|
||||||
message = "Problem processing one of the composite ids, but as there are sooooooooooo many its " +
|
message = "Part of the problem is how some of the composite ids are defined. For example, " +
|
||||||
"hard to tell which specifically causes the problem"
|
"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 {
|
public class CompositeIdTest extends BaseCoreFunctionalTestCase {
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -2,6 +2,7 @@ package org.hibernate.test.annotations.cid;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
import javax.persistence.Id;
|
import javax.persistence.Id;
|
||||||
import javax.persistence.IdClass;
|
import javax.persistence.IdClass;
|
||||||
|
import javax.persistence.ManyToOne;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Emmanuel Bernard
|
* @author Emmanuel Bernard
|
||||||
|
@ -10,7 +11,9 @@ import javax.persistence.IdClass;
|
||||||
@IdClass(OrderLinePk.class)
|
@IdClass(OrderLinePk.class)
|
||||||
public class OrderLine {
|
public class OrderLine {
|
||||||
@Id
|
@Id
|
||||||
|
@ManyToOne
|
||||||
public Order order;
|
public Order order;
|
||||||
@Id
|
@Id
|
||||||
|
@ManyToOne
|
||||||
public Product product;
|
public Product product;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@ import javax.persistence.Entity;
|
||||||
import javax.persistence.Id;
|
import javax.persistence.Id;
|
||||||
import javax.persistence.IdClass;
|
import javax.persistence.IdClass;
|
||||||
import javax.persistence.JoinColumn;
|
import javax.persistence.JoinColumn;
|
||||||
|
import javax.persistence.ManyToOne;
|
||||||
import javax.persistence.PrimaryKeyJoinColumn;
|
import javax.persistence.PrimaryKeyJoinColumn;
|
||||||
import javax.persistence.SecondaryTable;
|
import javax.persistence.SecondaryTable;
|
||||||
import javax.persistence.Temporal;
|
import javax.persistence.Temporal;
|
||||||
|
@ -20,9 +21,11 @@ import javax.persistence.TemporalType;
|
||||||
@IdClass( TvMagazinPk.class )
|
@IdClass( TvMagazinPk.class )
|
||||||
public class TvProgramIdClass {
|
public class TvProgramIdClass {
|
||||||
@Id
|
@Id
|
||||||
|
@ManyToOne
|
||||||
@JoinColumn(nullable=false)
|
@JoinColumn(nullable=false)
|
||||||
public Channel channel;
|
public Channel channel;
|
||||||
@Id
|
@Id
|
||||||
|
@ManyToOne
|
||||||
@JoinColumn(nullable=false)
|
@JoinColumn(nullable=false)
|
||||||
public Presenter presenter;
|
public Presenter presenter;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue