-
-
Save kasramp/eb4fafb86693ff942062713e8e7e66fc to your computer and use it in GitHub Desktop.
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.madadipouya.quarkus.example.entity; | |
import javax.persistence.*; | |
import javax.validation.constraints.Max; | |
import javax.validation.constraints.Min; | |
import javax.validation.constraints.NotBlank; | |
import javax.validation.constraints.Size; | |
@Entity | |
@Table(name = "users") | |
public class User { | |
@Id | |
@GeneratedValue(strategy = GenerationType.IDENTITY) | |
private long id; | |
@Column(name="first_name", nullable = false) | |
@NotBlank | |
@Size(max = 256) | |
private String firstName; | |
@Column(name="last_name", nullable = false) | |
@NotBlank | |
@Size(max = 256) | |
private String lastName; | |
@Column(name="age", nullable = false) | |
@Min(1) | |
@Max(200) | |
private int age; | |
public long getId() { | |
return id; | |
} | |
public void setId(long id) { | |
this.id = id; | |
} | |
public String getFirstName() { | |
return firstName; | |
} | |
public void setFirstName(String firstName) { | |
this.firstName = firstName; | |
} | |
public String getLastName() { | |
return lastName; | |
} | |
public void setLastName(String lastName) { | |
this.lastName = lastName; | |
} | |
public int getAge() { | |
return age; | |
} | |
public void setAge(int age) { | |
this.age = age; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment