Skip to content

Commit 8a003fa

Browse files
author
Nikita Konev
committed
fix types on app side
1 parent e4e4b96 commit 8a003fa

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/main/kotlin/com/example/web/jdbc/web/jdbc/Entities.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ import org.springframework.data.relational.core.mapping.Table
99
data class Subject(@Id val subjectId: Int, var subjectDesc: String, var subjectName: String)
1010

1111
@Table("branch_subject")
12-
data class SubjectRef(val subjectId: Long)
12+
data class SubjectRef(val subjectId: Int)
1313

1414
data class Branch(
15-
@Id val branchId: Long,
15+
@Id val branchId: Int,
1616
var branchName: String,
1717
@Column("branch_short_name") var branchShortName: String,
1818
var description: String? = null,
@@ -22,7 +22,7 @@ data class Branch(
2222
) {
2323

2424
fun addSubject(subject: Subject) {
25-
subjects.add(SubjectRef(subject.subjectId.toLong()))
25+
subjects.add(SubjectRef(subject.subjectId))
2626
}
2727
}
2828

src/main/kotlin/com/example/web/jdbc/web/jdbc/Repositories.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ import org.springframework.stereotype.Repository
77

88

99
@Repository
10-
interface SubjectRepository : CrudRepository<Subject, Long>
10+
interface SubjectRepository : CrudRepository<Subject, Int>
1111

1212
@Repository
13-
interface BranchRepository : CrudRepository<Branch, Long>
13+
interface BranchRepository : CrudRepository<Branch, Int>
1414

1515
@Repository
1616
interface PersonRepository : CrudRepository<Person, Long> {

0 commit comments

Comments
 (0)