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 transactions: Set<Transaction> = TreeSet(),
@OneToMany(mappedBy = "budget") val categories: Set<Category> = TreeSet(), @OneToMany(mappedBy = "budget") val categories: Set<Category> = TreeSet(),
@ManyToMany val users: Set<User> = mutableSetOf(), @ManyToMany val users: Set<User> = mutableSetOf(),
@Column(nullable = false) @JoinColumn(nullable = false)
@ManyToOne @ManyToOne
val owner: User? = null val owner: User? = null
) )

View file

@ -11,7 +11,7 @@ data class Category(
val title: String = "", val title: String = "",
val description: String? = null, val description: String? = null,
val amount: Long = 0, val amount: Long = 0,
@Column(nullable = false) @JoinColumn(nullable = false)
@ManyToOne @ManyToOne
val budget: Budget? = null, val budget: Budget? = null,
@OneToMany(mappedBy = "category") val transactions: Set<Transaction> = emptySet(), @OneToMany(mappedBy = "category") val transactions: Set<Transaction> = emptySet(),

View file

@ -16,10 +16,10 @@ data class Transaction(
@ManyToOne val category: Category? = null, @ManyToOne val category: Category? = null,
val expense: Boolean = true, val expense: Boolean = true,
@ManyToOne @ManyToOne
@Column(nullable = false) @JoinColumn(nullable = false)
val createdBy: User? = null, val createdBy: User? = null,
@ManyToOne @ManyToOne
@Column(nullable = false) @JoinColumn(nullable = false)
val budget: Budget? = null val budget: Budget? = null
) : Comparable<Transaction> { ) : Comparable<Transaction> {
override fun compareTo(other: Transaction): Int = this.date.compareTo(other.date) override fun compareTo(other: Transaction): Int = this.date.compareTo(other.date)