Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master' into wip/6.0
- Loading branch information
Showing
5 changed files
with
144 additions
and
21 deletions.
There are no files selected for viewing
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,3 @@ | ||
--- | ||
jira: | ||
projectKey: "HHH" |
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
90 changes: 90 additions & 0 deletions
90
...rnate-core/src/test/java/org/hibernate/test/mapping/MappedSuperclassWithGenericsTest.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,90 @@ | ||
/* | ||
* Hibernate, Relational Persistence for Idiomatic Java | ||
* | ||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later. | ||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>. | ||
*/ | ||
package org.hibernate.test.mapping; | ||
|
||
import java.io.Serializable; | ||
import java.util.Objects; | ||
import javax.persistence.Entity; | ||
import javax.persistence.Id; | ||
import javax.persistence.IdClass; | ||
import javax.persistence.MappedSuperclass; | ||
|
||
import org.hibernate.testing.TestForIssue; | ||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; | ||
import org.junit.Test; | ||
|
||
@TestForIssue(jiraKey = "HHH-14499") | ||
public class MappedSuperclassWithGenericsTest extends BaseCoreFunctionalTestCase { | ||
|
||
@Override | ||
protected Class<?>[] getAnnotatedClasses() { | ||
return new Class[] { | ||
IntermediateAbstractMapped.class, | ||
BaseEntity.class, | ||
AbstractGenericMappedSuperType.class, | ||
}; | ||
} | ||
|
||
@Test | ||
public void testIt() { | ||
|
||
} | ||
|
||
@MappedSuperclass | ||
public static abstract class AbstractGenericMappedSuperType<T> { | ||
|
||
private T whateverType; | ||
|
||
} | ||
|
||
@MappedSuperclass | ||
@IdClass(PK.class) | ||
public static abstract class IntermediateAbstractMapped<T> extends AbstractGenericMappedSuperType<T> { | ||
|
||
@Id | ||
private String keyOne; | ||
@Id | ||
private String keyTwo; | ||
@Id | ||
private String keyThree; | ||
} | ||
|
||
@SuppressWarnings("UnusedDeclaration") | ||
public static class PK implements Serializable { | ||
|
||
private String keyOne; | ||
private String keyTwo; | ||
private String keyThree; | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if ( this == o ) { | ||
return true; | ||
} | ||
if ( o == null || getClass() != o.getClass() ) { | ||
return false; | ||
} | ||
PK pk = (PK) o; | ||
return Objects.equals( keyOne, pk.keyOne ) && | ||
Objects.equals( keyTwo, pk.keyTwo ) && | ||
Objects.equals( keyThree, pk.keyThree ); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash( keyOne, keyTwo, keyThree ); | ||
} | ||
} | ||
|
||
@Entity(name = "BaseEntity") | ||
public static class BaseEntity<T> extends IntermediateAbstractMapped<byte[]> { | ||
|
||
String aString; | ||
|
||
} | ||
|
||
} |