Created
December 17, 2017 17:12
-
-
Save diegosilva13/63ebd7b303c99f9cb053b27f5607fa38 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.coderef.delivery.model; | |
import org.hibernate.validator.constraints.NotEmpty; | |
import javax.persistence.*; | |
import javax.validation.constraints.NotNull; | |
import java.io.Serializable; | |
@Entity | |
@Table(name = "`order`") | |
public class Order implements Serializable { | |
private static final long serialVersionUID = 1L; | |
@Id | |
@GeneratedValue(strategy = GenerationType.AUTO) | |
private Integer id; | |
@NotEmpty(message = "Product required") | |
private String product; | |
@NotNull(message = "Price required") | |
private Double price; | |
public Integer getId() { | |
return id; | |
} | |
public void setId(Integer id) { | |
this.id = id; | |
} | |
public String getProduct() { | |
return product; | |
} | |
public void setProduct(String product) { | |
this.product = product; | |
} | |
public Double getPrice() { | |
return price; | |
} | |
public void setPrice(Double price) { | |
this.price = price; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment