Add h8-preview module: hibernate-demo suite against Hibernate 8.0.0.Beta3 and Jakarta Persistence 4.0.0-M7

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Gth99spB1CzQmBFofXmU4Z
This commit is contained in:
Claude
2026-09-28 08:42:17 +00:00
parent 8568c0ce6c
commit 833f3e1c31
35 changed files with 769 additions and 0 deletions
@@ -0,0 +1,26 @@
package com.ankurm.h8;
import static org.assertj.core.api.Assertions.assertThat;
import org.hibernate.SessionFactory;
import org.junit.jupiter.api.Test;
/** A JPA @NamedQuery whose text is an UPDATE: accepted or rejected at start-up? */
class MutatingNamedQueryTest {
@Test
void recordsStartupOutcome() {
Transcript t = new Transcript("03-mutating-named-query");
String outcome;
try (SessionFactory sf = Db.open(MutatingNamedQueryEntity.class)) {
int rows = sf.fromTransaction(s -> s.createNamedQuery("Mutating.rename").setParameter("name", "x").executeUpdate());
outcome = "session factory built; createNamedQuery(..).executeUpdate() returned " + rows;
}
catch (RuntimeException ex) {
outcome = "threw " + Db.describe(ex) + " :: " + String.valueOf(Db.root(ex).getMessage()).lines().findFirst().orElse("");
}
t.line(outcome);
t.write();
assertThat(outcome).isNotBlank();
}
}