Created
October 21, 2022 13:45
-
-
Save roshanadh/b2a3ed7bea790dafc83c2e1ccf6fe56d to your computer and use it in GitHub Desktop.
Battery resource POJO
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 np.com.roshanadhikary.testdemo.entity; | |
import lombok.Data; | |
import lombok.NoArgsConstructor; | |
import lombok.NonNull; | |
import lombok.RequiredArgsConstructor; | |
import javax.persistence.*; | |
/** | |
* Database entity where name, postcode, and capacity are user-supplied fields | |
*/ | |
@Data | |
@Entity | |
@Table(name="batteries") | |
@RequiredArgsConstructor | |
@NoArgsConstructor | |
public class Battery { | |
@Id | |
@GeneratedValue(strategy = GenerationType.IDENTITY) | |
@Column | |
private int id; | |
@Column | |
@NonNull | |
private String name; | |
@Column | |
@NonNull | |
private String postcode; | |
@Column | |
@NonNull | |
private int capacity; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment