JPAstreamer Guide: JPA Queries as Java Streams in Spring Boot
JPAstreamer guide with Spring Boot 4 and Hibernate 7. Set up the metamodel, filter, sort and page entities as Java streams, see the SQL and known issues.
JPAstreamer guide with Spring Boot 4 and Hibernate 7. Set up the metamodel, filter, sort and page entities as Java streams, see the SQL and known issues.
Configure Hibernate with Spring Boot 4.1.2 and Spring Data JPA. Verify the configured H2 datasource, schema behavior, repository operations and SQL logging.
Learn to create REST APIs for crud operations using Spring REST and JPA configuration (H2 database as backend) without Spring boot auto configuration feature.
A JPA native DELETE query runs plain SQL with executeUpdate(). Learn createNativeQuery() and @NamedNativeQuery, foreign key errors and their fixes, and why callbacks, cascades and @SoftDelete are skipped.
A JPA native UPDATE query runs our own SQL with executeUpdate() and returns the row count. Learn createNativeQuery() and @NamedNativeQuery, why loaded entities go stale, and how to declare the changed tables.
A JPA native query sends our own SQL to the database and still returns managed entities, scalar values, Tuples or records. Learn createNativeQuery(), @NamedNativeQuery, result set mappings, joins and paging with Hibernate 7.
The JPA access type decides whether Hibernate uses an entity’s fields or its getters and setters. See how @Id placement picks it, and how @Access mixes both.
Learn to find JPA entities by ID or name using EntityManager.find(), JPQL queries, named queries, Criteria API, and Spring Data repository methods.
In JPA, use merge when dealing with detached entities; and use persist to explicitly add a new entity to the database without checking if it already exists.
JPA delete entity example. Learn to delete JPA entity by id. Also learn to delete multple jpa entities using Java Persistence Query Language.
Learn to configure the JPA in Spring application without the persistence.xml. We will see the XML and Java configuration examples.
A reference of the JPA annotations used on almost every Hibernate entity, from @Entity and @Column to @Embedded, @Version and @Convert, each with the DDL Hibernate 7.4 generates for it.
HowToDoInJava provides tutorials and how-to guides on Java and related technologies.
It also shares the best practices, algorithms & solutions and frequently asked interview questions.