/*
- * Copyright (C) 2015 Roland Haeder
+ * Copyright (C) 2016 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
*/
@Entity (name = "customer")
@Table (name = "customer")
-public class ShopCustomer implements Customer {
+public class ShopCustomer implements Customer, Comparable<Customer> {
/**
* Serial number
@OneToOne (targetEntity = UserContact.class, cascade = CascadeType.ALL, optional = false)
private Contact contact;
+ /**
+ * Account status
+ */
+ @Basic (optional = false)
+ @Column (name = "customer_account_status", nullable = false)
+ @Enumerated (EnumType.STRING)
+ private CustomerAccountStatus customerAccountStatus;
+
/**
* Confirmation key
*/
@Column (name = "customer_password_hash")
private String customerPasswordHash;
- /**
- * Account status
- */
- @Basic (optional = false)
- @Column (name = "customer_account_status", nullable = false)
- @Enumerated (EnumType.STRING)
- private CustomerAccountStatus customerAccountStatus;
-
/**
* Default constructor
*/
public ShopCustomer () {
}
+ @Override
+ public int compareTo (Customer customer) {
+ throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
+ }
+
@Override
public void copyAll (final Customer customer) {
// Copy also contact data
this.contact = contact;
}
+ @Override
+ public CustomerAccountStatus getCustomerAccountStatus () {
+ return this.customerAccountStatus;
+ }
+
+ @Override
+ public void setCustomerAccountStatus (final CustomerAccountStatus customerAccountStatus) {
+ this.customerAccountStatus = customerAccountStatus;
+ }
+
@Override
public String getCustomerConfirmKey () {
return this.customerConfirmKey;
this.customerPasswordHash = customerPasswordHash;
}
- @Override
- public CustomerAccountStatus getCustomerAccountStatus () {
- return this.customerAccountStatus;
- }
-
- @Override
- public void setCustomerAccountStatus (final CustomerAccountStatus customerAccountStatus) {
- this.customerAccountStatus = customerAccountStatus;
- }
}