Add Hibernate 7 batches 2-6, batch 7, and batch 8: mapping styles, JPA annotations, natural IDs, @Immutable, stored procedures, in-memory test databases, JNDI mocking, proxies, associations, temporal mapping, named queries, HQL, Criteria API, EntityManager bootstrapping, Ehcache 3 L2 cache configuration, HikariCP connection pooling, Hibernate Validator CDI integration, aggregate functions, sorting, pagination, interceptors, and Hibernate Search 8 (Hibernate 7.4.5.Final + Spring Boot 4.1.1 + JDK 25)

This commit is contained in:
2026-09-20 06:06:42 +00:00
committed by Claude
commit 8568c0ce6c
330 changed files with 23668 additions and 0 deletions
+179
View File
@@ -0,0 +1,179 @@
WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
WARNING: sun.misc.Unsafe::staticFieldBase has been called by com.google.inject.internal.aop.HiddenClassDefiner (file:/tmp/tools/maven/lib/guice-5.1.0-classes.jar)
WARNING: Please consider reporting this to the maintainers of class com.google.inject.internal.aop.HiddenClassDefiner
WARNING: sun.misc.Unsafe::staticFieldBase will be removed in a future release
22:53:35.358 [main] INFO org.springframework.test.context.support.AnnotationConfigContextLoaderUtils -- Could not detect default configuration classes for test class [com.ankurm.hibernatedemo.proxy.OpenInViewAndLazyLoadNoTransTest]: OpenInViewAndLazyLoadNoTransTest does not declare any static, non-private, non-final, nested classes annotated with @Configuration.
22:53:35.483 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper -- Found @SpringBootConfiguration com.ankurm.hibernatedemo.HibernateDemoApplication for test class com.ankurm.hibernatedemo.proxy.OpenInViewAndLazyLoadNoTransTest
22:53:35.551 [main] INFO org.springframework.test.context.support.AnnotationConfigContextLoaderUtils -- Could not detect default configuration classes for test class [com.ankurm.hibernatedemo.proxy.OpenInViewAndLazyLoadNoTransTest]: OpenInViewAndLazyLoadNoTransTest does not declare any static, non-private, non-final, nested classes annotated with @Configuration.
22:53:35.553 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper -- Found @SpringBootConfiguration com.ankurm.hibernatedemo.HibernateDemoApplication for test class com.ankurm.hibernatedemo.proxy.OpenInViewAndLazyLoadNoTransTest
create global temporary table HTE_widget_batch_sweep10(rn_ integer not null, id bigint, name varchar(255), primary key (rn_)) transactional
Hibernate: create global temporary table HTE_widget_batch_sweep10(rn_ integer not null, id bigint, name varchar(255), primary key (rn_)) transactional
create global temporary table HTE_widget_batch_sweep1(rn_ integer not null, id bigint, name varchar(255), primary key (rn_)) transactional
Hibernate: create global temporary table HTE_widget_batch_sweep1(rn_ integer not null, id bigint, name varchar(255), primary key (rn_)) transactional
create global temporary table HTE_widget_batch_sweep25(rn_ integer not null, id bigint, name varchar(255), primary key (rn_)) transactional
Hibernate: create global temporary table HTE_widget_batch_sweep25(rn_ integer not null, id bigint, name varchar(255), primary key (rn_)) transactional
create global temporary table HTE_widget_alloc50(rn_ integer not null, id bigint, name varchar(255), primary key (rn_)) transactional
Hibernate: create global temporary table HTE_widget_alloc50(rn_ integer not null, id bigint, name varchar(255), primary key (rn_)) transactional
create global temporary table HTE_book(rn_ integer not null, id bigint, version bigint, author varchar(255), status varchar(255), title varchar(255), primary key (rn_)) transactional
Hibernate: create global temporary table HTE_book(rn_ integer not null, id bigint, version bigint, author varchar(255), status varchar(255), title varchar(255), primary key (rn_)) transactional
create global temporary table HTE_widget_alloc25(rn_ integer not null, id bigint, name varchar(255), primary key (rn_)) transactional
Hibernate: create global temporary table HTE_widget_alloc25(rn_ integer not null, id bigint, name varchar(255), primary key (rn_)) transactional
create global temporary table HTE_widget_sequence(rn_ integer not null, id bigint, name varchar(255), primary key (rn_)) transactional
Hibernate: create global temporary table HTE_widget_sequence(rn_ integer not null, id bigint, name varchar(255), primary key (rn_)) transactional
create global temporary table HTE_widget_alloc10(rn_ integer not null, id bigint, name varchar(255), primary key (rn_)) transactional
Hibernate: create global temporary table HTE_widget_alloc10(rn_ integer not null, id bigint, name varchar(255), primary key (rn_)) transactional
create global temporary table HTE_widget_batch_sweep50(rn_ integer not null, id bigint, name varchar(255), primary key (rn_)) transactional
Hibernate: create global temporary table HTE_widget_batch_sweep50(rn_ integer not null, id bigint, name varchar(255), primary key (rn_)) transactional
create table book (id bigint not null, author varchar(255), status varchar(255), title varchar(255), version bigint not null, primary key (id))
Hibernate: create table book (id bigint not null, author varchar(255), status varchar(255), title varchar(255), version bigint not null, primary key (id))
create table note (id bigint generated by default as identity, text varchar(255), book_id bigint, primary key (id))
Hibernate: create table note (id bigint generated by default as identity, text varchar(255), book_id bigint, primary key (id))
create table proxy_book (id bigint generated by default as identity, title varchar(255), publisher_id bigint, primary key (id))
Hibernate: create table proxy_book (id bigint generated by default as identity, title varchar(255), publisher_id bigint, primary key (id))
create table proxy_publisher (id bigint generated by default as identity, name varchar(255), primary key (id))
Hibernate: create table proxy_publisher (id bigint generated by default as identity, name varchar(255), primary key (id))
create table proxy_review (id bigint generated by default as identity, comment varchar(255), book_id bigint, primary key (id))
Hibernate: create table proxy_review (id bigint generated by default as identity, comment varchar(255), book_id bigint, primary key (id))
create table widget_alloc1 (id bigint not null, name varchar(255), primary key (id))
Hibernate: create table widget_alloc1 (id bigint not null, name varchar(255), primary key (id))
create table widget_alloc10 (id bigint not null, name varchar(255), primary key (id))
Hibernate: create table widget_alloc10 (id bigint not null, name varchar(255), primary key (id))
create table widget_alloc25 (id bigint not null, name varchar(255), primary key (id))
Hibernate: create table widget_alloc25 (id bigint not null, name varchar(255), primary key (id))
create table widget_alloc50 (id bigint not null, name varchar(255), primary key (id))
Hibernate: create table widget_alloc50 (id bigint not null, name varchar(255), primary key (id))
create table widget_batch_sweep1 (id bigint not null, name varchar(255), primary key (id))
Hibernate: create table widget_batch_sweep1 (id bigint not null, name varchar(255), primary key (id))
create table widget_batch_sweep10 (id bigint not null, name varchar(255), primary key (id))
Hibernate: create table widget_batch_sweep10 (id bigint not null, name varchar(255), primary key (id))
create table widget_batch_sweep25 (id bigint not null, name varchar(255), primary key (id))
Hibernate: create table widget_batch_sweep25 (id bigint not null, name varchar(255), primary key (id))
create table widget_batch_sweep50 (id bigint not null, name varchar(255), primary key (id))
Hibernate: create table widget_batch_sweep50 (id bigint not null, name varchar(255), primary key (id))
create table widget_identity (id bigint generated by default as identity, name varchar(255), primary key (id))
Hibernate: create table widget_identity (id bigint generated by default as identity, name varchar(255), primary key (id))
create table widget_sequence (id bigint not null, name varchar(255), primary key (id))
Hibernate: create table widget_sequence (id bigint not null, name varchar(255), primary key (id))
create sequence book_seq start with 1 increment by 50
Hibernate: create sequence book_seq start with 1 increment by 50
create sequence widget_alloc10_seq start with 1 increment by 10
Hibernate: create sequence widget_alloc10_seq start with 1 increment by 10
create sequence widget_alloc1_seq start with 1 increment by 1
Hibernate: create sequence widget_alloc1_seq start with 1 increment by 1
create sequence widget_alloc25_seq start with 1 increment by 25
Hibernate: create sequence widget_alloc25_seq start with 1 increment by 25
create sequence widget_alloc50_seq start with 1 increment by 50
Hibernate: create sequence widget_alloc50_seq start with 1 increment by 50
create sequence widget_batch_sweep1_seq start with 1 increment by 50
Hibernate: create sequence widget_batch_sweep1_seq start with 1 increment by 50
create sequence widget_seq start with 1 increment by 25
Hibernate: create sequence widget_seq start with 1 increment by 25
alter table if exists note add constraint FKrussm9y4vwyp0x6gl8n288ovv foreign key (book_id) references book
Hibernate: alter table if exists note add constraint FKrussm9y4vwyp0x6gl8n288ovv foreign key (book_id) references book
alter table if exists proxy_book add constraint FKdwgf9ornbhstryty5erv6yks3 foreign key (publisher_id) references proxy_publisher
Hibernate: alter table if exists proxy_book add constraint FKdwgf9ornbhstryty5erv6yks3 foreign key (publisher_id) references proxy_publisher
alter table if exists proxy_review add constraint FKt4m0nd9t6swvakhmcnm0xclio foreign key (book_id) references proxy_book
Hibernate: alter table if exists proxy_review add constraint FKt4m0nd9t6swvakhmcnm0xclio foreign key (book_id) references proxy_book
Mockito is currently self-attaching to enable the inline-mock-maker. This will no longer work in future releases of the JDK. Please add Mockito as an agent to your build as described in Mockito's documentation: https://javadoc.io/doc/org.mockito/mockito-core/latest/org.mockito/org/mockito/Mockito.html#0.3
WARNING: A Java agent has been loaded dynamically (/sessions/intelligent-loving-cori/.m2/repository/net/bytebuddy/byte-buddy-agent/1.18.11/byte-buddy-agent-1.18.11.jar)
WARNING: If a serviceability tool is in use, please run with -XX:+EnableDynamicAgentLoading to hide this warning
WARNING: If a serviceability tool is not in use, please run with -Djdk.instrument.traceUsage for more information
WARNING: Dynamic loading of agents will be disallowed by default in a future release
OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended
/* insert for com.ankurm.hibernatedemo.proxy.ProxyPublisher */insert into proxy_publisher (name,id) values (?,default)
Hibernate: /* insert for com.ankurm.hibernatedemo.proxy.ProxyPublisher */insert into proxy_publisher (name,id) values (?,default)
binding parameter (1:VARCHAR) <- [No-Trans Press]
/* insert for com.ankurm.hibernatedemo.proxy.ProxyBook */insert into proxy_book (publisher_id,title,id) values (?,?,default)
Hibernate: /* insert for com.ankurm.hibernatedemo.proxy.ProxyBook */insert into proxy_book (publisher_id,title,id) values (?,?,default)
binding parameter (1:BIGINT) <- [1]
binding parameter (2:VARCHAR) <- [No-Trans Book]
select pb1_0.id,p1_0.id,p1_0.name,pb1_0.title from proxy_book pb1_0 left join proxy_publisher p1_0 on p1_0.id=pb1_0.publisher_id where pb1_0.id=?
Hibernate: select pb1_0.id,p1_0.id,p1_0.name,pb1_0.title from proxy_book pb1_0 left join proxy_publisher p1_0 on p1_0.id=pb1_0.publisher_id where pb1_0.id=?
binding parameter (1:BIGINT) <- [1]
enable_lazy_load_no_trans=true: proxy.getTitle() after close returned 'No-Trans Book' with no exception
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v4.1.1)
Hibernate: create global temporary table HTE_widget_batch_sweep10(rn_ integer not null, id bigint, name varchar(255), primary key (rn_)) transactional
Hibernate: create global temporary table HTE_widget_batch_sweep1(rn_ integer not null, id bigint, name varchar(255), primary key (rn_)) transactional
Hibernate: create global temporary table HTE_widget_batch_sweep25(rn_ integer not null, id bigint, name varchar(255), primary key (rn_)) transactional
Hibernate: create global temporary table HTE_widget_alloc50(rn_ integer not null, id bigint, name varchar(255), primary key (rn_)) transactional
Hibernate: create global temporary table HTE_book(rn_ integer not null, id bigint, version bigint, author varchar(255), status varchar(255), title varchar(255), primary key (rn_)) transactional
Hibernate: create global temporary table HTE_widget_alloc25(rn_ integer not null, id bigint, name varchar(255), primary key (rn_)) transactional
Hibernate: create global temporary table HTE_widget_sequence(rn_ integer not null, id bigint, name varchar(255), primary key (rn_)) transactional
Hibernate: create global temporary table HTE_widget_alloc10(rn_ integer not null, id bigint, name varchar(255), primary key (rn_)) transactional
Hibernate: create global temporary table HTE_widget_batch_sweep50(rn_ integer not null, id bigint, name varchar(255), primary key (rn_)) transactional
Hibernate: create table book (id bigint not null, author varchar(255), status varchar(255), title varchar(255), version bigint not null, primary key (id))
Hibernate: create table note (id bigint generated by default as identity, text varchar(255), book_id bigint, primary key (id))
Hibernate: create table proxy_book (id bigint generated by default as identity, title varchar(255), publisher_id bigint, primary key (id))
Hibernate: create table proxy_publisher (id bigint generated by default as identity, name varchar(255), primary key (id))
Hibernate: create table proxy_review (id bigint generated by default as identity, comment varchar(255), book_id bigint, primary key (id))
Hibernate: create table widget_alloc1 (id bigint not null, name varchar(255), primary key (id))
Hibernate: create table widget_alloc10 (id bigint not null, name varchar(255), primary key (id))
Hibernate: create table widget_alloc25 (id bigint not null, name varchar(255), primary key (id))
Hibernate: create table widget_alloc50 (id bigint not null, name varchar(255), primary key (id))
Hibernate: create table widget_batch_sweep1 (id bigint not null, name varchar(255), primary key (id))
Hibernate: create table widget_batch_sweep10 (id bigint not null, name varchar(255), primary key (id))
Hibernate: create table widget_batch_sweep25 (id bigint not null, name varchar(255), primary key (id))
Hibernate: create table widget_batch_sweep50 (id bigint not null, name varchar(255), primary key (id))
Hibernate: create table widget_identity (id bigint generated by default as identity, name varchar(255), primary key (id))
Hibernate: create table widget_sequence (id bigint not null, name varchar(255), primary key (id))
Hibernate: create sequence book_seq start with 1 increment by 50
Hibernate: create sequence widget_alloc10_seq start with 1 increment by 10
Hibernate: create sequence widget_alloc1_seq start with 1 increment by 1
Hibernate: create sequence widget_alloc25_seq start with 1 increment by 25
Hibernate: create sequence widget_alloc50_seq start with 1 increment by 50
Hibernate: create sequence widget_batch_sweep1_seq start with 1 increment by 50
Hibernate: create sequence widget_seq start with 1 increment by 25
Hibernate: alter table if exists note add constraint FKrussm9y4vwyp0x6gl8n288ovv foreign key (book_id) references book
Hibernate: alter table if exists proxy_book add constraint FKdwgf9ornbhstryty5erv6yks3 foreign key (publisher_id) references proxy_publisher
Hibernate: alter table if exists proxy_review add constraint FKt4m0nd9t6swvakhmcnm0xclio foreign key (book_id) references proxy_book
spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
checked at context-startup time: the OSIV warning line is present in the captured log
Hibernate: insert into proxy_publisher (name,id) values (?,default)
Hibernate: insert into proxy_book (publisher_id,title,id) values (?,?,default)
Hibernate: insert into proxy_review (book_id,comment,id) values (?,?,default)
Hibernate: select pb1_0.id,p1_0.id,p1_0.name,pb1_0.title from proxy_book pb1_0 left join proxy_publisher p1_0 on p1_0.id=pb1_0.publisher_id where pb1_0.id=?
Hibernate: select r1_0.book_id,r1_0.id,r1_0.comment from proxy_review r1_0 where r1_0.book_id=?
default OSIV (true): GET /osiv/books/1 -> status 200, body {"title":"OSIV Default Book","publisher":{"name":"OSIV Default Press","id":1},"id":1,"reviews":[{"comment":"Rendered fine","id":1}]}
create global temporary table HTE_widget_batch_sweep10(rn_ integer not null, id bigint, name varchar(255), primary key (rn_)) transactional
Hibernate: create global temporary table HTE_widget_batch_sweep10(rn_ integer not null, id bigint, name varchar(255), primary key (rn_)) transactional
create global temporary table HTE_widget_batch_sweep1(rn_ integer not null, id bigint, name varchar(255), primary key (rn_)) transactional
Hibernate: create global temporary table HTE_widget_batch_sweep1(rn_ integer not null, id bigint, name varchar(255), primary key (rn_)) transactional
create global temporary table HTE_widget_batch_sweep25(rn_ integer not null, id bigint, name varchar(255), primary key (rn_)) transactional
Hibernate: create global temporary table HTE_widget_batch_sweep25(rn_ integer not null, id bigint, name varchar(255), primary key (rn_)) transactional
create global temporary table HTE_widget_alloc50(rn_ integer not null, id bigint, name varchar(255), primary key (rn_)) transactional
Hibernate: create global temporary table HTE_widget_alloc50(rn_ integer not null, id bigint, name varchar(255), primary key (rn_)) transactional
create global temporary table HTE_book(rn_ integer not null, id bigint, version bigint, author varchar(255), status varchar(255), title varchar(255), primary key (rn_)) transactional
Hibernate: create global temporary table HTE_book(rn_ integer not null, id bigint, version bigint, author varchar(255), status varchar(255), title varchar(255), primary key (rn_)) transactional
create global temporary table HTE_widget_alloc25(rn_ integer not null, id bigint, name varchar(255), primary key (rn_)) transactional
Hibernate: create global temporary table HTE_widget_alloc25(rn_ integer not null, id bigint, name varchar(255), primary key (rn_)) transactional
create global temporary table HTE_widget_sequence(rn_ integer not null, id bigint, name varchar(255), primary key (rn_)) transactional
Hibernate: create global temporary table HTE_widget_sequence(rn_ integer not null, id bigint, name varchar(255), primary key (rn_)) transactional
create global temporary table HTE_widget_alloc10(rn_ integer not null, id bigint, name varchar(255), primary key (rn_)) transactional
Hibernate: create global temporary table HTE_widget_alloc10(rn_ integer not null, id bigint, name varchar(255), primary key (rn_)) transactional
create global temporary table HTE_widget_batch_sweep50(rn_ integer not null, id bigint, name varchar(255), primary key (rn_)) transactional
Hibernate: create global temporary table HTE_widget_batch_sweep50(rn_ integer not null, id bigint, name varchar(255), primary key (rn_)) transactional
/* insert for com.ankurm.hibernatedemo.proxy.ProxyPublisher */insert into proxy_publisher (name,id) values (?,default)
Hibernate: /* insert for com.ankurm.hibernatedemo.proxy.ProxyPublisher */insert into proxy_publisher (name,id) values (?,default)
binding parameter (1:VARCHAR) <- [OSIV Disabled Press]
/* insert for com.ankurm.hibernatedemo.proxy.ProxyBook */insert into proxy_book (publisher_id,title,id) values (?,?,default)
Hibernate: /* insert for com.ankurm.hibernatedemo.proxy.ProxyBook */insert into proxy_book (publisher_id,title,id) values (?,?,default)
binding parameter (1:BIGINT) <- [2]
binding parameter (2:VARCHAR) <- [OSIV Disabled Book]
/* insert for com.ankurm.hibernatedemo.proxy.ProxyReview */insert into proxy_review (book_id,comment,id) values (?,?,default)
Hibernate: /* insert for com.ankurm.hibernatedemo.proxy.ProxyReview */insert into proxy_review (book_id,comment,id) values (?,?,default)
binding parameter (1:BIGINT) <- [2]
binding parameter (2:VARCHAR) <- [Never rendered]
select pb1_0.id,p1_0.id,p1_0.name,pb1_0.title from proxy_book pb1_0 left join proxy_publisher p1_0 on p1_0.id=pb1_0.publisher_id where pb1_0.id=?
Hibernate: select pb1_0.id,p1_0.id,p1_0.name,pb1_0.title from proxy_book pb1_0 left join proxy_publisher p1_0 on p1_0.id=pb1_0.publisher_id where pb1_0.id=?
binding parameter (1:BIGINT) <- [2]
Resolved [org.springframework.http.converter.HttpMessageNotWritableException: Could not write JSON: Cannot lazily initialize collection of role 'com.ankurm.hibernatedemo.proxy.ProxyBook.reviews' with key '2' (no session)]
open-in-view=false: GET /osiv/books/2 -> status 500, body {"timestamp":"2026-09-05T17:23:41.574Z","status":500,"error":"Internal Server Error","path":"/osiv/books/2"}