From 0321af50cec4589e87fdd98f203cd3619f74fb45 Mon Sep 17 00:00:00 2001 From: William Brawner Date: Sat, 15 Feb 2020 11:21:10 -0700 Subject: [PATCH] Fix missing empty constructors for entity classes --- src/main/kotlin/com/wbrawner/budgetserver/budget/Budget.kt | 2 +- .../kotlin/com/wbrawner/budgetserver/category/Category.kt | 2 +- .../com/wbrawner/budgetserver/transaction/Transaction.kt | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/com/wbrawner/budgetserver/budget/Budget.kt b/src/main/kotlin/com/wbrawner/budgetserver/budget/Budget.kt index 33eebfa..cffd1c2 100644 --- a/src/main/kotlin/com/wbrawner/budgetserver/budget/Budget.kt +++ b/src/main/kotlin/com/wbrawner/budgetserver/budget/Budget.kt @@ -16,7 +16,7 @@ data class Budget( @OneToMany(mappedBy = "budget") val transactions: Set = TreeSet(), @OneToMany(mappedBy = "budget") val categories: Set = TreeSet(), @ManyToMany val users: Set = mutableSetOf(), - @Column(nullable = false) + @JoinColumn(nullable = false) @ManyToOne val owner: User? = null ) diff --git a/src/main/kotlin/com/wbrawner/budgetserver/category/Category.kt b/src/main/kotlin/com/wbrawner/budgetserver/category/Category.kt index b51c756..d927f15 100644 --- a/src/main/kotlin/com/wbrawner/budgetserver/category/Category.kt +++ b/src/main/kotlin/com/wbrawner/budgetserver/category/Category.kt @@ -11,7 +11,7 @@ data class Category( val title: String = "", val description: String? = null, val amount: Long = 0, - @Column(nullable = false) + @JoinColumn(nullable = false) @ManyToOne val budget: Budget? = null, @OneToMany(mappedBy = "category") val transactions: Set = emptySet(), diff --git a/src/main/kotlin/com/wbrawner/budgetserver/transaction/Transaction.kt b/src/main/kotlin/com/wbrawner/budgetserver/transaction/Transaction.kt index 336e1c4..3ecbeea 100644 --- a/src/main/kotlin/com/wbrawner/budgetserver/transaction/Transaction.kt +++ b/src/main/kotlin/com/wbrawner/budgetserver/transaction/Transaction.kt @@ -16,10 +16,10 @@ data class Transaction( @ManyToOne val category: Category? = null, val expense: Boolean = true, @ManyToOne - @Column(nullable = false) + @JoinColumn(nullable = false) val createdBy: User? = null, @ManyToOne - @Column(nullable = false) + @JoinColumn(nullable = false) val budget: Budget? = null ) : Comparable { override fun compareTo(other: Transaction): Int = this.date.compareTo(other.date)