Skip to content

Instantly share code, notes, and snippets.

@jeyraof
Created July 13, 2020 04:38
Show Gist options
  • Save jeyraof/d76e345345ebf5cfb1478948a6eec4f0 to your computer and use it in GitHub Desktop.
Save jeyraof/d76e345345ebf5cfb1478948a6eec4f0 to your computer and use it in GitHub Desktop.
kotlin spring practice
package com.example.auth.models
import java.util.*
import javax.persistence.*
@Entity
@Table(name = "authentications")
data class Authentication(
@get:Id
@get:GeneratedValue(strategy = GenerationType.IDENTITY)
@get:Column(name = "id")
var id: Long? = null,
@get:Column(name = "provider")
var provider: String,
@get:ManyToOne(fetch = FetchType.EAGER, optional = false)
@get:JoinColumn(name = "user_id")
var user: User,
@get:OneToOne(fetch = FetchType.LAZY, mappedBy = "authentication")
var kakaoIdentity: KakaoIdentity,
// datetime 은 어떻게 쓰는지 모르겠어서 일단 적어만둔다.
@get:Column(name = "created_at")
var createdAt: Date
) {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment