From 605568587ec6e11b43f5a05262928652b842c4e7 Mon Sep 17 00:00:00 2001 From: saikat Date: Sat, 2 Mar 2024 11:06:37 +0530 Subject: [PATCH] Add application file and update entity in model --- .../baeldung/caching/twolevelcache/Customer.java | 4 ++++ .../twolevelcache/TwoLevelCacheApplication.java | 14 ++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 spring-boot-modules/spring-caching-2/src/main/java/com/baeldung/caching/twolevelcache/TwoLevelCacheApplication.java diff --git a/spring-boot-modules/spring-caching-2/src/main/java/com/baeldung/caching/twolevelcache/Customer.java b/spring-boot-modules/spring-caching-2/src/main/java/com/baeldung/caching/twolevelcache/Customer.java index a2d1a14ea3..b8a1b7d6b2 100644 --- a/spring-boot-modules/spring-caching-2/src/main/java/com/baeldung/caching/twolevelcache/Customer.java +++ b/spring-boot-modules/spring-caching-2/src/main/java/com/baeldung/caching/twolevelcache/Customer.java @@ -5,14 +5,18 @@ import lombok.Data; import lombok.NoArgsConstructor; import lombok.Setter; +import javax.persistence.Entity; +import javax.persistence.Id; import java.io.Serializable; @Data +@Entity @AllArgsConstructor @NoArgsConstructor @Setter public class Customer implements Serializable { + @Id private String id; private String name; diff --git a/spring-boot-modules/spring-caching-2/src/main/java/com/baeldung/caching/twolevelcache/TwoLevelCacheApplication.java b/spring-boot-modules/spring-caching-2/src/main/java/com/baeldung/caching/twolevelcache/TwoLevelCacheApplication.java new file mode 100644 index 0000000000..867f4c9f91 --- /dev/null +++ b/spring-boot-modules/spring-caching-2/src/main/java/com/baeldung/caching/twolevelcache/TwoLevelCacheApplication.java @@ -0,0 +1,14 @@ +package com.baeldung.caching.twolevelcache; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cache.annotation.EnableCaching; + +@SpringBootApplication +@EnableCaching +public class TwoLevelCacheApplication { + + public static void main(String[] args) { + SpringApplication.run(TwoLevelCacheApplication.class, args); + } +} \ No newline at end of file