Spring Framework Tutorials
Spring helps write high-performing, easily testable, and reusable code and promotes programming best practices by applying dependency injection (DI).
Spring helps write high-performing, easily testable, and reusable code and promotes programming best practices by applying dependency injection (DI).
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.
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.