mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-12 06:04:49 +00:00
HHH-8969 corrected test failures
This commit is contained in:
parent
2f636e4a52
commit
993de9060d
@ -24,9 +24,9 @@
|
||||
package org.hibernate.test.annotations.access;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.Transaction;
|
||||
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
@ -39,6 +39,7 @@
|
||||
*/
|
||||
public class AccessTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public void testSuperclassOverriding() throws Exception {
|
||||
Furniture fur = new Furniture();
|
||||
fur.setColor( "Black" );
|
||||
@ -125,6 +126,7 @@ public void testOverridenSubclass() throws Exception {
|
||||
s.close();
|
||||
}
|
||||
@Test
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public void testFieldsOverriding() throws Exception {
|
||||
Gardenshed gs = new Gardenshed();
|
||||
gs.floors = 4;
|
||||
|
@ -1,15 +1,15 @@
|
||||
//$Id$
|
||||
package org.hibernate.test.annotations.access;
|
||||
import javax.persistence.Access;
|
||||
import javax.persistence.AccessType;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Transient;
|
||||
|
||||
import org.hibernate.annotations.AttributeAccessor;
|
||||
|
||||
/**
|
||||
* @author Emmanuel Bernard
|
||||
*/
|
||||
@Entity
|
||||
@AttributeAccessor("property")
|
||||
@Access(AccessType.PROPERTY)
|
||||
public class Bed extends Furniture {
|
||||
String quality;
|
||||
|
||||
|
@ -1,17 +1,17 @@
|
||||
//$Id$
|
||||
package org.hibernate.test.annotations.access;
|
||||
import javax.persistence.Access;
|
||||
import javax.persistence.AccessType;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Transient;
|
||||
|
||||
import org.hibernate.annotations.AttributeAccessor;
|
||||
|
||||
/**
|
||||
* @author Emmanuel Bernard
|
||||
*/
|
||||
@Entity
|
||||
@AttributeAccessor("field")
|
||||
@Access(AccessType.FIELD)
|
||||
public class Furniture extends Woody {
|
||||
@Id
|
||||
@GeneratedValue
|
||||
@ -36,9 +36,9 @@ public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@AttributeAccessor("property")
|
||||
public long weight;
|
||||
|
||||
@Access(AccessType.PROPERTY)
|
||||
public long getWeight() {
|
||||
return weight + 1;
|
||||
}
|
||||
|
@ -159,6 +159,7 @@ public void testExplicitPropertyAccessAnnotationsOnField() throws Exception {
|
||||
}
|
||||
|
||||
@Test
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public void testExplicitPropertyAccessAnnotationsWithHibernateStyleOverride() throws Exception {
|
||||
AnnotationConfiguration cfg = new AnnotationConfiguration();
|
||||
Class<?> classUnderTest = Course3.class;
|
||||
|
@ -33,8 +33,6 @@
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.OneToMany;
|
||||
|
||||
import org.hibernate.annotations.AttributeAccessor;
|
||||
|
||||
|
||||
/**
|
||||
* @author Hardy Ferentschik
|
||||
@ -51,7 +49,7 @@ public class Course3 {
|
||||
|
||||
@Id
|
||||
@GeneratedValue
|
||||
@AttributeAccessor("field")
|
||||
@Access(AccessType.FIELD)
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
@ -46,6 +46,7 @@
|
||||
/**
|
||||
* @author Emmanuel Bernard
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class EmbeddedTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testSimple() throws Exception {
|
||||
|
@ -46,7 +46,6 @@
|
||||
import org.hibernate.Transaction;
|
||||
import org.hibernate.cfg.Configuration;
|
||||
import org.hibernate.testing.DialectChecks;
|
||||
import org.hibernate.testing.FailureExpected;
|
||||
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
|
||||
import org.hibernate.testing.RequiresDialectFeature;
|
||||
import org.hibernate.testing.ServiceRegistryBuilder;
|
||||
@ -153,7 +152,6 @@ public void testVersioning() throws Exception {
|
||||
|
||||
@Test
|
||||
@RequiresDialectFeature( DialectChecks.SupportsExpectedLobUsagePattern.class )
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public void testPolymorphism() throws Exception {
|
||||
Forest forest = new Forest();
|
||||
forest.setName( "Fontainebleau" );
|
||||
|
@ -2,6 +2,7 @@
|
||||
package org.hibernate.jpa.test.cascade;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import javax.persistence.CascadeType;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.DiscriminatorColumn;
|
||||
@ -15,6 +16,9 @@
|
||||
import javax.persistence.OneToOne;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import org.hibernate.annotations.DynamicInsert;
|
||||
import org.hibernate.annotations.DynamicUpdate;
|
||||
|
||||
/**
|
||||
* @author Emmanuel Bernard
|
||||
*/
|
||||
@ -23,7 +27,8 @@
|
||||
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
|
||||
@DiscriminatorColumn(name = "type", discriminatorType = DiscriminatorType.CHAR)
|
||||
@DiscriminatorValue("X")
|
||||
@org.hibernate.annotations.Entity(dynamicInsert = true, dynamicUpdate = true)
|
||||
@DynamicInsert
|
||||
@DynamicUpdate
|
||||
public class Conference implements Serializable {
|
||||
private Long id;
|
||||
private Date date;
|
||||
|
@ -2,6 +2,7 @@
|
||||
package org.hibernate.jpa.test.cascade;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
@ -10,6 +11,8 @@
|
||||
import javax.persistence.OneToOne;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import org.hibernate.annotations.DynamicInsert;
|
||||
import org.hibernate.annotations.DynamicUpdate;
|
||||
import org.hibernate.annotations.Proxy;
|
||||
|
||||
/**
|
||||
@ -18,7 +21,8 @@
|
||||
@Entity
|
||||
@Table(name = "portal_pk_docs_extraction")
|
||||
//@Cache(usage = READ_WRITE)
|
||||
@org.hibernate.annotations.Entity(dynamicInsert = true, dynamicUpdate = true)
|
||||
@DynamicInsert
|
||||
@DynamicUpdate
|
||||
@Proxy
|
||||
public class ExtractionDocument implements Serializable {
|
||||
private Long id;
|
||||
|
@ -5,6 +5,7 @@
|
||||
import java.util.Date;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import javax.persistence.CascadeType;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
@ -17,13 +18,17 @@
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Transient;
|
||||
|
||||
import org.hibernate.annotations.DynamicInsert;
|
||||
import org.hibernate.annotations.DynamicUpdate;
|
||||
|
||||
/**
|
||||
* @author Emmanuel Bernard
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "portal_pk_docs_extraction_info")
|
||||
//@Cache(usage = READ_WRITE)
|
||||
@org.hibernate.annotations.Entity(dynamicInsert = true, dynamicUpdate = true)
|
||||
@DynamicInsert
|
||||
@DynamicUpdate
|
||||
public class ExtractionDocumentInfo implements Serializable {
|
||||
private Long id;
|
||||
private Date lastModified;
|
||||
|
@ -1,5 +1,7 @@
|
||||
package org.hibernate.jpa.test.cascade;
|
||||
|
||||
import javax.persistence.Access;
|
||||
import javax.persistence.AccessType;
|
||||
import javax.persistence.CascadeType;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
@ -7,10 +9,8 @@
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.OneToOne;
|
||||
|
||||
import org.hibernate.annotations.AccessType;
|
||||
|
||||
@Entity
|
||||
@AccessType("field")
|
||||
@Access(AccessType.FIELD)
|
||||
public class Student {
|
||||
|
||||
@Id @GeneratedValue
|
||||
|
@ -2,6 +2,9 @@
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.persistence.Access;
|
||||
import javax.persistence.AccessType;
|
||||
import javax.persistence.CascadeType;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
@ -9,10 +12,8 @@
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.OneToOne;
|
||||
|
||||
import org.hibernate.annotations.AccessType;
|
||||
|
||||
@Entity
|
||||
@AccessType("field")
|
||||
@Access(AccessType.FIELD)
|
||||
public class Teacher {
|
||||
|
||||
@Id @GeneratedValue
|
||||
|
@ -4,6 +4,7 @@
|
||||
import java.io.Serializable;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.persistence.CascadeType;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.FetchType;
|
||||
@ -22,9 +23,8 @@ public class Troop implements Serializable {
|
||||
private String name;
|
||||
private Set<Soldier> soldiers;
|
||||
|
||||
@OneToMany(mappedBy = "troop", cascade = {CascadeType.ALL}, fetch = FetchType.LAZY)
|
||||
@OneToMany(mappedBy = "troop", cascade = {CascadeType.ALL}, fetch = FetchType.LAZY, orphanRemoval = true)
|
||||
@OrderBy(clause = "name desc")
|
||||
@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.DELETE_ORPHAN})
|
||||
public Set<Soldier> getSoldiers() {
|
||||
return soldiers;
|
||||
}
|
||||
|
@ -15,9 +15,13 @@
|
||||
*/
|
||||
@Entity
|
||||
public class Race {
|
||||
@Id @GeneratedValue public Integer id;
|
||||
@OrderColumn( name="index_" ) @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
|
||||
@org.hibernate.annotations.Cascade( { org.hibernate.annotations.CascadeType.ALL, org.hibernate.annotations.CascadeType.DELETE_ORPHAN })
|
||||
@Id @GeneratedValue
|
||||
public Integer id;
|
||||
|
||||
@OrderColumn( name="index_" )
|
||||
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, orphanRemoval = true)
|
||||
@org.hibernate.annotations.Cascade( { org.hibernate.annotations.CascadeType.ALL })
|
||||
public List<Competitor> competitors = new ArrayList<Competitor>();
|
||||
|
||||
public String name;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user