Skip to content

Instantly share code, notes, and snippets.

@sohangp
Last active May 16, 2019 14:20
Show Gist options
  • Save sohangp/21862bdacfc720140b6bace1d7c139f5 to your computer and use it in GitHub Desktop.
Save sohangp/21862bdacfc720140b6bace1d7c139f5 to your computer and use it in GitHub Desktop.
JPA Entities for Customer Order
@Data
@Entity
@Table(name = "CUSTOMER_ORDER")
public class OrderEntity {
@Id
@Column(name = "ID")
private Integer id;
@Column(name = "ORDER_NUMBER")
private String orderNumber;
@Column(name = "TOTAL_AMOUNT")
private String totalAmount;
@OneToOne
@JoinColumn(name="CUSTOMER_ID", nullable=false)
private CustomerEntity customer;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment