Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HHH-9370 : Unidirectional one-to-many with key that is property-ref (…
…test case)
- Loading branch information
Showing
5 changed files
with
79 additions
and
5 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
hibernate-core/src/test/java/org/hibernate/test/unidir/BackrefPropertyRefTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Hibernate, Relational Persistence for Idiomatic Java | ||
* | ||
* Copyright (c) 2015, 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.unidir; | ||
|
||
import org.hibernate.testing.FailureExpected; | ||
import org.hibernate.testing.TestForIssue; | ||
|
||
/** | ||
* @author Gail Badner | ||
*/ | ||
@TestForIssue( jiraKey = "HHH-9370") | ||
@FailureExpected( jiraKey = "HHH-9370") | ||
public class BackrefPropertyRefTest extends BackrefTest { | ||
|
||
@Override | ||
protected String[] getMappings() { | ||
return new String[] { "unidir/ParentChildPropertyRef.hbm.xml" }; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
hibernate-core/src/test/java/org/hibernate/test/unidir/ParentChildPropertyRef.hbm.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0"?> | ||
<!DOCTYPE hibernate-mapping PUBLIC | ||
"-//Hibernate/Hibernate Mapping DTD 3.0//EN" | ||
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"> | ||
|
||
<hibernate-mapping | ||
package="org.hibernate.test.unidir"> | ||
|
||
<class name="Parent"> | ||
<id name="name"/> | ||
<property name="ssn" unique="true"/> | ||
<list name="children" cascade="persist,merge"> | ||
<key column="parentSsn" not-null="true" property-ref="ssn"/> | ||
<list-index column="sibling"/> | ||
<one-to-many class="Child"/> | ||
</list> | ||
</class> | ||
|
||
<class name="Child"> | ||
<id name="name"/> | ||
<property name="age" not-null="true"/> | ||
</class> | ||
|
||
</hibernate-mapping> |