From 13c81de48c14a47d411b6db65565cd1cb15dd7c4 Mon Sep 17 00:00:00 2001 From: ricardo051199 Date: Mon, 16 Sep 2024 20:09:16 -0400 Subject: [PATCH] Correcciones --- src/main/java/com/primefactorsolutions/model/BaseEntity.java | 5 +++-- .../java/com/primefactorsolutions/views/EmployeeView.java | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/primefactorsolutions/model/BaseEntity.java b/src/main/java/com/primefactorsolutions/model/BaseEntity.java index 09b1382..065f3fe 100644 --- a/src/main/java/com/primefactorsolutions/model/BaseEntity.java +++ b/src/main/java/com/primefactorsolutions/model/BaseEntity.java @@ -10,6 +10,7 @@ public abstract class BaseEntity { @Id @GeneratedValue(strategy = GenerationType.UUID) private UUID id; + @Enumerated(EnumType.STRING) private Employee.Status status; private String fileName; @Lob @@ -64,11 +65,11 @@ public abstract class BaseEntity { return documentType; } - public void setStatus(Employee.Status status) { + public void setStatusEmployee(Employee.Status status) { this.status = status; } - public Employee.Status getStatus() { + public Employee.Status getStatusEmployee() { return status; } } diff --git a/src/main/java/com/primefactorsolutions/views/EmployeeView.java b/src/main/java/com/primefactorsolutions/views/EmployeeView.java index 8b18f3b..42e95e2 100644 --- a/src/main/java/com/primefactorsolutions/views/EmployeeView.java +++ b/src/main/java/com/primefactorsolutions/views/EmployeeView.java @@ -199,7 +199,7 @@ public class EmployeeView extends BeanValidationForm implements HasUrl private void saveEmployee() { if (validateForm()) { Employee employee = getEntity(); - employee.setStatus(status.getValue()); + employee.setStatusEmployee(status.getValue()); employeeService.createOrUpdate(employee); Notification.show(NOTIFICATION_SAVE_SUCCESS); getUI().ifPresent(ui -> ui.navigate(EmployeesListView.class)); @@ -233,7 +233,7 @@ public class EmployeeView extends BeanValidationForm implements HasUrl if ("edit".equals(action) && !s.isEmpty()) { saveButton.setVisible(true); editButton.setVisible(false); - status.setValue(employee.getStatus()); + status.setValue(employee.getStatusEmployee()); setFieldsEditable(); } else if ("view".equals(action) && !s.isEmpty()) { setFieldsReadOnly();