Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Entity
- @Table(name = "users")
- @Getter
- @Setter
- public class User {
- @Id
- @Column(name = "user_id", nullable = false, updatable = false)
- private Long id;
- ...
- }
- @Repository
- public interface UserRepository extends JpaRepository<User, Long> {
- @Override
- @PreAuthorize("#user.id == principal.username")
- void delete(User user);
- ...
- }
- java.lang.IllegalArgumentException: Failed to evaluate expression '#user.id == principal.username'
- ...
- Caused by: org.springframework.expression.spel.SpelEvaluationException: EL1007E: Property or field 'id' cannot be found on null
Add Comment
Please, Sign In to add comment