Дипломная работа: Автоматизация управления распределенной структурой складов для ООО "Европос Групп"

Внимание! Если размещение файла нарушает Ваши авторские права, то обязательно сообщите нам
167
this.idUser = idUser;
}
/**
* Hash-код элемента
* @return Hash-значение
*/
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
/**
* Метод сравнения двух объектов (проверка равенства)
*
* @param object Объект, который будет сравниваться с текущим
* @return Результат сравнения
*/
@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 DocumentRule)) {
return false;
}
DocumentRule other = (DocumentRule) object;
if ((this.id == null && other.id != null) || (this.id != null &&
!this.id.equals(other.id))) {
return false;
}
return true;
}
/**
* Метод вычисления названия объекта
*
* @return Название
*/
@Override
public String toString() {
return "entities.DocumentRule[ id=" + id + " ]";
}
/**
* Возвращает должность
* @return Должность
*/
public UserFunction getIdUserFunction() {
168
return idUserFunction;
}
/**
* Задает должность
* @param idUserFunction Должность
*/
public void setIdUserFunction(UserFunction idUserFunction) {
this.idUserFunction = idUserFunction;
}
/**
* Возвращает отдел
* @return Отдел
*/
public Department getIdDepartment() {
return idDepartment;
}
/**
* Задает отдел
* @param idDepartment Отдел
*/
public void setIdDepartment(Department idDepartment) {
this.idDepartment = idDepartment;
}
}
/**
* Класс (модель) для таблицы "Тип документа"
*/
@Entity
@Table(name = "document_type")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "DocumentType.findAll", query = "SELECT d FROM
DocumentType d")
, @NamedQuery(name = "DocumentType.findById", query = "SELECT d
FROM DocumentType d WHERE d.id = :id")
, @NamedQuery(name = "DocumentType.findByTitle", query = "SELECT d
FROM DocumentType d WHERE d.title = :title")})
public class DocumentType implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id")
169
private Integer id;
@Size(max = 255)
@Column(name = "title")
private String title;
@OneToMany(mappedBy = "idDocumentType")
private Collection<Document> documentCollection;
/**
* Конструктор класса
*/
public DocumentType() {
}
/**
* Конструктор класса
* @param id Идентификатор типа
*/
public DocumentType(Integer id) {
this.id = id;
}
/**
* Возвращает значение поля "Идентифкатор типа"
* @return Идентифкатор типа
*/
public Integer getId() {
return id;
}
/**
* Задает значение поля "Идентифкатор типа"
* @param id Идентифкатор типа
*/
public void setId(Integer id) {
this.id = id;
}
/**
* Возвращает значение поля "Название типа"
* @return Название типа
*/
public String getTitle() {
return title;
}
/**
* Задает значение поля "Название типа"
* @param title Название типа
170
*/
public void setTitle(String title) {
this.title = title;
}
/**
* Возвращает значение поля "Документы данного типа"
* @return Коллекция документов
*/
@XmlTransient
public Collection<Document> getDocumentCollection() {
return documentCollection;
}
/**
* Задает значение поля "Документы данного типа"
* @param documentCollection Коллекция документов
*/
public void setDocumentCollection(Collection<Document> documentCollection)
{
this.documentCollection = documentCollection;
}
/**
* Hash-код элемента
* @return Hash-значение
*/
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
/**
* Метод сравнения двух объектов (проверка равенства)
* @param object Объект, который будет сравниваться с текущим
* @return Результат сравнения
*/
@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 DocumentType)) {
return false;
}
DocumentType other = (DocumentType) object;
if ((this.id == null && other.id != null) || (this.id != null &&
!this.id.equals(other.id))) {
return false;
}
171
return true;
}
/**
* Метод вычисления названия объекта
* @return Название
*/
@Override
public String toString() {
return title;
}
}
/**
* Класс (модель) для таблицы "Должность пользователя"
*/
@Entity
@Table(name = "user_function")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "UserFunction.findAll", query = "SELECT u FROM
UserFunction u")
, @NamedQuery(name = "UserFunction.findById", query = "SELECT u FROM
UserFunction u WHERE u.id = :id")
, @NamedQuery(name = "UserFunction.findByTitle", query = "SELECT u
FROM UserFunction u WHERE u.title = :title")})
public class UserFunction implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id")
private Integer id;
@Size(max = 255)
@Column(name = "title")
private String title;
@OneToMany(mappedBy = "idUserFunction")
private Collection<DocumentRule> documentRuleCollection;
@OneToMany(mappedBy = "idUserFunction")
private Collection<User> userCollection;
/**
* Конструктор класса
*/
public UserFunction() {
}
/**
Источник: https://baza.diplomsite.ru/previewfile/2331