diff --git a/persistence-modules/spring-boot-persistence-h2-console/src/main/java/com/ossez/h2db/springboot/SpringBootH2ConsoleApplication.java b/persistence-modules/spring-boot-persistence-h2-console/src/main/java/com/ossez/h2db/springboot/SpringBootH2ConsoleApplication.java index 3bdbd314fb..aa15be073f 100644 --- a/persistence-modules/spring-boot-persistence-h2-console/src/main/java/com/ossez/h2db/springboot/SpringBootH2ConsoleApplication.java +++ b/persistence-modules/spring-boot-persistence-h2-console/src/main/java/com/ossez/h2db/springboot/SpringBootH2ConsoleApplication.java @@ -9,7 +9,7 @@ import org.springframework.context.annotation.Bean; import java.util.Arrays; /** - * + * MAIN APPLICATION */ @SpringBootApplication public class SpringBootH2ConsoleApplication { diff --git a/persistence-modules/spring-boot-persistence-h2-console/src/main/java/com/ossez/h2db/springboot/daos/UserRepository.java b/persistence-modules/spring-boot-persistence-h2-console/src/main/java/com/ossez/h2db/springboot/daos/UserRepository.java new file mode 100644 index 0000000000..5f8cb61fef --- /dev/null +++ b/persistence-modules/spring-boot-persistence-h2-console/src/main/java/com/ossez/h2db/springboot/daos/UserRepository.java @@ -0,0 +1,7 @@ +package com.ossez.h2db.springboot.daos; + +import com.ossez.h2db.springboot.models.User; +import org.springframework.data.repository.CrudRepository; + +public interface UserRepository extends CrudRepository { +} diff --git a/persistence-modules/spring-boot-persistence-h2-console/src/main/java/com/ossez/h2db/springboot/models/User.java b/persistence-modules/spring-boot-persistence-h2-console/src/main/java/com/ossez/h2db/springboot/models/User.java new file mode 100644 index 0000000000..b211cd99fa --- /dev/null +++ b/persistence-modules/spring-boot-persistence-h2-console/src/main/java/com/ossez/h2db/springboot/models/User.java @@ -0,0 +1,54 @@ +package com.ossez.h2db.springboot.models; + +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.Table; + +@Table(name = "user") +@Entity +public class User { + + @Id + @GeneratedValue + private int id; + + private String firstName; + + private String lastName; + + public User() { } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + @Override + public String toString() { + return "User{" + + "id=" + id + + ", firstName='" + firstName + '\'' + + ", lastName='" + lastName + '\'' + + '}'; + } +}