Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Repository
- interface DbHost : JpaRepository<HostEntity, Long> {
- fun findHostEntityByUserAuth_Name(login: String): HostEntity
- }
- @Entity
- class HostEntity(
- @Column(name = "first_name")
- var firstName: String,
- @Column(name = "last_name")
- var lastName: String,
- @OneToOne(cascade = [CascadeType.ALL], orphanRemoval = true)
- var userAuth: UserEntity,
- @Id
- @GeneratedValue(strategy = GenerationType.IDENTITY)
- var id: Long? = null
- )
- @Entity
- class UserEntity(
- @Id
- @Column(unique = true)
- val name: String,
- @Column(name = "password")
- val password: String,
- @Enumerated(EnumType.STRING)
- val role: Role)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement