瀏覽代碼

overloaded person constructor

mpierse 5 年之前
父節點
當前提交
0886b84c45

+ 5
- 0
src/main/java/io/zipcoder/crudapp/Person.java 查看文件

@@ -20,6 +20,11 @@ public class Person {
20 20
     public Person() {
21 21
     }
22 22
 
23
+    public Person(String firstName, String lastName) {
24
+        this.firstName = firstName;
25
+        this.lastName = lastName;
26
+    }
27
+
23 28
     public Long getId() {
24 29
         return id;
25 30
     }

+ 0
- 2
src/main/java/io/zipcoder/crudapp/PersonRepository.java 查看文件

@@ -4,6 +4,4 @@ import org.springframework.data.repository.CrudRepository;
4 4
 
5 5
 public interface PersonRepository extends CrudRepository<Person, Long> {
6 6
 
7
-
8
-
9 7
 }