UserSession.java

/**
 * org.uoc.tfg.sel.repository.model2020 e-Learning for Schools
 * Copyright (C) 2020  EUserSessionRodriguez Carro
 *
 * 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
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package org.uoc.tfg.sel.repository.model;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * Sesiones registradas de los usuarios.
 *
 * @author Eduardo Rodriguez Carro
 */
@Entity
@Table(name = "session")
public class UserSession {
	
	/** The id. */
	@Id
	@NotNull
	@Size(min = 1,max = 64)
	private String id;
	
	/** The created. */
	@NotNull
	@Min(1577836800)
	private Long created;
	
	/** The updated. */
	@NotNull
	@Min(1577836800)
	private Long updated;

	/**
	 * Gets the id.
	 *
	 * @return the id
	 */
	public String getId() {
		return id;
	}

	/**
	 * Sets the id.
	 *
	 * @param id the new id
	 */
	public void setId(String id) {
		this.id = id;
	}

	/**
	 * Gets the created.
	 *
	 * @return the created
	 */
	public Long getCreated() {
		return created;
	}

	/**
	 * Sets the created.
	 *
	 * @param created the new created
	 */
	public void setCreated(Long created) {
		this.created = created;
	}

	/**
	 * Gets the updated.
	 *
	 * @return the updated
	 */
	public Long getUpdated() {
		return updated;
	}

	/**
	 * Sets the updated.
	 *
	 * @param updated the new updated
	 */
	public void setUpdated(Long updated) {
		this.updated = updated;
	}

	/**
	 * To string.
	 *
	 * @return the string
	 */
	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("UserSession [id=").append(id).append(", created=").append(created).append(", updated=")
				.append(updated).append("]");
		return builder.toString();
	}
	
}