这是员工域,是吗?

问题描述 投票:0回答:1

Lorem ipsum dolor sat amet,consectetur adipiscing elit。 sed sed eros condimentum,tincidunt urna ac,iaculis velit。 Duis neque totortor,tempus a arcu pharetra,maximus faucibuserat。 Nulla facilisi。 Donec feugiat eros nec urna viverra,tincidunt volutpat mauris iaculis。 Proin convallis mollis pellentesque。 Aenean sed Egestas arcu。 Sed ornare sollicitudin neque, ac ullamcorper dui lacinia eget。 Quisque eu velit et purus cursus sollicitudin ut a mi。 Cras Tincidunt odio vitae sagittis feugiat.

Nullam vel finibus lorem。 Faucibus Orci luctus et ultrices posuere cubilia curae 的前庭前庭;在 hachabitasseplatea dictumst 中。 Maecenas scelerisque turpis sed quam laoreet Tincidunt。暂停车辆质量,禁止乘客坐车,骚扰弧线。但非马蒂斯弧线。 Donec vitae turpis sat amet augue dapibus bibendum et at turpis。 Aliquam nec congue lectus。 Morbi mollis elementum metus ac faucibus.

Morbi pharetra finibus nunc,sed tempor totor luctus in。Praesent a urna augue。菜豆 (Phasellus ac pellentesque nisl)。 Morbi ex lacus、iaculis a magna ut、dapibus fringilla lorem。 Duis placerat diam sapien,sit amet posuere quam finibus sat amet。悬念 maximus semper orci, in maximus arcu pellentesque a. Fusce nec metus id eros gravida bibendum id in ipsum。 Suspendisse celerisque,arcu nec ornare porttitor,ex augue interdum diam,in rhoncus totorr nunc sed metus。 Vivamus consectetur ullamcorper mauris eu 温和。 Quisque gravida dolor in pulvinar mollis。 Etiam Tellus Orci、venenatis quis ornare at、lacinia et ipsum。 Curabitur fringilla elit ipsum,一种 luctus ipsum luctus eu。 Vivamus eget condimentum lacus。整数 enim odio,laoreet id sem。

java jquery intellij-idea intellij-plugin intellij-14
1个回答
0
投票
package za.ac.cput.domain;

import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.IdClass;

import java.util.Objects;

//-------------BUILDER EXAMPLE------------

@Entity
//@IdClass(EmployeeID.class)
//@Table(name="Employee")
public class Employee {
    @Id
    private String employeeNumber;

    private String firstName;

    private String lastName;

    public Employee(){}

    private Employee(Builder builder){
        this.employeeNumber = builder.employeeNumber;
        this.firstName = builder.firstName;
        this.lastName = builder.lastName;
    }

    public String getEmployeeNumber() {return employeeNumber;}

    public String getFirstName() {
        return firstName;
    }

    public String getLastName() {
        return lastName;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Employee employee = (Employee) o;
        return Objects.equals(employeeNumber, employee.employeeNumber) && Objects.equals(firstName, employee.firstName) && Objects.equals(lastName, employee.lastName);
    }

    @Override
    public int hashCode() {
        return Objects.hash(employeeNumber, firstName, lastName);
    }

    @Override
    public String toString() {
        return "Employee{" +
                "employeeNumber='" + employeeNumber + '\'' +
                ", firstName='" + firstName + '\'' +
                ", lastName='" + lastName + '\'' +
                '}';
    }

    public static class Builder{
        private String employeeNumber;
        private String firstName;
        private String lastName;

        public Builder setEmployeeNumber(String employeeNumber) {
            this.employeeNumber = employeeNumber;
            return this;
        }

        public Builder setFirstName(String firstName) {
            this.firstName = firstName;
            return this;
        }

        public Builder setLastName(String lastName) {
            this.lastName = lastName;
            return this;
        }

        public Builder copy(Employee employee){
            this.employeeNumber = employee.employeeNumber;
            this.firstName = employee.firstName;
            this.lastName = employee.lastName;
            return this;
        }

        public Employee build(){
            return new Employee(this);
        }
    }
}
© www.soinside.com 2019 - 2024. All rights reserved.