我正在使用scala,hibernate使用postgres数据库
如何自动增加postgres数据库中主键和序列号的id
这是我的模特
@Entity
@Table(name = "event_user")
class User( id: Option[Long] = None, email1: String, password: String, first_name1: String, last_name1: String) {
@Id
var id: Long = _
@Column(name = "email")
var email : String = email1
@Column(name = "password")
var passWord : String = password
@Column(name = "first_name")
var first_name : String = first_name1
@Column(name = "last_name")
var last_name : String = last_name1
def this() = this (None, null, null, null, null)
}