Add jakarta-data module: Jakarta Data repositories on Hibernate 7.4 / 8.0 CR2 vs Spring Data JPA 4.2

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ic4b4XrpfdpsacrvqnrBM
This commit is contained in:
Claude
2026-11-26 20:54:35 +05:30
parent 4f7ebd5cb0
commit 54c6d606ff
59 changed files with 2073 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
#!/usr/bin/env bash
# Compiles each file in hibernate-data/src/broken/ on its own, inside a throwaway copy of the module, and records the
# compiler's own message. Usage: scripts/broken.sh [ga|h8]. Needs JDK 25 and Maven. Writes hibernate-data/target/transcripts/<profile>/05-compile-errors.txt
set -uo pipefail
cd "$(dirname "$0")/../hibernate-data"
P="${1:-ga}"
PFLAG=""; [ "$P" = "h8" ] && PFLAG="-Ph8"
OUT="target/transcripts/$P"; mkdir -p "$OUT"; : > "$OUT/05-compile-errors.txt"
for f in src/broken/*.java; do
name=$(basename "$f" .java)
tmp=$(mktemp -d)
cp -r pom.xml src "$tmp/"
# the parent pom is needed only for coordinates; make the copy standalone
sed -i '/<parent>/,/<\/parent>/d' "$tmp/pom.xml"
sed -i 's#<artifactId>hibernate-data</artifactId>#<groupId>com.ankurm</groupId><version>1.0.0</version><artifactId>hibernate-data</artifactId>#' "$tmp/pom.xml"
cp "$f" "$tmp/src/main/java/com/ankurm/data/"
rm -rf "$tmp/src/broken" "$tmp/src/test" "$tmp/src/test-h8"
[ -d "$tmp/src/h8" ] && [ "$P" != "h8" ] && rm -rf "$tmp/src/h8"
echo "##### $name" >> "$OUT/05-compile-errors.txt"
(cd "$tmp" && mvn -B -q $PFLAG compile 2>&1 | grep -E '^\[ERROR\] .*\.java:\[' | sed -E "s#$tmp/src/main/java/##; s#\[ERROR\] ##" | awk '!seen[$0]++') >> "$OUT/05-compile-errors.txt"
rm -rf "$tmp"
done
cat "$OUT/05-compile-errors.txt"
+23
View File
@@ -0,0 +1,23 @@
#!/usr/bin/env bash
# Regenerates every file in output/. Needs JDK 25 and Maven with network access (first run downloads dependencies).
# output/ga Hibernate 7.4.17.Final + Jakarta Data 1.0.2 (both GA)
# output/h8 Hibernate 8.0.0.CR2 + Jakarta Data 1.1.0-M4 (both pre-release)
# output/spring Spring Boot 4.2.0 / Spring Data JPA 4.2.0 (GA)
set -euo pipefail
cd "$(dirname "$0")/.."
ROOT=$(pwd)
rm -rf output && mkdir -p output/ga output/h8 output/spring
bash scripts/verify-versions.sh > output/00-version-check.txt
for P in ga h8; do
FLAG=""; [ "$P" = h8 ] && FLAG="-Ph8"
(cd hibernate-data && mvn -B -q $FLAG clean test >/dev/null)
bash scripts/broken.sh "$P" >/dev/null
cp hibernate-data/target/transcripts/$P/*.txt output/$P/
for g in Library_ _Library Catalog_ _Catalog; do
f=hibernate-data/target/generated-sources/annotations/com/ankurm/data/$g.java
[ -f "$f" ] && cp "$f" "output/$P/generated-$g.java.txt"
done
done
(cd spring-data && mvn -B -q clean test >/dev/null)
cp spring-data/target/transcripts/*.txt output/spring/
echo "wrote:"; find output -type f | sort
+31
View File
@@ -0,0 +1,31 @@
#!/usr/bin/env bash
# Prints, from Maven Central's maven-metadata.xml, the newest versions of every artifact this module depends on, so the
# GA / pre-release status quoted in the article can be re-checked. Needs curl. Retries because Maven Central rate-limits.
set -uo pipefail
fetch() {
local xml
for i in 1 2 3 4 5 6; do
xml=$(curl -sf "https://repo1.maven.org/maven2/$1/maven-metadata.xml") && { echo "$xml"; return 0; }
sleep 8
done
return 1
}
show() {
local xml
xml=$(fetch "$1") || { echo "$1: could not fetch"; return 0; }
echo "$1"
echo "$xml" | grep -oE '<version>[^<]+' | sed 's/<version>//' | tail -4 | sed 's/^/ /'
echo " lastUpdated $(echo "$xml" | grep -oE '<lastUpdated>[0-9]+' | sed 's/<lastUpdated>//')"
}
show org/hibernate/orm/hibernate-core
show org/hibernate/orm/hibernate-processor
show jakarta/data/jakarta.data-api
show jakarta/persistence/jakarta.persistence-api
show org/springframework/data/spring-data-jpa
show org/springframework/boot/spring-boot-starter-parent
echo
echo "newest Final (GA) hibernate-core:"
fetch org/hibernate/orm/hibernate-core | grep -oE '<version>[0-9.]+\.Final' | sed 's/<version>//' | tail -1 | sed 's/^/ /'
echo "newest GA jakarta.data-api:"
fetch jakarta/data/jakarta.data-api | grep -oE '<version>[0-9.]+<' | tr -d '<>version/' | tail -1 | sed 's/^/ /'
exit 0