Fix missing empty constructors for entity classes

This commit is contained in:
William Brawner 2020-02-15 11:21:10 -07:00
parent 37b45e0c22
commit 0321af50ce
3 changed files with 4 additions and 4 deletions

View file

@ -16,7 +16,7 @@ data class Budget(
@OneToMany(mappedBy = "budget") val transactions: Set<Transaction> = TreeSet(),
@OneToMany(mappedBy = "budget") val categories: Set<Category> = TreeSet(),
@ManyToMany val users: Set<User> = mutableSetOf(),
@Column(nullable = false)
@JoinColumn(nullable = false)
@ManyToOne
val owner: User? = null
)

View file

@ -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<Transaction> = emptySet(),

View file

@ -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<Transaction> {
override fun compareTo(other: Transaction): Int = this.date.compareTo(other.date)