HHH-17460 - Ongoing JPA 32 work

This commit is contained in:
Steve Ebersole 2024-03-21 10:50:20 -05:00
parent d62673c640
commit 42ab732328
3 changed files with 8 additions and 21 deletions

View File

@ -18,6 +18,7 @@ import org.hibernate.testing.junit4.BaseUnitTestCase;
import org.hibernate.testing.util.ServiceRegistryUtil; import org.hibernate.testing.util.ServiceRegistryUtil;
import org.junit.Test; import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertFalse;
import static org.junit.Assert.fail; import static org.junit.Assert.fail;
@ -56,11 +57,8 @@ public class PersisterClassProviderTest extends BaseUnitTestCase {
fail("The entity persister should be overridden"); fail("The entity persister should be overridden");
} }
catch ( MappingException e ) { catch ( MappingException e ) {
assertEquals( // expected
"The entity persister should be overridden", assertThat( e.getCause() ).isInstanceOf( GoofyException.class );
GoofyPersisterClassProvider.NoopEntityPersister.class,
( (GoofyException) e.getCause() ).getValue()
);
} }
finally { finally {
StandardServiceRegistryBuilder.destroy( serviceRegistry ); StandardServiceRegistryBuilder.destroy( serviceRegistry );
@ -81,10 +79,8 @@ public class PersisterClassProviderTest extends BaseUnitTestCase {
fail("The collection persister should be overridden but not the entity persister"); fail("The collection persister should be overridden but not the entity persister");
} }
catch ( MappingException e ) { catch ( MappingException e ) {
assertEquals( // expected
"The collection persister should be overridden but not the entity persister", assertThat( e.getCause() ).isInstanceOf( GoofyException.class );
GoofyPersisterClassProvider.NoopCollectionPersister.class,
( (GoofyException) e.getCause() ).getValue() );
} }
finally { finally {
StandardServiceRegistryBuilder.destroy( serviceRegistry ); StandardServiceRegistryBuilder.destroy( serviceRegistry );
@ -104,10 +100,8 @@ public class PersisterClassProviderTest extends BaseUnitTestCase {
fail("The entity persisters should be overridden in a class hierarchy"); fail("The entity persisters should be overridden in a class hierarchy");
} }
catch ( MappingException e ) { catch ( MappingException e ) {
assertEquals( // expected
"The entity persisters should be overridden in a class hierarchy", assertThat( e.getCause() ).isInstanceOf( GoofyException.class );
GoofyPersisterClassProvider.NoopEntityPersister.class,
( (GoofyException) e.getCause() ).getValue() );
} }
finally { finally {
StandardServiceRegistryBuilder.destroy( serviceRegistry ); StandardServiceRegistryBuilder.destroy( serviceRegistry );

View File

@ -7,18 +7,15 @@
package org.hibernate.orm.test.cfg.persister; package org.hibernate.orm.test.cfg.persister;
import java.util.Set; import java.util.Set;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
import jakarta.persistence.Id; import jakarta.persistence.Id;
import jakarta.persistence.OneToMany; import jakarta.persistence.OneToMany;
import org.hibernate.annotations.Persister;
import org.hibernate.persister.entity.SingleTableEntityPersister;
/** /**
* @author Emmanuel Bernard * @author Emmanuel Bernard
*/ */
@Entity @Entity
@Persister( impl = SingleTableEntityPersister.class)
public class Portal { public class Portal {
@Id @Id
public Long getId() { return id; } public Long getId() { return id; }

View File

@ -9,14 +9,10 @@ package org.hibernate.orm.test.cfg.persister;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
import jakarta.persistence.Id; import jakarta.persistence.Id;
import org.hibernate.annotations.Persister;
import org.hibernate.persister.entity.SingleTableEntityPersister;
/** /**
* @author Emmanuel Bernard * @author Emmanuel Bernard
*/ */
@Entity @Entity
@Persister( impl = SingleTableEntityPersister.class)
public class Window { public class Window {
@Id @Id
public Long getId() { return id; } public Long getId() { return id; }