pull/1/head
Matt Huntington 5 years ago
parent 5b3283e760
commit d3db912c49

@ -9,10 +9,10 @@
<relativePath/> <!-- lookup parent from repository --> <relativePath/> <!-- lookup parent from repository -->
</parent> </parent>
<groupId>com.example</groupId> <groupId>com.example</groupId>
<artifactId>demo</artifactId> <artifactId>contacts</artifactId>
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
<name>demo</name> <name>contacts</name>
<description>Demo project for Spring Boot</description> <description>Contacts project for Spring Boot</description>
<properties> <properties>
<java.version>11</java.version> <java.version>11</java.version>
@ -27,7 +27,6 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId> <artifactId>spring-boot-starter-web</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.postgresql</groupId> <groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId> <artifactId>postgresql</artifactId>

@ -1,4 +1,4 @@
package com.example.demo; package com.example.contacts;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
@ -15,12 +15,12 @@ import org.springframework.beans.factory.annotation.Autowired;
@SpringBootApplication @SpringBootApplication
@RestController @RestController
public class DemoApplication { public class ContactsApplication {
@Autowired @Autowired
private PersonRepository personRepository; private PersonRepository personRepository;
public static void main(String[] args) { public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args); SpringApplication.run(ContactsApplication.class, args);
} }
@GetMapping("/people") @GetMapping("/people")

@ -1,4 +1,4 @@
package com.example.demo; package com.example.contacts;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.GeneratedValue; import javax.persistence.GeneratedValue;

@ -1,8 +1,8 @@
package com.example.demo; package com.example.contacts;
import org.springframework.data.repository.CrudRepository; import org.springframework.data.repository.CrudRepository;
import com.example.demo.Person; import com.example.contacts.Person;
// This will be AUTO IMPLEMENTED by Spring into a Bean called userRepository // This will be AUTO IMPLEMENTED by Spring into a Bean called userRepository
// CRUD refers Create, Read, Update, Delete // CRUD refers Create, Read, Update, Delete
Loading…
Cancel
Save