Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package th.co.truecorp;
- import java.util.HashSet;
- import java.util.Set;
- import javax.persistence.*;
- /**
- *
- * @author admin
- */
- @Entity
- public class Person {
- @Id
- @GeneratedValue
- private int id;
- @Column
- private String name;
- @Column
- private boolean rich;
- @Column
- private float saraly;
- /*
- @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
- private Set<Address> addresses = new HashSet<Address>();
- public Set<Address> getAddresses() {
- return addresses;
- }
- public void setAddresses(Set<Address> addresses) {
- this.addresses = addresses;
- }
- */
- public float getSaraly() {
- return saraly;
- }
- public void setSaraly(float saraly) {
- this.saraly = saraly;
- }
- public int getId() {
- return id;
- }
- public void setId(int id) {
- this.id = id;
- }
- public String getName() {
- return name;
- }
- public void setName(String name) {
- this.name = name;
- }
- public boolean isRich() {
- return rich;
- }
- public void setRich(boolean rich) {
- this.rich = rich;
- }
- @Override
- public String toString() {
- return "Person{" + "id=" + id + ", name=" + name + ", rich=" + rich + ", saraly=" + saraly + '}';
- }
- public Person(int id, String name, boolean rich, float saraly) {
- this.id = id;
- this.name = name;
- this.rich = rich;
- this.saraly = saraly;
- }
- public Person() {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement