Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • DM/dm-docs
  • hammonds/dm-docs
  • hparraga/dm-docs
3 results
Show changes
Showing
with 1791 additions and 0 deletions
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package gov.anl.aps.dm.portal.model.beans;
import gov.anl.aps.dm.portal.model.entities.PolicyType;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.NoResultException;
import javax.persistence.PersistenceContext;
/**
*
* @author sveseli
*/
@Stateless
public class PolicyTypeDbFacade extends DmEntityDbFacade<PolicyType>
{
@PersistenceContext(unitName = "DmWebPortalPU")
private EntityManager em;
@Override
protected EntityManager getEntityManager() {
return em;
}
public PolicyTypeDbFacade() {
super(PolicyType.class);
}
public PolicyType findByName(String name) {
try {
return (PolicyType) em.createNamedQuery("PolicyType.findByName")
.setParameter("name", name)
.getSingleResult();
} catch (NoResultException ex) {
}
return null;
}
public PolicyType findById(int id) {
try {
return (PolicyType) em.createNamedQuery("PolicyType.findById")
.setParameter("id", id)
.getSingleResult();
} catch (NoResultException ex) {
}
return null;
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package gov.anl.aps.dm.portal.model.beans;
import gov.anl.aps.dm.portal.model.entities.SettingType;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
/**
*
* @author sveseli
*/
@Stateless
public class SettingTypeDbFacade extends DmEntityDbFacade<SettingType>
{
@PersistenceContext(unitName = "DmWebPortalPU")
private EntityManager em;
@Override
protected EntityManager getEntityManager() {
return em;
}
public SettingTypeDbFacade() {
super(SettingType.class);
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package gov.anl.aps.dm.portal.model.beans;
import gov.anl.aps.dm.portal.model.entities.Storage;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
/**
*
* @author sveseli
*/
@Stateless
public class StorageDbFacade extends DmEntityDbFacade<Storage> {
@PersistenceContext(unitName = "DmWebPortalPU")
private EntityManager em;
@Override
protected EntityManager getEntityManager() {
return em;
}
public StorageDbFacade() {
super(Storage.class);
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package gov.anl.aps.dm.portal.model.beans;
import gov.anl.aps.dm.portal.model.entities.SystemRoleType;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.NoResultException;
import javax.persistence.PersistenceContext;
/**
*
* @author sveseli
*/
@Stateless
public class SystemRoleTypeDbFacade extends DmEntityDbFacade<SystemRoleType> {
public static final String ADMINISTRATOR_ROLE = "Administrator";
public static final String MANAGER_ROLE = "Manager";
@PersistenceContext(unitName = "DmWebPortalPU")
private EntityManager em;
@Override
protected EntityManager getEntityManager() {
return em;
}
public SystemRoleTypeDbFacade() {
super(SystemRoleType.class);
}
public SystemRoleType findById(Integer id) {
try {
return (SystemRoleType) em.createNamedQuery("SystemRoleType.findById")
.setParameter("id", id)
.getSingleResult();
}
catch (NoResultException ex) {
}
return null;
}
public SystemRoleType findAdministratorRoleType() {
try {
return (SystemRoleType) em.createNamedQuery("SystemRoleType.findByName")
.setParameter("name", ADMINISTRATOR_ROLE)
.getSingleResult();
}
catch (NoResultException ex) {
}
return null;
}
public SystemRoleType findManagerRoleType() {
try {
return (SystemRoleType) em.createNamedQuery("SystemRoleType.findByName")
.setParameter("name", MANAGER_ROLE)
.getSingleResult();
}
catch (NoResultException ex) {
}
return null;
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package gov.anl.aps.dm.portal.model.beans;
import gov.anl.aps.dm.portal.model.entities.UserExperimentRole;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.NoResultException;
import javax.persistence.PersistenceContext;
/**
*
* @author sveseli
*/
@Stateless
public class UserExperimentRoleDbFacade extends DmEntityDbFacade<UserExperimentRole> {
@PersistenceContext(unitName = "DmWebPortalPU")
private EntityManager em;
@Override
protected EntityManager getEntityManager() {
return em;
}
public UserExperimentRoleDbFacade() {
super(UserExperimentRole.class);
}
public UserExperimentRole findByUserAndExperiment(int userId, int experimentId) {
try {
return (UserExperimentRole) em.createNamedQuery("UserExperimentRole.findByUserAndExperiment")
.setParameter("userId", userId)
.setParameter("experimentId", experimentId)
.getSingleResult();
} catch (NoResultException ex) {
}
return null;
}
public UserExperimentRole findByUserAndExperimentAndRoleType(int userId, int experimentId, int roleTypeId) {
try {
return (UserExperimentRole) em.createNamedQuery("UserExperimentRole.findByUserAndExperimentAndRoleType")
.setParameter("userId", userId)
.setParameter("experimentId", experimentId)
.setParameter("roleTypeId", roleTypeId)
.getSingleResult();
} catch (NoResultException ex) {
}
return null;
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package gov.anl.aps.dm.portal.model.beans;
import gov.anl.aps.dm.portal.model.entities.UserInfo;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.NoResultException;
import javax.persistence.PersistenceContext;
/**
*
* @author sveseli
*/
@Stateless
public class UserInfoDbFacade extends DmEntityDbFacade<UserInfo> {
@PersistenceContext(unitName = "DmWebPortalPU")
private EntityManager em;
@Override
protected EntityManager getEntityManager() {
return em;
}
public UserInfoDbFacade() {
super(UserInfo.class);
}
public UserInfo findByUsername(String username) {
try {
return (UserInfo) em.createNamedQuery("UserInfo.findByUsername")
.setParameter("username", username)
.getSingleResult();
} catch (NoResultException ex) {
}
return null;
}
public UserInfo findById(Integer id) {
try {
return (UserInfo) em.createNamedQuery("UserInfo.findById")
.setParameter("id", id)
.getSingleResult();
} catch (NoResultException ex) {
}
return null;
}
public boolean checkIfUsernameExists(String username) {
return findByUsername(username) != null;
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package gov.anl.aps.dm.portal.model.beans;
import gov.anl.aps.dm.portal.model.entities.UserSetting;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
/**
*
* @author sveseli
*/
@Stateless
public class UserSettingDbFacade extends DmEntityDbFacade<UserSetting>
{
@PersistenceContext(unitName = "DmWebPortalPU")
private EntityManager em;
@Override
protected EntityManager getEntityManager() {
return em;
}
public UserSettingDbFacade() {
super(UserSetting.class);
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package gov.anl.aps.dm.portal.model.beans;
import gov.anl.aps.dm.portal.model.entities.UserSystemRole;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.NoResultException;
import javax.persistence.PersistenceContext;
/**
*
* @author sveseli
*/
@Stateless
public class UserSystemRoleDbFacade extends DmEntityDbFacade<UserSystemRole> {
@PersistenceContext(unitName = "DmWebPortalPU")
private EntityManager em;
@Override
protected EntityManager getEntityManager() {
return em;
}
public UserSystemRoleDbFacade() {
super(UserSystemRole.class);
}
public UserSystemRole findByUserAndRoleTypeAndExperimentStation(int userId, int roleTypeId, int experimentStationId) {
try {
return (UserSystemRole) em.createNamedQuery("UserSystemRole.findByUserAndRoleTypeAndExperimentStation")
.setParameter("userId", userId)
.setParameter("roleTypeId", roleTypeId)
.setParameter("experimentStationId", experimentStationId)
.getSingleResult();
} catch (NoResultException ex) {
}
return null;
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package gov.anl.aps.dm.portal.model.beans;
import gov.anl.aps.dm.portal.model.entities.UsersLastUpdate;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
/**
*
* @author sveseli
*/
@Stateless
public class UsersLastUpdateDbFacade extends DmEntityDbFacade<UsersLastUpdate> {
@PersistenceContext(unitName = "DmWebPortalPU")
private EntityManager em;
@Override
protected EntityManager getEntityManager() {
return em;
}
public UsersLastUpdateDbFacade() {
super(UsersLastUpdate.class);
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package gov.anl.aps.dm.portal.model.entities;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
/**
*
* @author sveseli
*/
@Entity
@Table(name = "allowed_policy_value")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "AllowedPolicyValue.findAll", query = "SELECT a FROM AllowedPolicyValue a")
, @NamedQuery(name = "AllowedPolicyValue.findById", query = "SELECT a FROM AllowedPolicyValue a WHERE a.id = :id")
, @NamedQuery(name = "AllowedPolicyValue.findByPolicyValue", query = "SELECT a FROM AllowedPolicyValue a WHERE a.policyValue = :policyValue")
, @NamedQuery(name = "AllowedPolicyValue.findByDescription", query = "SELECT a FROM AllowedPolicyValue a WHERE a.description = :description")})
public class AllowedPolicyValue extends DmEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
private Integer id;
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 2147483647)
@Column(name = "policy_value")
private String policyValue;
@Size(max = 2147483647)
private String description;
@JoinColumn(name = "policy_property_id", referencedColumnName = "id")
@ManyToOne(optional = false)
private PolicyProperty policyPropertyId;
public AllowedPolicyValue() {
}
public AllowedPolicyValue(Integer id) {
this.id = id;
}
public AllowedPolicyValue(Integer id, String policyValue) {
this.id = id;
this.policyValue = policyValue;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getPolicyValue() {
return policyValue;
}
public void setPolicyValue(String policyValue) {
this.policyValue = policyValue;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public PolicyProperty getPolicyPropertyId() {
return policyPropertyId;
}
public void setPolicyPropertyId(PolicyProperty policyPropertyId) {
this.policyPropertyId = policyPropertyId;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof AllowedPolicyValue)) {
return false;
}
AllowedPolicyValue other = (AllowedPolicyValue) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "gov.anl.aps.dm.portal.model.entities2.AllowedPolicyValue[ id=" + id + " ]";
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package gov.anl.aps.dm.portal.model.entities;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
/**
*
* @author sveseli
*/
@Entity
@Table(name = "allowed_setting_value")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "AllowedSettingValue.findAll", query = "SELECT a FROM AllowedSettingValue a")
, @NamedQuery(name = "AllowedSettingValue.findById", query = "SELECT a FROM AllowedSettingValue a WHERE a.id = :id")
, @NamedQuery(name = "AllowedSettingValue.findBySettingValue", query = "SELECT a FROM AllowedSettingValue a WHERE a.settingValue = :settingValue")
, @NamedQuery(name = "AllowedSettingValue.findByDescription", query = "SELECT a FROM AllowedSettingValue a WHERE a.description = :description")})
public class AllowedSettingValue extends DmEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
private Integer id;
@Size(max = 2147483647)
@Column(name = "setting_value")
private String settingValue;
@Size(max = 2147483647)
private String description;
@JoinColumn(name = "setting_type_id", referencedColumnName = "id")
@ManyToOne(optional = false)
private SettingType settingTypeId;
public AllowedSettingValue() {
}
public AllowedSettingValue(Integer id) {
this.id = id;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getSettingValue() {
return settingValue;
}
public void setSettingValue(String settingValue) {
this.settingValue = settingValue;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public SettingType getSettingTypeId() {
return settingTypeId;
}
public void setSettingTypeId(SettingType settingTypeId) {
this.settingTypeId = settingTypeId;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof AllowedSettingValue)) {
return false;
}
AllowedSettingValue other = (AllowedSettingValue) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "gov.anl.aps.dm.portal.model.entities2.AllowedSettingValue[ id=" + id + " ]";
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package gov.anl.aps.dm.portal.model.entities;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
/**
*
* @author sveseli
*/
@Entity
@Table(name = "data_folder")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "DataFolder.findAll", query = "SELECT d FROM DataFolder d")
, @NamedQuery(name = "DataFolder.findById", query = "SELECT d FROM DataFolder d WHERE d.id = :id")
, @NamedQuery(name = "DataFolder.findByDataPath", query = "SELECT d FROM DataFolder d WHERE d.dataPath = :dataPath")
, @NamedQuery(name = "DataFolder.findByDescription", query = "SELECT d FROM DataFolder d WHERE d.description = :description")})
public class DataFolder extends DmEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
private Integer id;
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 2147483647)
@Column(name = "data_path")
private String dataPath;
@Size(max = 2147483647)
private String description;
@JoinColumn(name = "experiment_id", referencedColumnName = "id")
@ManyToOne(optional = false)
private Experiment experimentId;
@JoinColumn(name = "storage_id", referencedColumnName = "id")
@ManyToOne(optional = false)
private Storage storageId;
public DataFolder() {
}
public DataFolder(Integer id) {
this.id = id;
}
public DataFolder(Integer id, String dataPath) {
this.id = id;
this.dataPath = dataPath;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getDataPath() {
return dataPath;
}
public void setDataPath(String dataPath) {
this.dataPath = dataPath;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Experiment getExperimentId() {
return experimentId;
}
public void setExperimentId(Experiment experimentId) {
this.experimentId = experimentId;
}
public Storage getStorageId() {
return storageId;
}
public void setStorageId(Storage storageId) {
this.storageId = storageId;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof DataFolder)) {
return false;
}
DataFolder other = (DataFolder) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "gov.anl.aps.dm.portal.model.entities2.DataFolder[ id=" + id + " ]";
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package gov.anl.aps.dm.portal.model.entities;
import gov.anl.aps.dm.portal.utilities.SearchResult;
import java.io.Serializable;
import java.util.regex.Pattern;
/**
*
* @author sveseli
*/
public class DmEntity implements Serializable, Cloneable
{
protected static final long serialVersionUID = 1L;
@Override
public Object clone() throws CloneNotSupportedException {
return super.clone();
}
public Object getId() {
return null;
}
public SearchResult search(Pattern searchPattern) {
return null;
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package gov.anl.aps.dm.portal.model.entities;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
/**
*
* @author sveseli
*/
@Entity
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "Endpoint.findAll", query = "SELECT e FROM Endpoint e")
, @NamedQuery(name = "Endpoint.findById", query = "SELECT e FROM Endpoint e WHERE e.id = :id")
, @NamedQuery(name = "Endpoint.findByName", query = "SELECT e FROM Endpoint e WHERE e.name = :name")
, @NamedQuery(name = "Endpoint.findByAccessUrl", query = "SELECT e FROM Endpoint e WHERE e.accessUrl = :accessUrl")
, @NamedQuery(name = "Endpoint.findByDescription", query = "SELECT e FROM Endpoint e WHERE e.description = :description")})
public class Endpoint extends DmEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
private Integer id;
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 2147483647)
private String name;
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 2147483647)
@Column(name = "access_url")
private String accessUrl;
@Size(max = 2147483647)
private String description;
@JoinColumn(name = "storage_id", referencedColumnName = "id")
@ManyToOne(optional = false)
private Storage storageId;
public Endpoint() {
}
public Endpoint(Integer id) {
this.id = id;
}
public Endpoint(Integer id, String name, String accessUrl) {
this.id = id;
this.name = name;
this.accessUrl = accessUrl;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAccessUrl() {
return accessUrl;
}
public void setAccessUrl(String accessUrl) {
this.accessUrl = accessUrl;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Storage getStorageId() {
return storageId;
}
public void setStorageId(Storage storageId) {
this.storageId = storageId;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Endpoint)) {
return false;
}
Endpoint other = (Endpoint) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "gov.anl.aps.dm.portal.model.entities2.Endpoint[ id=" + id + " ]";
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package gov.anl.aps.dm.portal.model.entities;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
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.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
/**
*
* @author sveseli
*/
@Entity
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "Experiment.findAll", query = "SELECT e FROM Experiment e")
, @NamedQuery(name = "Experiment.findById", query = "SELECT e FROM Experiment e WHERE e.id = :id")
, @NamedQuery(name = "Experiment.findByName", query = "SELECT e FROM Experiment e WHERE e.name = :name")
, @NamedQuery(name = "Experiment.findByDescription", query = "SELECT e FROM Experiment e WHERE e.description = :description")
, @NamedQuery(name = "Experiment.findByStartDate", query = "SELECT e FROM Experiment e WHERE e.startDate = :startDate")
, @NamedQuery(name = "Experiment.findByEndDate", query = "SELECT e FROM Experiment e WHERE e.endDate = :endDate")})
public class Experiment extends DmEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
private Integer id;
@Basic(optional = false)
@NotNull
private String name;
private String description;
@Column(name = "start_date")
@Temporal(TemporalType.TIMESTAMP)
private Date startDate;
@Column(name = "end_date")
@Temporal(TemporalType.TIMESTAMP)
private Date endDate;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "experiment")
private List<UserExperimentRole> userExperimentRoleList;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "experimentId")
private List<DataFolder> dataFolderList;
@JoinColumn(name = "experiment_station_id", referencedColumnName = "id")
@ManyToOne(optional = false)
private ExperimentStation experimentStation;
@JoinColumn(name = "experiment_type_id", referencedColumnName = "id")
@ManyToOne(optional = false)
private ExperimentType experimentType;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "experimentId")
private List<ExperimentPolicy> experimentPolicyList;
public Experiment() {
}
public Experiment(Integer id) {
this.id = id;
}
public Experiment(Integer id, String name) {
this.id = id;
this.name = name;
}
@Override
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Date getStartDate() {
return startDate;
}
public void setStartDate(Date startDate) {
this.startDate = startDate;
}
public Date getEndDate() {
return endDate;
}
public void setEndDate(Date endDate) {
this.endDate = endDate;
}
@XmlTransient
public List<UserExperimentRole> getUserExperimentRoleList() {
return userExperimentRoleList;
}
public void setUserExperimentRoleList(List<UserExperimentRole> userExperimentRoleList) {
this.userExperimentRoleList = userExperimentRoleList;
}
@XmlTransient
public List<DataFolder> getDataFolderList() {
return dataFolderList;
}
public void setDataFolderList(List<DataFolder> dataFolderList) {
this.dataFolderList = dataFolderList;
}
public ExperimentStation getExperimentStation() {
return experimentStation;
}
public void setExperimentStation(ExperimentStation experimentStation) {
this.experimentStation = experimentStation;
}
public ExperimentType getExperimentType() {
return experimentType;
}
public void setExperimentType(ExperimentType experimentType) {
this.experimentType = experimentType;
}
@XmlTransient
public List<ExperimentPolicy> getExperimentPolicyList() {
return experimentPolicyList;
}
public void setExperimentPolicyList(List<ExperimentPolicy> experimentPolicyList) {
this.experimentPolicyList = experimentPolicyList;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Experiment)) {
return false;
}
Experiment other = (Experiment) object;
return !((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id)));
}
@Override
public String toString() {
return "gov.anl.aps.dm.portal.model.entities2.Experiment[ id=" + id + " ]";
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package gov.anl.aps.dm.portal.model.entities;
import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
/**
*
* @author sveseli
*/
@Entity
@Table(name = "experiment_policy")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "ExperimentPolicy.findAll", query = "SELECT e FROM ExperimentPolicy e")
, @NamedQuery(name = "ExperimentPolicy.findById", query = "SELECT e FROM ExperimentPolicy e WHERE e.id = :id")})
public class ExperimentPolicy extends DmEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
private Integer id;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "experimentPolicyId")
private List<ExperimentPolicyPropertyValue> experimentPolicyPropertyValueList;
@JoinColumn(name = "experiment_id", referencedColumnName = "id")
@ManyToOne(optional = false)
private Experiment experimentId;
@JoinColumn(name = "policy_type_id", referencedColumnName = "id")
@ManyToOne(optional = false)
private PolicyType policyTypeId;
public ExperimentPolicy() {
}
public ExperimentPolicy(Integer id) {
this.id = id;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
@XmlTransient
public List<ExperimentPolicyPropertyValue> getExperimentPolicyPropertyValueList() {
return experimentPolicyPropertyValueList;
}
public void setExperimentPolicyPropertyValueList(List<ExperimentPolicyPropertyValue> experimentPolicyPropertyValueList) {
this.experimentPolicyPropertyValueList = experimentPolicyPropertyValueList;
}
public Experiment getExperimentId() {
return experimentId;
}
public void setExperimentId(Experiment experimentId) {
this.experimentId = experimentId;
}
public PolicyType getPolicyTypeId() {
return policyTypeId;
}
public void setPolicyTypeId(PolicyType policyTypeId) {
this.policyTypeId = policyTypeId;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof ExperimentPolicy)) {
return false;
}
ExperimentPolicy other = (ExperimentPolicy) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "gov.anl.aps.dm.portal.model.entities2.ExperimentPolicy[ id=" + id + " ]";
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package gov.anl.aps.dm.portal.model.entities;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
/**
*
* @author sveseli
*/
@Entity
@Table(name = "experiment_policy_property_value")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "ExperimentPolicyPropertyValue.findAll", query = "SELECT e FROM ExperimentPolicyPropertyValue e")
, @NamedQuery(name = "ExperimentPolicyPropertyValue.findById", query = "SELECT e FROM ExperimentPolicyPropertyValue e WHERE e.id = :id")
, @NamedQuery(name = "ExperimentPolicyPropertyValue.findByModifiedBy", query = "SELECT e FROM ExperimentPolicyPropertyValue e WHERE e.modifiedBy = :modifiedBy")
, @NamedQuery(name = "ExperimentPolicyPropertyValue.findByModifiedDate", query = "SELECT e FROM ExperimentPolicyPropertyValue e WHERE e.modifiedDate = :modifiedDate")
, @NamedQuery(name = "ExperimentPolicyPropertyValue.findByPolicyPropertyValue", query = "SELECT e FROM ExperimentPolicyPropertyValue e WHERE e.policyPropertyValue = :policyPropertyValue")})
public class ExperimentPolicyPropertyValue extends DmEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
private Integer id;
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 2147483647)
@Column(name = "modified_by")
private String modifiedBy;
@Basic(optional = false)
@NotNull
@Column(name = "modified_date")
@Temporal(TemporalType.DATE)
private Date modifiedDate;
@Size(max = 2147483647)
@Column(name = "policy_property_value")
private String policyPropertyValue;
@JoinColumn(name = "experiment_policy_id", referencedColumnName = "id")
@ManyToOne(optional = false)
private ExperimentPolicy experimentPolicyId;
@JoinColumn(name = "policy_property_id", referencedColumnName = "id")
@ManyToOne(optional = false)
private PolicyProperty policyPropertyId;
public ExperimentPolicyPropertyValue() {
}
public ExperimentPolicyPropertyValue(Integer id) {
this.id = id;
}
public ExperimentPolicyPropertyValue(Integer id, String modifiedBy, Date modifiedDate) {
this.id = id;
this.modifiedBy = modifiedBy;
this.modifiedDate = modifiedDate;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getModifiedBy() {
return modifiedBy;
}
public void setModifiedBy(String modifiedBy) {
this.modifiedBy = modifiedBy;
}
public Date getModifiedDate() {
return modifiedDate;
}
public void setModifiedDate(Date modifiedDate) {
this.modifiedDate = modifiedDate;
}
public String getPolicyPropertyValue() {
return policyPropertyValue;
}
public void setPolicyPropertyValue(String policyPropertyValue) {
this.policyPropertyValue = policyPropertyValue;
}
public ExperimentPolicy getExperimentPolicyId() {
return experimentPolicyId;
}
public void setExperimentPolicyId(ExperimentPolicy experimentPolicyId) {
this.experimentPolicyId = experimentPolicyId;
}
public PolicyProperty getPolicyPropertyId() {
return policyPropertyId;
}
public void setPolicyPropertyId(PolicyProperty policyPropertyId) {
this.policyPropertyId = policyPropertyId;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof ExperimentPolicyPropertyValue)) {
return false;
}
ExperimentPolicyPropertyValue other = (ExperimentPolicyPropertyValue) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "gov.anl.aps.dm.portal.model.entities2.ExperimentPolicyPropertyValue[ id=" + id + " ]";
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package gov.anl.aps.dm.portal.model.entities;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
/**
*
* @author sveseli
*/
@Entity
@Table(name = "experiment_role_type")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "ExperimentRoleType.findAll", query = "SELECT e FROM ExperimentRoleType e")
, @NamedQuery(name = "ExperimentRoleType.findById", query = "SELECT e FROM ExperimentRoleType e WHERE e.id = :id")
, @NamedQuery(name = "ExperimentRoleType.findByName", query = "SELECT e FROM ExperimentRoleType e WHERE e.name = :name")
, @NamedQuery(name = "ExperimentRoleType.findByDescription", query = "SELECT e FROM ExperimentRoleType e WHERE e.description = :description")
})
public class ExperimentRoleType extends DmEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
private Integer id;
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 2147483647)
private String name;
@Size(max = 2147483647)
private String description;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "experimentRoleType")
private List<UserExperimentRole> userExperimentRoleList;
public ExperimentRoleType() {
}
public ExperimentRoleType(Integer id) {
this.id = id;
}
public ExperimentRoleType(Integer id, String name) {
this.id = id;
this.name = name;
}
@Override
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
@XmlTransient
public List<UserExperimentRole> getUserExperimentRoleList() {
return userExperimentRoleList;
}
public void setUserExperimentRoleList(List<UserExperimentRole> userExperimentRoleList) {
this.userExperimentRoleList = userExperimentRoleList;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof ExperimentRoleType)) {
return false;
}
ExperimentRoleType other = (ExperimentRoleType) object;
return !((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id)));
}
@Override
public String toString() {
return "gov.anl.aps.dm.portal.model.entities2.ExperimentRoleType[ id=" + id + " ]";
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package gov.anl.aps.dm.portal.model.entities;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
/**
*
* @author sveseli
*/
@Entity
@Table(name = "experiment_station")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "ExperimentStation.findAll", query = "SELECT e FROM ExperimentStation e")
, @NamedQuery(name = "ExperimentStation.findById", query = "SELECT e FROM ExperimentStation e WHERE e.id = :id")
, @NamedQuery(name = "ExperimentStation.findByName", query = "SELECT e FROM ExperimentStation e WHERE e.name = :name")
, @NamedQuery(name = "ExperimentStation.findByDescription", query = "SELECT e FROM ExperimentStation e WHERE e.description = :description")
})
public class ExperimentStation extends DmEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
private Integer id;
@Basic(optional = false)
@NotNull
private String name;
private String description;
@JoinTable(name = "allowed_experiment_station_experiment_type", joinColumns = {
@JoinColumn(name = "experiment_station_id", referencedColumnName = "id")}, inverseJoinColumns = {
@JoinColumn(name = "experiment_type_id", referencedColumnName = "id")})
@ManyToMany
private List<ExperimentType> experimentTypeList;
@OneToMany(mappedBy = "experimentStation")
private List<UserSystemRole> userSystemRoleList;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "experimentStation")
private List<Experiment> experimentList;
public ExperimentStation() {
}
public ExperimentStation(Integer id) {
this.id = id;
}
public ExperimentStation(Integer id, String name) {
this.id = id;
this.name = name;
}
@Override
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
@XmlTransient
public List<ExperimentType> getExperimentTypeList() {
return experimentTypeList;
}
public void setExperimentTypeList(List<ExperimentType> experimentTypeList) {
this.experimentTypeList = experimentTypeList;
}
@XmlTransient
public List<UserSystemRole> getUserSystemRoleList() {
return userSystemRoleList;
}
public void setUserSystemRoleList(List<UserSystemRole> userSystemRoleList) {
this.userSystemRoleList = userSystemRoleList;
}
@XmlTransient
public List<Experiment> getExperimentList() {
return experimentList;
}
public void setExperimentList(List<Experiment> experimentList) {
this.experimentList = experimentList;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof ExperimentStation)) {
return false;
}
ExperimentStation other = (ExperimentStation) object;
return !((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id)));
}
@Override
public String toString() {
return "gov.anl.aps.dm.portal.model.entities2.ExperimentStation[ id=" + id + " ]";
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package gov.anl.aps.dm.portal.model.entities;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
/**
*
* @author sveseli
*/
@Entity
@Table(name = "experiment_type")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "ExperimentType.findAll", query = "SELECT e FROM ExperimentType e")
, @NamedQuery(name = "ExperimentType.findById", query = "SELECT e FROM ExperimentType e WHERE e.id = :id")
, @NamedQuery(name = "ExperimentType.findByName", query = "SELECT e FROM ExperimentType e WHERE e.name = :name")
, @NamedQuery(name = "ExperimentType.findByDescription", query = "SELECT e FROM ExperimentType e WHERE e.description = :description")})
public class ExperimentType extends DmEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
private Integer id;
@Basic(optional = false)
@NotNull
private String name;
private String description;
@ManyToMany(mappedBy = "experimentTypeList")
private List<ExperimentStation> experimentStationList;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "experimentType")
private List<Experiment> experimentList;
public ExperimentType() {
}
public ExperimentType(Integer id) {
this.id = id;
}
public ExperimentType(Integer id, String name) {
this.id = id;
this.name = name;
}
@Override
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
@XmlTransient
public List<ExperimentStation> getExperimentStationList() {
return experimentStationList;
}
public void setExperimentStationList(List<ExperimentStation> experimentStationList) {
this.experimentStationList = experimentStationList;
}
@XmlTransient
public List<Experiment> getExperimentList() {
return experimentList;
}
public void setExperimentList(List<Experiment> experimentList) {
this.experimentList = experimentList;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof ExperimentType)) {
return false;
}
ExperimentType other = (ExperimentType) object;
return !((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id)));
}
@Override
public String toString() {
return "gov.anl.aps.dm.portal.model.entities2.ExperimentType[ id=" + id + " ]";
}
}