Revert "BAEL-4134"
This commit is contained in:
committed by
GitHub
parent
4a35b97bad
commit
7ab2f437ee
@@ -0,0 +1,21 @@
|
||||
package com.baeldung.springdatacaching.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import java.util.UUID;
|
||||
|
||||
@Data
|
||||
@Entity
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class Book {
|
||||
|
||||
@Id
|
||||
private UUID id;
|
||||
private String title;
|
||||
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package com.baeldung.springdatacaching.repositories;
|
||||
|
||||
import com.baeldung.springdatacaching.model.Book;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
public interface BookRepository extends CrudRepository<Book, UUID> {
|
||||
|
||||
@Cacheable(value = "books", unless = "#a0=='Foundation'")
|
||||
Optional<Book> findFirstByTitle(String title);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user