org.wallride.domain.UserInvitation Maven / Gradle / Ivy
/*
* Copyright 2014 Tagbangers, Inc.
*
* 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.
*/
package org.wallride.domain;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*;
import java.time.LocalDateTime;
@Entity
@Table(name="user_invitation")
@DynamicInsert
@DynamicUpdate
@SuppressWarnings("serial")
public class UserInvitation extends DomainObject {
@Id
@GeneratedValue(generator = "system-uuid")
@GenericGenerator(name="system-uuid", strategy="uuid2")
@Column(length=50)
private String token;
@Column(length=500, nullable=false)
private String email;
@Lob
private String message;
@Column(nullable=false)
private LocalDateTime expiredAt;
@Column(nullable=false)
private boolean accepted;
private LocalDateTime acceptedAt;
@Override
public String getId() {
return getToken();
}
public String getToken() {
return token;
}
public void setToken(String token) {
this.token = token;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public LocalDateTime getExpiredAt() {
return expiredAt;
}
public void setExpiredAt(LocalDateTime expiredAt) {
this.expiredAt = expiredAt;
}
public boolean isAccepted() {
return accepted;
}
public void setAccepted(boolean accepted) {
this.accepted = accepted;
}
public LocalDateTime getAcceptedAt() {
return acceptedAt;
}
public void setAcceptedAt(LocalDateTime acceptedAt) {
this.acceptedAt = acceptedAt;
}
@Override
public String print() {
return getEmail();
}
}