diff --git a/src/main/java/com/codesdream/ase/model/parent/Parent.java b/src/main/java/com/codesdream/ase/model/parent/Parent.java index 7fb7617..002a922 100644 --- a/src/main/java/com/codesdream/ase/model/parent/Parent.java +++ b/src/main/java/com/codesdream/ase/model/parent/Parent.java @@ -1,18 +1,15 @@ package com.codesdream.ase.model.parent; -import com.codesdream.ase.model.mark.Tag; import com.codesdream.ase.model.permission.User; import lombok.Data; import lombok.EqualsAndHashCode; -import javax.annotation.Generated; -import javax.persistence.*; -import java.util.List; +import javax.persistence.Entity; @Entity -@Table @Data @EqualsAndHashCode(callSuper = false) public class Parent extends User { + int studentId; } diff --git a/src/main/java/com/codesdream/ase/model/student/Student.java b/src/main/java/com/codesdream/ase/model/student/Student.java index 82329db..979e60c 100644 --- a/src/main/java/com/codesdream/ase/model/student/Student.java +++ b/src/main/java/com/codesdream/ase/model/student/Student.java @@ -13,6 +13,7 @@ import java.util.Map; @Data @EqualsAndHashCode(callSuper = false) public class Student extends User { + int parentId; String profilePicture; diff --git a/src/main/java/com/codesdream/ase/repository/parent/ParentRepository.java b/src/main/java/com/codesdream/ase/repository/parent/ParentRepository.java index 4560a04..83f2e1f 100644 --- a/src/main/java/com/codesdream/ase/repository/parent/ParentRepository.java +++ b/src/main/java/com/codesdream/ase/repository/parent/ParentRepository.java @@ -1,17 +1,15 @@ package com.codesdream.ase.repository.parent; import com.codesdream.ase.model.parent.Parent; -import com.codesdream.ase.model.student.Student; import org.springframework.data.domain.Sort; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; import java.util.List; -import java.util.Optional; @Repository public interface ParentRepository extends JpaRepository { - List findByStudentId(String studentId); - List findByStudentId(String studentId, Sort sort); + List findByStudentId(int studentId); + List findByStudentId(int studentId, Sort sort); } diff --git a/src/main/java/com/codesdream/ase/repository/student/StudentRepository.java b/src/main/java/com/codesdream/ase/repository/student/StudentRepository.java index bcc9863..ca99a4a 100644 --- a/src/main/java/com/codesdream/ase/repository/student/StudentRepository.java +++ b/src/main/java/com/codesdream/ase/repository/student/StudentRepository.java @@ -1,18 +1,14 @@ package com.codesdream.ase.repository.student; import com.codesdream.ase.model.student.Student; -import com.codesdream.ase.model.student.StudentCourse; import org.springframework.data.domain.Sort; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; -import java.util.List; -import java.util.Optional; - @Repository public interface StudentRepository extends JpaRepository { - Student findByParentId(String parentId); - Student findByParentId(String parentId, Sort sort); + Student findByParentId(int parentId); + Student findByParentId(int parentId, Sort sort); }