Summary Table
Categories |
Total Count |
PII |
0 |
URL |
0 |
DNS |
0 |
EKL |
0 |
IP |
0 |
PORT |
0 |
VsID |
0 |
CF |
0 |
AI |
0 |
VPD |
0 |
PL |
0 |
Other |
0 |
File Content
/*
* Event.java
* Copyright (c) 2017 Veterans Affairs.
*/
/*
* Event.java
* Copyright (c) 2017 Veterans Affairs.
*/
package gov.va.oneconsult.seoc.api.model;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
/**
* Description: Event entity that has lookup values for actions to be logged.
*
* @author AbleVets
*
*/
@Entity
@Table(name = "Event")
public class Event
{
/**
* Id. Auto generated value. Guaranteed to be not null.
*/
@Id
@Column(name = "id")
@GeneratedValue(strategy = GenerationType.AUTO)
@NotNull
private int id;
/**
* Action.
*/
@Column(name = "action")
@Size(max = 50, message = "Action should not exceed 50 characters")
private String action;
/**
* Description
*/
@Column(name = "description")
@Size(max = 250, message = "Description should not exceed 250 characters")
private String description;
/**
* List {@link ChangeLog} of
*/
@OneToMany(mappedBy = "event", cascade = { CascadeType.DETACH, CascadeType.PERSIST,
CascadeType.REMOVE })
//private List<ChangeLog> logs;
/**
* Description: Get the Id value
*
* @return - Id
*/
public int getId()
{
return id;
}
/**
* Description: Set the Id value
*
* @param id
* - Id
*/
public void setId(int id)
{
this.id = id;
}
/**
* Description: Get the action value
*
* @return - action
*/
public String getAction()
{
return action;
}
/**
* Description: Set the action value
*
* @param action
*/
public void setAction(String action)
{
this.action = action;
}
/**
* Description: Get the description value
*
* @return value
*/
public String getDescription()
{
return description;
}
/**
* Description: Set the description value
*
* @param description
*/
public void setDescription(String description)
{
this.description = description;
}
/**
* {@inheritDoc}
*/
@Override
public int hashCode()
{
final int prime = 31;
int result = 1;
result = prime * result + ((action == null) ? 0 : action.hashCode());
result = prime * result + ((description == null) ? 0 : description.hashCode());
result = prime * result + id;
return result;
}
/**
* {@inheritDoc}
*/
@Override
public boolean equals(Object obj)
{
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Event other = (Event) obj;
if (action == null)
{
if (other.action != null)
return false;
} else if (!action.equals(other.action))
return false;
if (description == null)
{
if (other.description != null)
return false;
} else if (!description.equals(other.description))
return false;
if (id != other.id)
return false;
return true;
}
@Override
public String toString()
{
return "Event [id=" + id + ", action=" + action + ", decription=" + description + "]";
}
}