/*
* #%L
* BroadleafCommerce Open Admin Platform
* %%
* Copyright (C) 2009 - 2013 Broadleaf Commerce
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
package org.broadleafcommerce.openadmin.server.security.domain;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
/**
* Created by bpolster.
*/
@Entity
@Inheritance(strategy = InheritanceType.JOINED)
@Table(name = "BLC_ADMIN_PASSWORD_TOKEN")
public class ForgotPasswordSecurityTokenImpl implements ForgotPasswordSecurityToken {
private static final long serialVersionUID = 1L;
@Id
@Column(name = "PASSWORD_TOKEN", nullable = false)
protected String token;
@Column(name = "CREATE_DATE", nullable = false)
@Temporal(TemporalType.TIMESTAMP)
protected Date createDate;
@Column(name = "TOKEN_USED_DATE")
@Temporal(TemporalType.TIMESTAMP)
protected Date tokenUsedDate;
@Column(name = "ADMIN_USER_ID", nullable = false)
protected Long adminUserId;
@Column(name = "TOKEN_USED_FLAG", nullable = false)
protected boolean tokenUsedFlag;
public String getToken() {
return token;
}
public void setToken(String token) {
this.token = token;
}
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
public Date getTokenUsedDate() {
return tokenUsedDate;
}
public void setTokenUsedDate(Date tokenUsedDate) {
this.tokenUsedDate = tokenUsedDate;
}
public Long getAdminUserId() {
return adminUserId;
}
public void setAdminUserId(Long adminUserId) {
this.adminUserId = adminUserId;
}
public boolean isTokenUsedFlag() {
return tokenUsedFlag;
}
public void setTokenUsedFlag(boolean tokenUsedFlag) {
this.tokenUsedFlag = tokenUsedFlag;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null) return false;
if (!getClass().isAssignableFrom(o.getClass())) return false;
ForgotPasswordSecurityTokenImpl that = (ForgotPasswordSecurityTokenImpl) o;
if (token != null ? !token.equals(that.token) : that.token != null) return false;
return true;
}
@Override
public int hashCode() {
return token != null ? token.hashCode() : 0;
}
}