add Todo and add findByEmail for later use in UserRepository.java
This commit is contained in:
parent
e15761eb39
commit
b2c1e2e744
2 changed files with 5 additions and 0 deletions
|
@ -42,6 +42,7 @@ public class User implements UserDetails {
|
||||||
@Column(name = "updated_at", nullable = false)
|
@Column(name = "updated_at", nullable = false)
|
||||||
private LocalDateTime updatedAt;
|
private LocalDateTime updatedAt;
|
||||||
|
|
||||||
|
// TODO: I think this can be removed since the same logic is already done by @CreationTimestamp annotation
|
||||||
@PrePersist
|
@PrePersist
|
||||||
protected void onCreate() {
|
protected void onCreate() {
|
||||||
createdAt = LocalDateTime.now();
|
createdAt = LocalDateTime.now();
|
||||||
|
|
|
@ -2,7 +2,11 @@ package com.mixel.docusphere.repository;
|
||||||
|
|
||||||
import com.mixel.docusphere.entity.User;
|
import com.mixel.docusphere.entity.User;
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
public interface UserRepository extends JpaRepository<User, UUID> {
|
public interface UserRepository extends JpaRepository<User, UUID> {
|
||||||
|
|
||||||
|
Optional<User> findByEmail(String email);
|
||||||
}
|
}
|
Loading…
Reference in a new issue