Add hibernate-jpa module: 40 runnable Hibernate 7 / JPA interview answers on PostgreSQL 16

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Cfo2K4u4rF18QsPXPFnytf
This commit is contained in:
2026-10-24 17:33:29 +00:00
co-authored by Claude Sonnet 5.5
parent a5fbf45971
commit d03962ea9c
87 changed files with 2387 additions and 1 deletions
+12
View File
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
# Starts a throwaway PostgreSQL on port 5433 with a database called "lab" (needs PostgreSQL binaries installed).
# Run as a non-root user. Adjust PGBIN for your platform.
set -euo pipefail
PGBIN="${PGBIN:-/usr/lib/postgresql/16/bin}"
DATA="${PGDATA_DIR:-/tmp/pg-lab/data}"
mkdir -p "$(dirname "$DATA")"
[ -d "$DATA" ] || "$PGBIN/initdb" -D "$DATA" -A trust -U postgres >/dev/null
"$PGBIN/pg_ctl" -D "$DATA" -o "-p 5433 -k /tmp" -l "$(dirname "$DATA")/pg.log" start
sleep 2
psql -h localhost -p 5433 -U postgres -tc "select 1 from pg_database where datname='lab'" | grep -q 1 \
|| psql -h localhost -p 5433 -U postgres -c "create database lab"