-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HHH-18841 Create
_identifierMapper
as a synthetic attribute
- Loading branch information
1 parent
1ffde48
commit a26e505
Showing
2 changed files
with
40 additions
and
1 deletion.
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
38 changes: 38 additions & 0 deletions
38
...-core/src/test/java/org/hibernate/orm/test/id/idClass/IdClassSyntheticAttributesTest.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,38 @@ | ||
/* | ||
* 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.orm.test.id.idClass; | ||
|
||
import org.hibernate.mapping.PersistentClass; | ||
import org.hibernate.testing.orm.junit.DomainModel; | ||
import org.hibernate.testing.orm.junit.DomainModelScope; | ||
import org.hibernate.testing.orm.junit.Jira; | ||
import org.hibernate.testing.orm.junit.SessionFactory; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
@DomainModel( | ||
annotatedClasses = MyEntity.class | ||
) | ||
@SessionFactory | ||
public class IdClassSyntheticAttributesTest { | ||
|
||
@Jira("https://hibernate.atlassian.net/browse/HHH-18841") | ||
@Test | ||
public void test(DomainModelScope scope) { | ||
final PersistentClass entityBinding = scope.getDomainModel().getEntityBinding(MyEntity.class.getName()); | ||
assertThat(entityBinding.getProperties()).hasSize(2) | ||
.anySatisfy(p -> { | ||
assertThat(p.isSynthetic()).isTrue(); | ||
assertThat(p.getName()).isEqualTo("_identifierMapper"); | ||
}) | ||
.anySatisfy(p -> { | ||
assertThat(p.isSynthetic()).isFalse(); | ||
assertThat(p.getName()).isEqualTo("notes"); | ||
}); | ||
} | ||
} |