Hibernate 8 Safe Mode for HQL and Row-Level Security Multi-Tenancy on PostgreSQL (8.0.0.CR2)
Hibernate ORM 8.0.0.CR2 (release candidate) adds hibernate.query.safe_mode_enabled, which rejects HQL calls to unregistered database functions, and generates a PostgreSQL row-level-security policy for @TenantId tables. Both run against a real PostgreSQL 16 with captured output: what each blocks, what a superuser bypasses, how a set_config() call moves the tenant, and the tenant parameter in @SQLUpdate and @SQLDelete.