package com.addicks.sendash.admin.domain;

import java.util.Collection;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

@Entity
@Table(name = "person")
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
public class User implements UserDetails {

  private static final long serialVersionUID = 5651803198978520716L;

  @Id
  @GeneratedValue()
  private long id;

  public long getId() {
    return id;
  }

  public void setId(long id) {
    this.id = id;
  }

  @Override
  public Collection<? extends GrantedAuthority> getAuthorities() {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public String getPassword() {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public String getUsername() {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public boolean isAccountNonExpired() {
    // TODO Auto-generated method stub
    return false;
  }

  @Override
  public boolean isAccountNonLocked() {
    // TODO Auto-generated method stub
    return false;
  }

  @Override
  public boolean isCredentialsNonExpired() {
    // TODO Auto-generated method stub
    return false;
  }

  @Override
  public boolean isEnabled() {
    // TODO Auto-generated method stub
    return false;
  }

  @Override
  public int hashCode() {
    final int prime = 31;
    int result = 1;
    result = prime * result + (int) (id ^ (id >>> 32));
    return result;
  }

  @Override
  public boolean equals(Object obj) {
    if (this == obj)
      return true;
    if (obj == null)
      return false;
    if (getClass() != obj.getClass())
      return false;
    User other = (User) obj;
    if (id != other.id)
      return false;
    return true;
  }

}

@@ -721,16 +721,98 @@
 ng id;%0A%0A
+  private String email;%0A%0A  private String firstName;%0A%0A  private String lastName;%0A%0A
   public
@@ -897,24 +897,426 @@
  = id;%0A  %7D%0A%0A
+  public String getEmail() %7B%0A    return email;%0A  %7D%0A%0A  public void setEmail(String email) %7B%0A    this.email = email;%0A  %7D%0A%0A  public String getFirstName() %7B%0A    return firstName;%0A  %7D%0A%0A  public void setFirstName(String firstName) %7B%0A    this.firstName = firstName;%0A  %7D%0A%0A  public String getLastName() %7B%0A    return lastName;%0A  %7D%0A%0A  public void setLastName(String lastName) %7B%0A    this.lastName = lastName;%0A  %7D%0A%0A
   @Override%0A
@@ -2225,29 +2225,45 @@
  + (
-int) (id %5E (id %3E%3E%3E 32
+(email == null) ? 0 : email.hashCode(
 ));%0A
@@ -2516,22 +2516,123 @@
 if (
-id != other.id
+email == null) %7B%0A      if (other.email != null)%0A        return false;%0A    %7D%0A    else if (!email.equals(other.email)
 )%0A  

add table fields to the user object.