Skip to content

Instantly share code, notes, and snippets.

@diegosilva13
Created December 17, 2017 17:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diegosilva13/63ebd7b303c99f9cb053b27f5607fa38 to your computer and use it in GitHub Desktop.
Save diegosilva13/63ebd7b303c99f9cb053b27f5607fa38 to your computer and use it in GitHub Desktop.
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