Java tutorial
/** * The contents of this file are subject to the license and copyright * detailed in the LICENSE and NOTICE files at the root of the source * tree and available online at * * http://www.dspace.org/license/ */ package org.dspace.orm.entity; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.SequenceGenerator; import javax.persistence.Table; import javax.persistence.Transient; import org.dspace.orm.dao.content.DSpaceObjectType; import org.springframework.beans.factory.annotation.Configurable; /** * @author Miguel Pinto <mpinto@lyncode.com> * @version $Revision$ */ @Entity @Table(name = "registrationdata") @SequenceGenerator(name = "registrationdata_gen", sequenceName = "registrationdata_seq") @Configurable public class RegistrationData extends DSpaceObject { private String email; private String token; private Date expires; @Id @Column(name = "registrationdata_id") @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "registrationdata_gen") public int getID() { return id; } @Override @Transient public DSpaceObjectType getType() { return DSpaceObjectType.RESOURCE_POLICY; } @Column(name = "email", nullable = true) public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } @Column(name = "token", nullable = true) public String getToken() { return token; } public void setToken(String token) { this.token = token; } @Column(name = "expires", nullable = true) public Date getExpires() { return expires; } public void setExpires(Date expires) { this.expires = expires; } }