Present.java
package org.flasby.entity;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import lombok.AllArgsConstructor;
import lombok.Data;
@Data
@Entity
@AllArgsConstructor
@Table(name = "presents")
public class Present {
@Id
@GeneratedValue
long id;
String name;
String description;
boolean claimed;
String claimedBy;
String info;
/**
* default constructor used by Java persistance
*/
@SuppressWarnings("unused")
private Present() {
}
public Present(String name, String description) {
this(name, description,"");
}
public Present(String name, String description, String claimedBy) {
this.name = name;
this.description = description;
this.claimed = true;
this.claimedBy = claimedBy;
}
}