Commit 1a019831 by Patryk Czarnik

LocalDate

parent aee5c0e3
......@@ -3,8 +3,7 @@ package hr.model;
import java.io.Serializable;
import jakarta.persistence.*;
import java.math.BigDecimal;
import java.util.Date;
import java.time.LocalDate;
/**
* The persistent class for the employees database table.
......@@ -32,7 +31,7 @@ public class Employee implements Serializable {
@Temporal(TemporalType.DATE)
@Column(name="hire_date")
private Date hireDate;
private LocalDate hireDate;
@Column(name="last_name")
private String lastName;
......@@ -92,11 +91,11 @@ public class Employee implements Serializable {
this.firstName = firstName;
}
public Date getHireDate() {
public LocalDate getHireDate() {
return this.hireDate;
}
public void setHireDate(Date hireDate) {
public void setHireDate(LocalDate hireDate) {
this.hireDate = hireDate;
}
......
......@@ -18,7 +18,7 @@ public class OdczytajWszystkich2 {
List<Employee> lista = query.getResultList();
for(Employee emp : lista) {
System.out.println(emp.getFirstName() + " " + emp.getLastName() + " " + emp.getSalary());
System.out.println(emp.getFirstName() + " " + emp.getLastName() + " " + emp.getSalary() + " zatr. " + emp.getHireDate());
}
em.close();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment