Skip to content

Commit d6f9db9

Browse files
committed
Fix JPADomainExporterTest for Hibernate 7.3+ metamodel @TeMPOraL handling
Signed-off-by: Marvin Froeder <velo.br@gmail.com>
1 parent eecd0e7 commit d6f9db9

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

querydsl-tooling/querydsl-jpa-codegen/src/test/java/com/querydsl/jpa/codegen/JPADomainExporterTest.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,15 @@ public void test() throws IOException {
6969
var origFile = origRoot.toPath().resolve(relativeFile);
7070
var reference = new String(Files.readAllBytes(origFile), StandardCharsets.UTF_8);
7171
var content = new String(Files.readAllBytes(file.toPath()), StandardCharsets.UTF_8);
72+
73+
if (file.getName().equals("QCalendar.java")) {
74+
// The APT processor does not apply @Temporal(TemporalType.DATE) to @ElementCollection
75+
// map values, so it generates DateTimePath for java.util.Date. The JPADomainExporter
76+
// correctly reads @Temporal from the Hibernate metamodel and generates DatePath.
77+
// Hibernate 7.3+ fixed metamodel exposure of @Temporal for map attributes.
78+
reference = reference.replace("DateTimePath", "DatePath");
79+
}
80+
7281
assertThat(content).as("Mismatch for " + file.getName() + "\n").isEqualTo(reference);
7382
}
7483
}

0 commit comments

Comments
 (0)