Skip to content

Commit abd3b32

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

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

querydsl-tooling/querydsl-jpa-codegen/src/test/java/com/querydsl/jpa/codegen/ant/AntJPADomainExporterTest.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,15 @@ public void test() throws IOException {
3535
var reference =
3636
new String(java.nio.file.Files.readAllBytes(origFile), StandardCharsets.UTF_8);
3737
var content = new String(Files.readAllBytes(file.toPath()), StandardCharsets.UTF_8);
38+
39+
if (file.getName().equals("QCalendar.java")) {
40+
// The APT processor does not apply @Temporal(TemporalType.DATE) to @ElementCollection
41+
// map values, so it generates DateTimePath for java.util.Date. The JPADomainExporter
42+
// correctly reads @Temporal from the Hibernate metamodel and generates DatePath.
43+
// Hibernate 7.3+ fixed metamodel exposure of @Temporal for map attributes.
44+
reference = reference.replace("DateTimePath", "DatePath");
45+
}
46+
3847
assertThat(content).withFailMessage("Mismatch for %s", file.getPath()).isEqualTo(reference);
3948
}
4049
}

0 commit comments

Comments
 (0)