Skip to main content

Hibernate

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.

Hibernate Vector Module: pgvector Similarity Search in HQL and Spring Data JPA

Map float[] embeddings with hibernate-vector 7.4.17, run cosine and L2 similarity search in HQL, Criteria and Spring Data JPA 4.2 on pgvector 0.8.7, prove with auto_explain when the HNSW index is used, and see four ways it silently is not. Includes recall vs ef_search measurements and a comparison with Spring AI PgVectorStore. Every output is from a committed test transcript.

Records and Value Objects in Hibernate 7: @Embeddable Records Done Right

How @Embeddable records behave in Hibernate 7.4.17, shown with captured SQL: the all-null rule (a null attribute never reaches your constructor), replace-not-mutate updates, why one removed element rewrites a whole Set, record equals vs database equality, a DDD Email value object, and why a record cannot be an @Entity.