Created
March 28, 2021 16:31
-
-
Save mehmetcemyucel/699c9b40f41c818cf52aba49d5a173d2 to your computer and use it in GitHub Desktop.
spring-native-example
This file contains hidden or 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.cem.springnativeexample.repository.entity; | |
| import com.cem.springnativeexample.controller.model.User; | |
| import lombok.AllArgsConstructor; | |
| import lombok.Data; | |
| import lombok.NoArgsConstructor; | |
| import javax.persistence.*; | |
| @Data | |
| @NoArgsConstructor | |
| @AllArgsConstructor | |
| @Entity | |
| @Table(name = "USER") | |
| public class UserEntity { | |
| @Id | |
| @GeneratedValue(strategy = GenerationType.AUTO) | |
| private Long id; | |
| private String name; | |
| private String surname; | |
| public static UserEntity of(User user) { | |
| return new UserEntity(user.getId(), user.getName(), user.getSurname()); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment