add Todo and add findByEmail for later use in UserRepository.java

This commit is contained in:
Mika Bomm 2024-09-22 12:34:55 +02:00
parent e15761eb39
commit b2c1e2e744
2 changed files with 5 additions and 0 deletions

View file

@ -42,6 +42,7 @@ public class User implements UserDetails {
@Column(name = "updated_at", nullable = false)
private LocalDateTime updatedAt;
// TODO: I think this can be removed since the same logic is already done by @CreationTimestamp annotation
@PrePersist
protected void onCreate() {
createdAt = LocalDateTime.now();

View file

@ -2,7 +2,11 @@ package com.mixel.docusphere.repository;
import com.mixel.docusphere.entity.User;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.Optional;
import java.util.UUID;
public interface UserRepository extends JpaRepository<User, UUID> {
Optional<User> findByEmail(String email);
}