2 * Copyright (C) 2015 Roland Haeder
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 package org.mxchange.jshopcore.model.order;
19 import java.sql.Timestamp;
20 import javax.persistence.Basic;
21 import javax.persistence.Column;
22 import javax.persistence.Entity;
23 import javax.persistence.GeneratedValue;
24 import javax.persistence.GenerationType;
25 import javax.persistence.Id;
26 import javax.persistence.Table;
27 import javax.persistence.Temporal;
28 import javax.persistence.TemporalType;
31 * An entity class for shop orders
33 * @author Roland Haeder
35 @Entity (name = "Orders")
36 @Table (name = "orders")
37 public class ShopOrder implements Orderable {
42 private static final long serialVersionUID = 19_728_938_459_834L;
48 @GeneratedValue (strategy = GenerationType.IDENTITY)
54 @Basic (optional = false)
55 @Column (name = "customer_id", length = 20, nullable = false)
56 private Long customerId;
61 @Basic (optional = false)
62 @Column (name = "access_key", length = 100, nullable = false, unique = true)
63 private String accessKey;
68 @Basic (optional = false)
69 @Temporal (TemporalType.TIMESTAMP)
70 @Column (nullable = false)
71 private Timestamp created;
74 public Timestamp getCreated () {
79 public void setCreated (final Timestamp created) {
80 this.created = created;
84 public Long getCustomerId () {
85 return this.customerId;
89 public void setCustomerId (final Long customerId) {
90 this.customerId = customerId;
94 public Long getId () {
99 public void setId (final Long id) {