Skip to main content

9 posts tagged with "jpa"

View All Tags

Why My Object Changes Don't Stick: In-Memory vs Database Persistence

· 9 min read
Mahmut Salman
Software Developer

"I changed the object's failedLoginAttempts field, but when I query the database again, it's back to the old value! In high school, changing object properties just worked - why do I need to call save() in Spring Boot?" This is the fundamental difference between in-memory objects (what you learned in school) and database-backed objects (what you use in production). Let's understand why object changes don't automatically persist to the database.

But Someone Still Has to Write the Code, Right? The Truth About Frameworks (Part 4)

· 12 min read
Mahmut Salman
Software Developer

In Parts 1-3, we learned why Spring Data JPA uses interfaces and generates implementations. But here's the critical question: "If implementations need to exist somewhere, aren't we just hiding the work? Someone still has to write the code!" Let's be brutally honest about what frameworks actually save you.

Spring Data JPA Part 5: Why UserRepository MUST Be an Interface - Java Type System Rules

· 8 min read
Mahmut Salman
Software Developer

"Why can't I use class instead of interface for UserRepository?" Because Java's type system has strict rules: class extends class, interface extends interface, class implements interface. When you try class UserRepository extends JpaRepository, Java sees JpaRepository is an interface and throws an error. Let's understand the three-level inheritance chain and who implements what.