Created
July 13, 2020 04:38
-
-
Save jeyraof/d76e345345ebf5cfb1478948a6eec4f0 to your computer and use it in GitHub Desktop.
kotlin spring practice
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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