/* * Copyright 2004-2010 the Seasar Foundation and the Others. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, * either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ package tutorial.entity; import java.sql.Date; import java.sql.Timestamp; import org.seasar.doma.Column; import org.seasar.doma.Entity; import org.seasar.doma.GeneratedValue; import org.seasar.doma.GenerationType; import org.seasar.doma.Id; import org.seasar.doma.OriginalStates; import org.seasar.doma.SequenceGenerator; import org.seasar.doma.Version; import tutorial.domain.Salary; @Entity(listener = EmployeeListener.class) public class Employee { @Id @GeneratedValue(strategy = GenerationType.SEQUENCE) @SequenceGenerator(sequence = "EMPLOYEE_SEQ") Integer id; String name; int age; Salary salary; @Column(name = "JOB_TYPE") JobType jobType; Date hiredate; @Column(name = "DEPARTMENT_ID") Integer departmentId; @Version @Column(name = "VERSION") Integer version; Timestamp insertTimestamp; Timestamp updateTimestamp; @OriginalStates Employee originalStates; 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 int getAge() { return age; } public void setAge(int age) { this.age = age; } public Salary getSalary() { return salary; } public void setSalary(Salary salary) { this.salary = salary; } public JobType getJobType() { return jobType; } public void setJobType(JobType jobType) { this.jobType = jobType; } public Date getHiredate() { return hiredate; } public void setHiredate(Date hiredate) { this.hiredate = hiredate; } public Integer getDepartmentId() { return departmentId; } public void setDepartmentId(Integer departmentId) { this.departmentId = departmentId; } public Timestamp getInsertTimestamp() { return insertTimestamp; } public void setInsertTimestamp(Timestamp insertTimestamp) { this.insertTimestamp = insertTimestamp; } public Timestamp getUpdateTimestamp() { return updateTimestamp; } public void setUpdateTimestamp(Timestamp updateTimestamp) { this.updateTimestamp = updateTimestamp; } public Integer getVersion() { return version; } public void setVersion(Integer version) { this.version = version; } @Override public String toString() { return "Employee [departmentId=" + departmentId + ", hiredate=" + hiredate + ", id=" + id + ", jobType=" + jobType + ", name=" + name + ", salary=" + salary + ", version=" + version + ", insertTimestamp=" + insertTimestamp + ", updateTimestamp=" + updateTimestamp + "]"; } }