Skip to content

Instantly share code, notes, and snippets.

@mehmetcemyucel
Created March 28, 2021 16:31
Show Gist options
  • Select an option

  • Save mehmetcemyucel/699c9b40f41c818cf52aba49d5a173d2 to your computer and use it in GitHub Desktop.

Select an option

Save mehmetcemyucel/699c9b40f41c818cf52aba49d5a173d2 to your computer and use it in GitHub Desktop.
spring-native-example
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