bilhej/backend/src/main/java/se/bilhalsning/repository
Joakim Mörling fefdea089d refactor: add @ManyToOne User relation to Order entity and @EntityGraph query
- Add @ManyToOne(fetch = LAZY) + @JoinColumn(name = "user_id",
  insertable = false, updatable = false) to Order entity so ORM can
  navigate order.getUser().getEmail() for admin responses
- Keep userId as writable UUID field; the relationship is read-only
  to preserve backward compatibility with existing setUserId() calls
- Add getUser() / setUser() accessors
- Replace handwritten @Query JOIN FETCH with Spring Data derived method
  findAllByOrderByCreatedAtDesc() annotated with @EntityGraph(attributePaths
  = {"user"}) — same eager-load behavior, zero custom JPQL
- No database schema change: user_id FK already exists
2026-05-15 12:14:28 +02:00
..
OrderRepository.java refactor: add @ManyToOne User relation to Order entity and @EntityGraph query 2026-05-15 12:14:28 +02:00
UserRepository.java feat: add User entity, repository, service, and Flyway users table migration 2026-05-01 02:06:24 +02:00