diff --git a/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/identity/A.java b/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/identity/A.java new file mode 100644 index 0000000000..2940f6bc98 --- /dev/null +++ b/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/identity/A.java @@ -0,0 +1,83 @@ +/* + * Hibernate, Relational Persistence for Idiomatic Java + * + * Copyright (c) 2011, Red Hat Inc. or third-party contributors as + * indicated by the @author tags or express copyright attribution + * statements applied by the authors. All third-party contributions are + * distributed under license by Red Hat Inc. + * + * This copyrighted material is made available to anyone wishing to use, modify, + * copy, or redistribute it subject to the terms and conditions of the GNU + * Lesser General Public License, as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this distribution; if not, write to: + * Free Software Foundation, Inc. + * 51 Franklin Street, Fifth Floor + * Boston, MA 02110-1301 USA + */ +package org.hibernate.test.annotations.cascade.circle.identity; + +/** + * No Documentation + */ +@javax.persistence.Entity +public class A extends AbstractEntity { + private static final long serialVersionUID = 864804063L; + + /** + * No documentation + */ + @javax.persistence.OneToMany(cascade = { + javax.persistence.CascadeType.MERGE, javax.persistence.CascadeType.PERSIST, javax.persistence.CascadeType.REFRESH} + , mappedBy = "a") + private java.util.Set bCollection = new java.util.HashSet(); + + /** + * No documentation + */ + @javax.persistence.ManyToMany(cascade = { + javax.persistence.CascadeType.MERGE, javax.persistence.CascadeType.PERSIST, javax.persistence.CascadeType.REFRESH} + , mappedBy = "aCollection") + private java.util.Set dCollection = new java.util.HashSet(); + + /** + * No documentation + */ + @javax.persistence.OneToMany(cascade = { + javax.persistence.CascadeType.MERGE, javax.persistence.CascadeType.PERSIST, javax.persistence.CascadeType.REFRESH} + , mappedBy = "a") + private java.util.Set cCollection = new java.util.HashSet(); + + public java.util.Set getBCollection() { + return bCollection; + } + + public void setBCollection( + java.util.Set parameter) { + this.bCollection = parameter; + } + + public java.util.Set getDCollection() { + return dCollection; + } + + public void setDCollection( + java.util.Set parameter) { + this.dCollection = parameter; + } + + public java.util.Set getCCollection() { + return cCollection; + } + + public void setCCollection( + java.util.Set parameter) { + this.cCollection = parameter; + } +} diff --git a/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/identity/AbstractEntity.java b/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/identity/AbstractEntity.java new file mode 100644 index 0000000000..8309197fc4 --- /dev/null +++ b/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/identity/AbstractEntity.java @@ -0,0 +1,97 @@ +/* + * Hibernate, Relational Persistence for Idiomatic Java + * + * Copyright (c) 2011, Red Hat Inc. or third-party contributors as + * indicated by the @author tags or express copyright attribution + * statements applied by the authors. All third-party contributions are + * distributed under license by Red Hat Inc. + * + * This copyrighted material is made available to anyone wishing to use, modify, + * copy, or redistribute it subject to the terms and conditions of the GNU + * Lesser General Public License, as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this distribution; if not, write to: + * Free Software Foundation, Inc. + * 51 Franklin Street, Fifth Floor + * Boston, MA 02110-1301 USA + */ +package org.hibernate.test.annotations.cascade.circle.identity; + +import java.io.Serializable; +import java.util.Date; +import java.util.UUID; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.MappedSuperclass; +import javax.persistence.SequenceGenerator; + +@MappedSuperclass +public abstract class AbstractEntity implements Serializable { + + @Id + @SequenceGenerator(name = "TIGER_GEN", sequenceName = "TIGER_SEQ") + @GeneratedValue(strategy = GenerationType.IDENTITY, generator = "TIGER_GEN") + private Long id; + @Basic + @Column(unique = true, updatable = false, length = 36, columnDefinition = "char(36)") + private String uuid; + @Column(updatable = false) + private Date created; + + public AbstractEntity() { + super(); + uuid = UUID.randomUUID().toString(); + created = new Date(); + } + + public Long getId() { + return id; + } + + public String getUuid() { + return uuid; + } + + public Date getCreated() { + return created; + } + + @Override + public int hashCode() { + return uuid == null ? 0 : uuid.hashCode(); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (!(obj instanceof AbstractEntity )) + return false; + final AbstractEntity other = (AbstractEntity) obj; + if (uuid == null) { + if (other.uuid != null) + return false; + } else if (!uuid.equals(other.uuid)) + return false; + return true; + } + + public String toString() { + if (id != null) { + return "id: '" + id + "' uuid: '" + uuid + "'"; + } else { + return "id: 'transient entity' " + " uuid: '" + uuid + "'"; + } + } +} diff --git a/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/identity/B.java b/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/identity/B.java new file mode 100644 index 0000000000..ef4f397bea --- /dev/null +++ b/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/identity/B.java @@ -0,0 +1,81 @@ +/* + * Hibernate, Relational Persistence for Idiomatic Java + * + * Copyright (c) 2011, Red Hat Inc. or third-party contributors as + * indicated by the @author tags or express copyright attribution + * statements applied by the authors. All third-party contributions are + * distributed under license by Red Hat Inc. + * + * This copyrighted material is made available to anyone wishing to use, modify, + * copy, or redistribute it subject to the terms and conditions of the GNU + * Lesser General Public License, as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this distribution; if not, write to: + * Free Software Foundation, Inc. + * 51 Franklin Street, Fifth Floor + * Boston, MA 02110-1301 USA + */ +package org.hibernate.test.annotations.cascade.circle.identity; + +/** + * No Documentation + */ +@javax.persistence.Entity +public class B extends AbstractEntity { + private static final long serialVersionUID = 325417243L; + + /** + * No documentation + */ + @javax.persistence.OneToMany(cascade = { + javax.persistence.CascadeType.MERGE, javax.persistence.CascadeType.PERSIST, javax.persistence.CascadeType.REFRESH} + , mappedBy = "b") + private java.util.Set cCollection = new java.util.HashSet(); + + /** + * No documentation + */ + @javax.persistence.ManyToOne(cascade = { + javax.persistence.CascadeType.MERGE, javax.persistence.CascadeType.PERSIST, javax.persistence.CascadeType.REFRESH} + , optional = false) + private A a; + + /** + * No documentation + */ + @javax.persistence.ManyToOne(cascade = { + javax.persistence.CascadeType.MERGE, javax.persistence.CascadeType.PERSIST, javax.persistence.CascadeType.REFRESH} + , optional = false) + private F f; + + public java.util.Set getCCollection() { + return cCollection; + } + + public void setCCollection( + java.util.Set parameter) { + this.cCollection = parameter; + } + + public A getA() { + return a; + } + + public void setA(A parameter) { + this.a = parameter; + } + + public F getF() { + return f; + } + + public void setF(F parameter) { + this.f = parameter; + } +} diff --git a/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/identity/C.java b/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/identity/C.java new file mode 100644 index 0000000000..80022e588c --- /dev/null +++ b/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/identity/C.java @@ -0,0 +1,80 @@ +/* + * Hibernate, Relational Persistence for Idiomatic Java + * + * Copyright (c) 2011, Red Hat Inc. or third-party contributors as + * indicated by the @author tags or express copyright attribution + * statements applied by the authors. All third-party contributions are + * distributed under license by Red Hat Inc. + * + * This copyrighted material is made available to anyone wishing to use, modify, + * copy, or redistribute it subject to the terms and conditions of the GNU + * Lesser General Public License, as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this distribution; if not, write to: + * Free Software Foundation, Inc. + * 51 Franklin Street, Fifth Floor + * Boston, MA 02110-1301 USA + */ +package org.hibernate.test.annotations.cascade.circle.identity; + +/** + * No Documentation + */ +@javax.persistence.Entity +public class C extends AbstractEntity { + private static final long serialVersionUID = 1226955752L; + + /** + * No documentation + */ + @javax.persistence.ManyToOne(cascade = { + javax.persistence.CascadeType.MERGE, javax.persistence.CascadeType.PERSIST, javax.persistence.CascadeType.REFRESH} + , optional = false) + private A a; + + /** + * No documentation + */ + @javax.persistence.ManyToOne(cascade = { + javax.persistence.CascadeType.MERGE, javax.persistence.CascadeType.PERSIST, javax.persistence.CascadeType.REFRESH} + ) + private G g; + + /** + * No documentation + */ + @javax.persistence.ManyToOne(cascade = { + javax.persistence.CascadeType.MERGE, javax.persistence.CascadeType.PERSIST, javax.persistence.CascadeType.REFRESH} + , optional = false) + private B b; + + public A getA() { + return a; + } + + public void setA(A parameter) { + this.a = parameter; + } + + public G getG() { + return g; + } + + public void setG(G parameter) { + this.g = parameter; + } + + public B getB() { + return b; + } + + public void setB(B parameter) { + this.b = parameter; + } +} diff --git a/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/identity/CascadeCircleIdentityIdTest.java b/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/identity/CascadeCircleIdentityIdTest.java new file mode 100644 index 0000000000..70297c037b --- /dev/null +++ b/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/identity/CascadeCircleIdentityIdTest.java @@ -0,0 +1,100 @@ +/* + * Hibernate, Relational Persistence for Idiomatic Java + * + * Copyright (c) 2011, Red Hat Inc. or third-party contributors as + * indicated by the @author tags or express copyright attribution + * statements applied by the authors. All third-party contributions are + * distributed under license by Red Hat Inc. + * + * This copyrighted material is made available to anyone wishing to use, modify, + * copy, or redistribute it subject to the terms and conditions of the GNU + * Lesser General Public License, as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this distribution; if not, write to: + * Free Software Foundation, Inc. + * 51 Franklin Street, Fifth Floor + * Boston, MA 02110-1301 USA + */ +package org.hibernate.test.annotations.cascade.circle.identity; + +import org.junit.Test; + +import org.hibernate.Session; +import org.hibernate.testing.DialectCheck; +import org.hibernate.testing.DialectChecks; +import org.hibernate.testing.FailureExpected; +import org.hibernate.testing.RequiresDialectFeature; +import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; + +@RequiresDialectFeature(DialectChecks.SupportsIdentityColumns.class) +public class CascadeCircleIdentityIdTest extends BaseCoreFunctionalTestCase { + @Test + @FailureExpected( jiraKey = "HHH-5472" ) + public void testCascade() { + A a = new A(); + B b = new B(); + C c = new C(); + D d = new D(); + E e = new E(); + F f = new F(); + G g = new G(); + H h = new H(); + + a.getBCollection().add(b); + b.setA(a); + + a.getCCollection().add(c); + c.setA(a); + + b.getCCollection().add(c); + c.setB(b); + + a.getDCollection().add(d); + d.getACollection().add(a); + + d.getECollection().add(e); + e.setF(f); + + f.getBCollection().add(b); + b.setF(f); + + c.setG(g); + g.getCCollection().add(c); + + f.setH(h); + h.setG(g); + + Session s; + s = openSession(); + s.getTransaction().begin(); + try { + // Fails: says that C.b is null (even though it isn't). Doesn't fail if you persist c, g or h instead of a + s.persist(a); + s.flush(); + } finally { + s.getTransaction().rollback(); + s.close(); + } + } + + @Override + protected Class[] getAnnotatedClasses() { + return new Class[]{ + A.class, + B.class, + C.class, + D.class, + E.class, + F.class, + G.class, + H.class + }; + } + +} diff --git a/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/identity/D.java b/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/identity/D.java new file mode 100644 index 0000000000..1f842195a8 --- /dev/null +++ b/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/identity/D.java @@ -0,0 +1,66 @@ +/* + * Hibernate, Relational Persistence for Idiomatic Java + * + * Copyright (c) 2011, Red Hat Inc. or third-party contributors as + * indicated by the @author tags or express copyright attribution + * statements applied by the authors. All third-party contributions are + * distributed under license by Red Hat Inc. + * + * This copyrighted material is made available to anyone wishing to use, modify, + * copy, or redistribute it subject to the terms and conditions of the GNU + * Lesser General Public License, as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this distribution; if not, write to: + * Free Software Foundation, Inc. + * 51 Franklin Street, Fifth Floor + * Boston, MA 02110-1301 USA + */ +package org.hibernate.test.annotations.cascade.circle.identity; + +/** + * No Documentation + */ +@javax.persistence.Entity +public class D extends AbstractEntity { + private static final long serialVersionUID = 2417176961L; + + /** + * No documentation + */ + @javax.persistence.ManyToMany(cascade = { + javax.persistence.CascadeType.MERGE, javax.persistence.CascadeType.PERSIST, javax.persistence.CascadeType.REFRESH} + ) + private java.util.Set aCollection = new java.util.HashSet(); + + /** + * No documentation + */ + @javax.persistence.OneToMany(cascade = { + javax.persistence.CascadeType.MERGE, javax.persistence.CascadeType.PERSIST, javax.persistence.CascadeType.REFRESH} + ) + private java.util.Set eCollection = new java.util.HashSet(); + + public java.util.Set getACollection() { + return aCollection; + } + + public void setACollection( + java.util.Set parameter) { + this.aCollection = parameter; + } + + public java.util.Set getECollection() { + return eCollection; + } + + public void setECollection( + java.util.Set parameter) { + this.eCollection = parameter; + } +} diff --git a/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/identity/E.java b/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/identity/E.java new file mode 100644 index 0000000000..8a14eda44f --- /dev/null +++ b/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/identity/E.java @@ -0,0 +1,48 @@ +/* + * Hibernate, Relational Persistence for Idiomatic Java + * + * Copyright (c) 2011, Red Hat Inc. or third-party contributors as + * indicated by the @author tags or express copyright attribution + * statements applied by the authors. All third-party contributions are + * distributed under license by Red Hat Inc. + * + * This copyrighted material is made available to anyone wishing to use, modify, + * copy, or redistribute it subject to the terms and conditions of the GNU + * Lesser General Public License, as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this distribution; if not, write to: + * Free Software Foundation, Inc. + * 51 Franklin Street, Fifth Floor + * Boston, MA 02110-1301 USA + */ +package org.hibernate.test.annotations.cascade.circle.identity; + +/** + * No Documentation + */ +@javax.persistence.Entity +public class E extends AbstractEntity { + private static final long serialVersionUID = 1226955558L; + + /** + * No documentation + */ + @javax.persistence.ManyToOne(cascade = { + javax.persistence.CascadeType.MERGE, javax.persistence.CascadeType.PERSIST, javax.persistence.CascadeType.REFRESH} + , optional = false) + private F f; + + public F getF() { + return f; + } + + public void setF(F parameter) { + this.f = parameter; + } +} diff --git a/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/identity/F.java b/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/identity/F.java new file mode 100644 index 0000000000..e8f20d96ad --- /dev/null +++ b/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/identity/F.java @@ -0,0 +1,65 @@ +/* + * Hibernate, Relational Persistence for Idiomatic Java + * + * Copyright (c) 2011, Red Hat Inc. or third-party contributors as + * indicated by the @author tags or express copyright attribution + * statements applied by the authors. All third-party contributions are + * distributed under license by Red Hat Inc. + * + * This copyrighted material is made available to anyone wishing to use, modify, + * copy, or redistribute it subject to the terms and conditions of the GNU + * Lesser General Public License, as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this distribution; if not, write to: + * Free Software Foundation, Inc. + * 51 Franklin Street, Fifth Floor + * Boston, MA 02110-1301 USA + */ +package org.hibernate.test.annotations.cascade.circle.identity; + +/** + * No Documentation + */ +@javax.persistence.Entity +public class F extends AbstractEntity { + private static final long serialVersionUID = 1471534025L; + + /** + * No documentation + */ + @javax.persistence.OneToMany(cascade = { + javax.persistence.CascadeType.MERGE, javax.persistence.CascadeType.PERSIST, javax.persistence.CascadeType.REFRESH} + , mappedBy = "f") + private java.util.Set bCollection = new java.util.HashSet(); + + /** + * No documentation + */ + @javax.persistence.OneToOne(cascade = { + javax.persistence.CascadeType.MERGE, javax.persistence.CascadeType.PERSIST, javax.persistence.CascadeType.REFRESH} + ) + private H h; + + public java.util.Set getBCollection() { + return bCollection; + } + + public void setBCollection( + java.util.Set parameter) { + this.bCollection = parameter; + } + + public H getH() { + return h; + } + + public void setH(H parameter) { + this.h = parameter; + } +} diff --git a/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/identity/G.java b/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/identity/G.java new file mode 100644 index 0000000000..6edae338dd --- /dev/null +++ b/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/identity/G.java @@ -0,0 +1,49 @@ +/* + * Hibernate, Relational Persistence for Idiomatic Java + * + * Copyright (c) 2011, Red Hat Inc. or third-party contributors as + * indicated by the @author tags or express copyright attribution + * statements applied by the authors. All third-party contributions are + * distributed under license by Red Hat Inc. + * + * This copyrighted material is made available to anyone wishing to use, modify, + * copy, or redistribute it subject to the terms and conditions of the GNU + * Lesser General Public License, as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this distribution; if not, write to: + * Free Software Foundation, Inc. + * 51 Franklin Street, Fifth Floor + * Boston, MA 02110-1301 USA + */ +package org.hibernate.test.annotations.cascade.circle.identity; + +/** + * No Documentation + */ +@javax.persistence.Entity +public class G extends AbstractEntity { + private static final long serialVersionUID = 325417437L; + + /** + * No documentation + */ + @javax.persistence.OneToMany(cascade = { + javax.persistence.CascadeType.MERGE, javax.persistence.CascadeType.PERSIST, javax.persistence.CascadeType.REFRESH} + , mappedBy = "g") + private java.util.Set cCollection = new java.util.HashSet(); + + public java.util.Set getCCollection() { + return cCollection; + } + + public void setCCollection( + java.util.Set parameter) { + this.cCollection = parameter; + } +} diff --git a/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/identity/H.java b/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/identity/H.java new file mode 100644 index 0000000000..978fb6d01c --- /dev/null +++ b/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/identity/H.java @@ -0,0 +1,48 @@ +/* + * Hibernate, Relational Persistence for Idiomatic Java + * + * Copyright (c) 2011, Red Hat Inc. or third-party contributors as + * indicated by the @author tags or express copyright attribution + * statements applied by the authors. All third-party contributions are + * distributed under license by Red Hat Inc. + * + * This copyrighted material is made available to anyone wishing to use, modify, + * copy, or redistribute it subject to the terms and conditions of the GNU + * Lesser General Public License, as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this distribution; if not, write to: + * Free Software Foundation, Inc. + * 51 Franklin Street, Fifth Floor + * Boston, MA 02110-1301 USA + */ +package org.hibernate.test.annotations.cascade.circle.identity; + +/** + * No Documentation + */ +@javax.persistence.Entity +public class H extends AbstractEntity { + private static final long serialVersionUID = 1226955562L; + + /** + * No documentation + */ + @javax.persistence.OneToOne(cascade = { + javax.persistence.CascadeType.MERGE, javax.persistence.CascadeType.PERSIST, javax.persistence.CascadeType.REFRESH} + ) + private G g; + + public G getG() { + return g; + } + + public void setG(G parameter) { + this.g = parameter; + } +} diff --git a/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/sequence/A.java b/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/sequence/A.java new file mode 100644 index 0000000000..0f3f592c00 --- /dev/null +++ b/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/sequence/A.java @@ -0,0 +1,83 @@ +/* + * Hibernate, Relational Persistence for Idiomatic Java + * + * Copyright (c) 2011, Red Hat Inc. or third-party contributors as + * indicated by the @author tags or express copyright attribution + * statements applied by the authors. All third-party contributions are + * distributed under license by Red Hat Inc. + * + * This copyrighted material is made available to anyone wishing to use, modify, + * copy, or redistribute it subject to the terms and conditions of the GNU + * Lesser General Public License, as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this distribution; if not, write to: + * Free Software Foundation, Inc. + * 51 Franklin Street, Fifth Floor + * Boston, MA 02110-1301 USA + */ +package org.hibernate.test.annotations.cascade.circle.sequence; + +/** + * No Documentation + */ +@javax.persistence.Entity +public class A extends AbstractEntity { + private static final long serialVersionUID = 864804063L; + + /** + * No documentation + */ + @javax.persistence.OneToMany(cascade = { + javax.persistence.CascadeType.MERGE, javax.persistence.CascadeType.PERSIST, javax.persistence.CascadeType.REFRESH} + , mappedBy = "a") + private java.util.Set bCollection = new java.util.HashSet(); + + /** + * No documentation + */ + @javax.persistence.ManyToMany(cascade = { + javax.persistence.CascadeType.MERGE, javax.persistence.CascadeType.PERSIST, javax.persistence.CascadeType.REFRESH} + , mappedBy = "aCollection") + private java.util.Set dCollection = new java.util.HashSet(); + + /** + * No documentation + */ + @javax.persistence.OneToMany(cascade = { + javax.persistence.CascadeType.MERGE, javax.persistence.CascadeType.PERSIST, javax.persistence.CascadeType.REFRESH} + , mappedBy = "a") + private java.util.Set cCollection = new java.util.HashSet(); + + public java.util.Set getBCollection() { + return bCollection; + } + + public void setBCollection( + java.util.Set parameter) { + this.bCollection = parameter; + } + + public java.util.Set getDCollection() { + return dCollection; + } + + public void setDCollection( + java.util.Set parameter) { + this.dCollection = parameter; + } + + public java.util.Set getCCollection() { + return cCollection; + } + + public void setCCollection( + java.util.Set parameter) { + this.cCollection = parameter; + } +} diff --git a/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/sequence/AbstractEntity.java b/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/sequence/AbstractEntity.java new file mode 100644 index 0000000000..b547078049 --- /dev/null +++ b/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/sequence/AbstractEntity.java @@ -0,0 +1,98 @@ +/* + * Hibernate, Relational Persistence for Idiomatic Java + * + * Copyright (c) 2011, Red Hat Inc. or third-party contributors as + * indicated by the @author tags or express copyright attribution + * statements applied by the authors. All third-party contributions are + * distributed under license by Red Hat Inc. + * + * This copyrighted material is made available to anyone wishing to use, modify, + * copy, or redistribute it subject to the terms and conditions of the GNU + * Lesser General Public License, as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this distribution; if not, write to: + * Free Software Foundation, Inc. + * 51 Franklin Street, Fifth Floor + * Boston, MA 02110-1301 USA + */ +package org.hibernate.test.annotations.cascade.circle.sequence; + +import java.io.Serializable; +import java.util.Date; +import java.util.UUID; + +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.MappedSuperclass; +import javax.persistence.SequenceGenerator; + +@MappedSuperclass +public abstract class AbstractEntity implements Serializable { + + @Id + @SequenceGenerator(name = "TIGER_GEN", sequenceName = "TIGER_SEQ") + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "TIGER_GEN") + private Long id; + @Basic + @Column(unique = true, updatable = false, length = 36, columnDefinition = "char(36)") + private String uuid; + @Column(updatable = false) + private Date created; + + public AbstractEntity() { + super(); + uuid = UUID.randomUUID().toString(); + created = new Date(); + } + + public Long getId() { + return id; + } + + public String getUuid() { + return uuid; + } + + public Date getCreated() { + return created; + } + + @Override + public int hashCode() { + return uuid == null ? 0 : uuid.hashCode(); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (!(obj instanceof AbstractEntity)) + return false; + final AbstractEntity other = (AbstractEntity) obj; + if (uuid == null) { + if (other.uuid != null) + return false; + } else if (!uuid.equals(other.uuid)) + return false; + return true; + } + + public String toString() { + if (id != null) { + return "id: '" + id + "' uuid: '" + uuid + "'"; + } else { + return "id: 'transient entity' " + " uuid: '" + uuid + "'"; + } + } +} diff --git a/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/sequence/B.java b/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/sequence/B.java new file mode 100644 index 0000000000..56e8e325a7 --- /dev/null +++ b/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/sequence/B.java @@ -0,0 +1,81 @@ +/* + * Hibernate, Relational Persistence for Idiomatic Java + * + * Copyright (c) 2011, Red Hat Inc. or third-party contributors as + * indicated by the @author tags or express copyright attribution + * statements applied by the authors. All third-party contributions are + * distributed under license by Red Hat Inc. + * + * This copyrighted material is made available to anyone wishing to use, modify, + * copy, or redistribute it subject to the terms and conditions of the GNU + * Lesser General Public License, as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this distribution; if not, write to: + * Free Software Foundation, Inc. + * 51 Franklin Street, Fifth Floor + * Boston, MA 02110-1301 USA + */ +package org.hibernate.test.annotations.cascade.circle.sequence; + +/** + * No Documentation + */ +@javax.persistence.Entity +public class B extends AbstractEntity { + private static final long serialVersionUID = 325417243L; + + /** + * No documentation + */ + @javax.persistence.OneToMany(cascade = { + javax.persistence.CascadeType.MERGE, javax.persistence.CascadeType.PERSIST, javax.persistence.CascadeType.REFRESH} + , mappedBy = "b") + private java.util.Set cCollection = new java.util.HashSet(); + + /** + * No documentation + */ + @javax.persistence.ManyToOne(cascade = { + javax.persistence.CascadeType.MERGE, javax.persistence.CascadeType.PERSIST, javax.persistence.CascadeType.REFRESH} + , optional = false) + private org.hibernate.test.annotations.cascade.circle.sequence.A a; + + /** + * No documentation + */ + @javax.persistence.ManyToOne(cascade = { + javax.persistence.CascadeType.MERGE, javax.persistence.CascadeType.PERSIST, javax.persistence.CascadeType.REFRESH} + , optional = false) + private F f; + + public java.util.Set getCCollection() { + return cCollection; + } + + public void setCCollection( + java.util.Set parameter) { + this.cCollection = parameter; + } + + public org.hibernate.test.annotations.cascade.circle.sequence.A getA() { + return a; + } + + public void setA(org.hibernate.test.annotations.cascade.circle.sequence.A parameter) { + this.a = parameter; + } + + public F getF() { + return f; + } + + public void setF(F parameter) { + this.f = parameter; + } +} diff --git a/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/sequence/C.java b/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/sequence/C.java new file mode 100644 index 0000000000..17e84f45ab --- /dev/null +++ b/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/sequence/C.java @@ -0,0 +1,80 @@ +/* + * Hibernate, Relational Persistence for Idiomatic Java + * + * Copyright (c) 2011, Red Hat Inc. or third-party contributors as + * indicated by the @author tags or express copyright attribution + * statements applied by the authors. All third-party contributions are + * distributed under license by Red Hat Inc. + * + * This copyrighted material is made available to anyone wishing to use, modify, + * copy, or redistribute it subject to the terms and conditions of the GNU + * Lesser General Public License, as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this distribution; if not, write to: + * Free Software Foundation, Inc. + * 51 Franklin Street, Fifth Floor + * Boston, MA 02110-1301 USA + */ +package org.hibernate.test.annotations.cascade.circle.sequence; + +/** + * No Documentation + */ +@javax.persistence.Entity +public class C extends AbstractEntity { + private static final long serialVersionUID = 1226955752L; + + /** + * No documentation + */ + @javax.persistence.ManyToOne(cascade = { + javax.persistence.CascadeType.MERGE, javax.persistence.CascadeType.PERSIST, javax.persistence.CascadeType.REFRESH} + , optional = false) + private org.hibernate.test.annotations.cascade.circle.sequence.A a; + + /** + * No documentation + */ + @javax.persistence.ManyToOne(cascade = { + javax.persistence.CascadeType.MERGE, javax.persistence.CascadeType.PERSIST, javax.persistence.CascadeType.REFRESH} + ) + private G g; + + /** + * No documentation + */ + @javax.persistence.ManyToOne(cascade = { + javax.persistence.CascadeType.MERGE, javax.persistence.CascadeType.PERSIST, javax.persistence.CascadeType.REFRESH} + , optional = false) + private org.hibernate.test.annotations.cascade.circle.sequence.B b; + + public org.hibernate.test.annotations.cascade.circle.sequence.A getA() { + return a; + } + + public void setA(org.hibernate.test.annotations.cascade.circle.sequence.A parameter) { + this.a = parameter; + } + + public G getG() { + return g; + } + + public void setG(G parameter) { + this.g = parameter; + } + + public org.hibernate.test.annotations.cascade.circle.sequence.B getB() { + return b; + } + + public void setB(org.hibernate.test.annotations.cascade.circle.sequence.B parameter) { + this.b = parameter; + } +} diff --git a/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/sequence/CascadeCircleSequenceIdTest.java b/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/sequence/CascadeCircleSequenceIdTest.java new file mode 100644 index 0000000000..42968c3eb2 --- /dev/null +++ b/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/sequence/CascadeCircleSequenceIdTest.java @@ -0,0 +1,99 @@ +/* + * Hibernate, Relational Persistence for Idiomatic Java + * + * Copyright (c) 2011, Red Hat Inc. or third-party contributors as + * indicated by the @author tags or express copyright attribution + * statements applied by the authors. All third-party contributions are + * distributed under license by Red Hat Inc. + * + * This copyrighted material is made available to anyone wishing to use, modify, + * copy, or redistribute it subject to the terms and conditions of the GNU + * Lesser General Public License, as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this distribution; if not, write to: + * Free Software Foundation, Inc. + * 51 Franklin Street, Fifth Floor + * Boston, MA 02110-1301 USA + */ +package org.hibernate.test.annotations.cascade.circle.sequence; + +import org.hibernate.Session; +import org.hibernate.testing.DialectChecks; +import org.hibernate.testing.FailureExpected; +import org.hibernate.testing.RequiresDialectFeature; +import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; + +import org.junit.Test; + +@RequiresDialectFeature(DialectChecks.SupportsSequences.class) +public class CascadeCircleSequenceIdTest extends BaseCoreFunctionalTestCase { + @Test + @FailureExpected( jiraKey = "HHH-5472" ) + public void testCascade() { + A a = new A(); + org.hibernate.test.annotations.cascade.circle.sequence.B b = new org.hibernate.test.annotations.cascade.circle.sequence.B(); + org.hibernate.test.annotations.cascade.circle.sequence.C c = new org.hibernate.test.annotations.cascade.circle.sequence.C(); + D d = new D(); + E e = new E(); + F f = new F(); + G g = new G(); + H h = new H(); + + a.getBCollection().add(b); + b.setA(a); + + a.getCCollection().add(c); + c.setA(a); + + b.getCCollection().add(c); + c.setB(b); + + a.getDCollection().add(d); + d.getACollection().add(a); + + d.getECollection().add(e); + e.setF(f); + + f.getBCollection().add(b); + b.setF(f); + + c.setG(g); + g.getCCollection().add(c); + + f.setH(h); + h.setG(g); + + Session s; + s = openSession(); + s.getTransaction().begin(); + try { + // Fails: says that C.b is null (even though it isn't). Doesn't fail if you persist c, g or h instead of a + s.persist(a); + s.flush(); + } finally { + s.getTransaction().rollback(); + s.close(); + } + } + + @Override + protected Class[] getAnnotatedClasses() { + return new Class[]{ + A.class, + org.hibernate.test.annotations.cascade.circle.sequence.B.class, + org.hibernate.test.annotations.cascade.circle.sequence.C.class, + D.class, + E.class, + F.class, + G.class, + H.class + }; + } + +} diff --git a/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/sequence/D.java b/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/sequence/D.java new file mode 100644 index 0000000000..9a9616fc11 --- /dev/null +++ b/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/sequence/D.java @@ -0,0 +1,66 @@ +/* + * Hibernate, Relational Persistence for Idiomatic Java + * + * Copyright (c) 2011, Red Hat Inc. or third-party contributors as + * indicated by the @author tags or express copyright attribution + * statements applied by the authors. All third-party contributions are + * distributed under license by Red Hat Inc. + * + * This copyrighted material is made available to anyone wishing to use, modify, + * copy, or redistribute it subject to the terms and conditions of the GNU + * Lesser General Public License, as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this distribution; if not, write to: + * Free Software Foundation, Inc. + * 51 Franklin Street, Fifth Floor + * Boston, MA 02110-1301 USA + */ +package org.hibernate.test.annotations.cascade.circle.sequence; + +/** + * No Documentation + */ +@javax.persistence.Entity +public class D extends AbstractEntity { + private static final long serialVersionUID = 2417176961L; + + /** + * No documentation + */ + @javax.persistence.ManyToMany(cascade = { + javax.persistence.CascadeType.MERGE, javax.persistence.CascadeType.PERSIST, javax.persistence.CascadeType.REFRESH} + ) + private java.util.Set aCollection = new java.util.HashSet(); + + /** + * No documentation + */ + @javax.persistence.OneToMany(cascade = { + javax.persistence.CascadeType.MERGE, javax.persistence.CascadeType.PERSIST, javax.persistence.CascadeType.REFRESH} + ) + private java.util.Set eCollection = new java.util.HashSet(); + + public java.util.Set getACollection() { + return aCollection; + } + + public void setACollection( + java.util.Set parameter) { + this.aCollection = parameter; + } + + public java.util.Set getECollection() { + return eCollection; + } + + public void setECollection( + java.util.Set parameter) { + this.eCollection = parameter; + } +} diff --git a/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/sequence/E.java b/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/sequence/E.java new file mode 100644 index 0000000000..f7d91a6ea3 --- /dev/null +++ b/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/sequence/E.java @@ -0,0 +1,48 @@ +/* + * Hibernate, Relational Persistence for Idiomatic Java + * + * Copyright (c) 2011, Red Hat Inc. or third-party contributors as + * indicated by the @author tags or express copyright attribution + * statements applied by the authors. All third-party contributions are + * distributed under license by Red Hat Inc. + * + * This copyrighted material is made available to anyone wishing to use, modify, + * copy, or redistribute it subject to the terms and conditions of the GNU + * Lesser General Public License, as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this distribution; if not, write to: + * Free Software Foundation, Inc. + * 51 Franklin Street, Fifth Floor + * Boston, MA 02110-1301 USA + */ +package org.hibernate.test.annotations.cascade.circle.sequence; + +/** + * No Documentation + */ +@javax.persistence.Entity +public class E extends AbstractEntity { + private static final long serialVersionUID = 1226955558L; + + /** + * No documentation + */ + @javax.persistence.ManyToOne(cascade = { + javax.persistence.CascadeType.MERGE, javax.persistence.CascadeType.PERSIST, javax.persistence.CascadeType.REFRESH} + , optional = false) + private F f; + + public F getF() { + return f; + } + + public void setF(F parameter) { + this.f = parameter; + } +} diff --git a/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/sequence/F.java b/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/sequence/F.java new file mode 100644 index 0000000000..d4859c4b43 --- /dev/null +++ b/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/sequence/F.java @@ -0,0 +1,65 @@ +/* + * Hibernate, Relational Persistence for Idiomatic Java + * + * Copyright (c) 2011, Red Hat Inc. or third-party contributors as + * indicated by the @author tags or express copyright attribution + * statements applied by the authors. All third-party contributions are + * distributed under license by Red Hat Inc. + * + * This copyrighted material is made available to anyone wishing to use, modify, + * copy, or redistribute it subject to the terms and conditions of the GNU + * Lesser General Public License, as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this distribution; if not, write to: + * Free Software Foundation, Inc. + * 51 Franklin Street, Fifth Floor + * Boston, MA 02110-1301 USA + */ +package org.hibernate.test.annotations.cascade.circle.sequence; + +/** + * No Documentation + */ +@javax.persistence.Entity +public class F extends AbstractEntity { + private static final long serialVersionUID = 1471534025L; + + /** + * No documentation + */ + @javax.persistence.OneToMany(cascade = { + javax.persistence.CascadeType.MERGE, javax.persistence.CascadeType.PERSIST, javax.persistence.CascadeType.REFRESH} + , mappedBy = "f") + private java.util.Set bCollection = new java.util.HashSet(); + + /** + * No documentation + */ + @javax.persistence.OneToOne(cascade = { + javax.persistence.CascadeType.MERGE, javax.persistence.CascadeType.PERSIST, javax.persistence.CascadeType.REFRESH} + ) + private H h; + + public java.util.Set getBCollection() { + return bCollection; + } + + public void setBCollection( + java.util.Set parameter) { + this.bCollection = parameter; + } + + public H getH() { + return h; + } + + public void setH(H parameter) { + this.h = parameter; + } +} diff --git a/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/sequence/G.java b/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/sequence/G.java new file mode 100644 index 0000000000..8898935a52 --- /dev/null +++ b/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/sequence/G.java @@ -0,0 +1,49 @@ +/* + * Hibernate, Relational Persistence for Idiomatic Java + * + * Copyright (c) 2011, Red Hat Inc. or third-party contributors as + * indicated by the @author tags or express copyright attribution + * statements applied by the authors. All third-party contributions are + * distributed under license by Red Hat Inc. + * + * This copyrighted material is made available to anyone wishing to use, modify, + * copy, or redistribute it subject to the terms and conditions of the GNU + * Lesser General Public License, as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this distribution; if not, write to: + * Free Software Foundation, Inc. + * 51 Franklin Street, Fifth Floor + * Boston, MA 02110-1301 USA + */ +package org.hibernate.test.annotations.cascade.circle.sequence; + +/** + * No Documentation + */ +@javax.persistence.Entity +public class G extends AbstractEntity { + private static final long serialVersionUID = 325417437L; + + /** + * No documentation + */ + @javax.persistence.OneToMany(cascade = { + javax.persistence.CascadeType.MERGE, javax.persistence.CascadeType.PERSIST, javax.persistence.CascadeType.REFRESH} + , mappedBy = "g") + private java.util.Set cCollection = new java.util.HashSet(); + + public java.util.Set getCCollection() { + return cCollection; + } + + public void setCCollection( + java.util.Set parameter) { + this.cCollection = parameter; + } +} diff --git a/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/sequence/H.java b/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/sequence/H.java new file mode 100644 index 0000000000..35fa0d0fd8 --- /dev/null +++ b/hibernate-core/src/matrix/java/org/hibernate/test/annotations/cascade/circle/sequence/H.java @@ -0,0 +1,48 @@ +/* + * Hibernate, Relational Persistence for Idiomatic Java + * + * Copyright (c) 2011, Red Hat Inc. or third-party contributors as + * indicated by the @author tags or express copyright attribution + * statements applied by the authors. All third-party contributions are + * distributed under license by Red Hat Inc. + * + * This copyrighted material is made available to anyone wishing to use, modify, + * copy, or redistribute it subject to the terms and conditions of the GNU + * Lesser General Public License, as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this distribution; if not, write to: + * Free Software Foundation, Inc. + * 51 Franklin Street, Fifth Floor + * Boston, MA 02110-1301 USA + */ +package org.hibernate.test.annotations.cascade.circle.sequence; + +/** + * No Documentation + */ +@javax.persistence.Entity +public class H extends AbstractEntity { + private static final long serialVersionUID = 1226955562L; + + /** + * No documentation + */ + @javax.persistence.OneToOne(cascade = { + javax.persistence.CascadeType.MERGE, javax.persistence.CascadeType.PERSIST, javax.persistence.CascadeType.REFRESH} + ) + private org.hibernate.test.annotations.cascade.circle.sequence.G g; + + public org.hibernate.test.annotations.cascade.circle.sequence.G getG() { + return g; + } + + public void setG(org.hibernate.test.annotations.cascade.circle.sequence.G parameter) { + this.g = parameter; + } +}