#jpa

[ follow ]
fromMedium
2 weeks ago

I Ignored These JPA Methods for Years-Now Spring Boot Application 10 Faster

After years of ignoring some key JPA methods and annotations, I finally explored them - and what happened next was shocking: my application became up to 10× faster with fewer queries, less memory use, and way cleaner code. 🔄 1. JpaRepository.existsById() Instead of findById() If you only need to check if something exists: if (userRepository.existsById(id)) { // no need to load entire entity} ✅ Why it's faster: Avoids unnecessary entity loading and reduces SQL size.
Java
Java
fromInfoWorld
3 months ago

What is JPA? Introduction to Java persistence

JPA enables CRUD via EntityManager and maps entity relationships (one-to-many, many-to-one, many-to-many, one-to-one) using annotations and foreign keys.
[ Load more ]