This repository has been archived on 2018-02-23. You can view files and clone it, but cannot push or open issues or pull requests.
url-shortener/src/main/kotlin/net/cismon/urlshortener/model/UrlModel.kt

24 lines
513 B
Kotlin

package net.cismon.urlshortener.model
import javax.persistence.*
import javax.validation.constraints.NotNull
@Entity
@Table(name = "url", indexes = [
Index(name = "unique_id", columnList = "uuid", unique = true)
])
class UrlModel(
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
var id: Long? = null,
@NotNull
@JoinColumn(foreignKey = ForeignKey(name = "created_by"))
var uid: Long? = null,
@NotNull
var uuid: String? = null,
@NotNull
var url: String? = null
)