Initial commit

This commit is contained in:
jeobeardy committed 2024-08-16 10:50:57 +02:00
commit 2550140811
94 files changed
+10844

No files matched your search

@@ -0,0 +1,28 @@
package at.eisibaer.jbear2.model
import jakarta.persistence.*
@Entity
@Table(name = "users", indexes = [
Index(name = "fk_profile_picture_to_user", columnList = "fk_profile_picture"),
Index(name = "username_to_user", columnList = "username"),
])
data class User(
@Column(name = "username", nullable = false, unique = true)
var username: String,
@Column(name = "password", nullable = false, unique = false)
var password: String,
@OneToMany(mappedBy = "owner")
val boards: List<Board>,
@OneToOne
@JoinColumn(name = "fk_profile_picture", referencedColumnName = "id")
var profilePicture: ImageFile?,
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequenceGenerator")
val id: Long? = null,
)