+/*
+ * Copyright (C) 2015 Roland Haeder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jshopcore.model.order;
+
+import java.sql.Timestamp;
+import javax.persistence.Basic;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+
+/**
+ * An entity class for shop orders
+ *
+ * @author Roland Haeder
+ */
+@Entity (name = "Orders")
+@Table (name = "orders")
+public class ShopOrder implements Orderable {
+
+ /**
+ * Serial number
+ */
+ private static final long serialVersionUID = 19_728_938_459_834L;
+
+ /**
+ * Order id
+ */
+ @Id
+ @GeneratedValue (strategy = GenerationType.IDENTITY)
+ private Long id;
+
+ /**
+ * Customer id
+ */
+ @Basic (optional = false)
+ @Column (name = "customer_id", length = 20, nullable = false)
+ private Long customerId;
+
+ /**
+ * Access key
+ */
+ @Basic (optional = false)
+ @Column (name = "access_key", length = 100, nullable = false, unique = true)
+ private String accessKey;
+
+ /**
+ * Created timestamp
+ */
+ @Basic (optional = false)
+ @Temporal (TemporalType.TIMESTAMP)
+ @Column (nullable = false)
+ private Timestamp created;
+
+ @Override
+ public Timestamp getCreated () {
+ return this.created;
+ }
+
+ @Override
+ public void setCreated (final Timestamp created) {
+ this.created = created;
+ }
+
+ @Override
+ public Long getCustomerId () {
+ return this.customerId;
+ }
+
+ @Override
+ public void setCustomerId (final Long customerId) {
+ this.customerId = customerId;
+ }
+
+ @Override
+ public Long getId () {
+ return this.id;
+ }
+
+ @Override
+ public void setId (final Long id) {
+ this.id = id;
+ }
+}