|
4 | 4 | */ |
5 | 5 | package org.hibernate.orm.test.mapping.hhh14276; |
6 | 6 |
|
7 | | -import static org.hibernate.testing.transaction.TransactionUtil.doInJPA; |
8 | | - |
9 | | -import java.util.Map; |
10 | | - |
11 | | -import org.hibernate.cfg.AvailableSettings; |
12 | | -import org.hibernate.orm.test.jpa.BaseEntityManagerFunctionalTestCase; |
13 | | -import org.hibernate.query.sqm.mutation.internal.inline.InlineMutationStrategy; |
14 | | - |
| 7 | +import org.hibernate.SessionFactory; |
| 8 | +import org.hibernate.cfg.Configuration; |
15 | 9 | import org.hibernate.orm.test.mapping.hhh14276.entity.PlayerStat; |
16 | 10 | import org.hibernate.orm.test.mapping.hhh14276.entity.Score; |
17 | 11 | import org.hibernate.testing.orm.junit.JiraKey; |
18 | | -import org.junit.Before; |
19 | | -import org.junit.Test; |
20 | | - |
21 | | -@JiraKey(value = "HHH-14276") |
22 | | -public class NestedIdClassDerivedIdentifiersTest extends BaseEntityManagerFunctionalTestCase { |
23 | | - @Override |
24 | | - protected Class<?>[] getAnnotatedClasses() { |
25 | | - return new Class<?>[] { |
26 | | - PlayerStat.class, |
27 | | - Score.class |
28 | | - }; |
29 | | - } |
30 | | - |
31 | | - @Override |
32 | | - protected void addConfigOptions(Map options) { |
33 | | - options.put( AvailableSettings.GLOBALLY_QUOTED_IDENTIFIERS, Boolean.TRUE ); |
34 | | - options.put( AvailableSettings.QUERY_MULTI_TABLE_MUTATION_STRATEGY, InlineMutationStrategy.class.getName() ); |
35 | | - } |
| 12 | +import org.junit.jupiter.api.Test; |
36 | 13 |
|
37 | | - @Before |
38 | | - public void setUp() { |
39 | | - doInJPA( this::entityManagerFactory, em -> |
40 | | - { |
41 | | - // do nothing |
42 | | - } ); |
43 | | - } |
| 14 | +import static org.hibernate.cfg.MappingSettings.GLOBALLY_QUOTED_IDENTIFIERS; |
44 | 15 |
|
| 16 | +@JiraKey( value = "HHH-14276" ) |
| 17 | +public class NestedIdClassDerivedIdentifiersTest { |
45 | 18 | @Test |
46 | | - public void testNestedIdClassDerivedIdentifiers() { |
47 | | - doInJPA( this::entityManagerFactory, em -> |
48 | | - { |
49 | | - // do nothing |
50 | | - } ); |
| 19 | + public void testMapping() { |
| 20 | + final Configuration configuration = new Configuration() |
| 21 | + .setProperty( GLOBALLY_QUOTED_IDENTIFIERS, Boolean.TRUE ) |
| 22 | + .addAnnotatedClasses( PlayerStat.class, Score.class ); |
| 23 | + |
| 24 | + try (SessionFactory sessionFactory = configuration.buildSessionFactory()) { |
| 25 | + sessionFactory.inTransaction( (session) -> { |
| 26 | + // do nothing... |
| 27 | + } ); |
| 28 | + } |
51 | 29 | } |
52 | 30 | } |
0 commit comments