Subversion Repositories SmartDukaan

Rev

Rev 28493 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 28493 Rev 32074
Line 6... Line 6...
6
import javax.persistence.GenerationType;
6
import javax.persistence.GenerationType;
7
import javax.persistence.Id;
7
import javax.persistence.Id;
8
import javax.persistence.Table;
8
import javax.persistence.Table;
9
 
9
 
10
@Entity
10
@Entity
11
@Table(name = "inventory.vendor", schema = "inventory")
11
@Table(name = "inventory.vendor")
12
public class Vendor {
12
public class Vendor {
13
 
13
 
14
	@Id
14
    @Id
15
	@Column(name = "id", unique = true, updatable = false)
15
    @Column(name = "id", unique = true, updatable = false)
16
	private int id;
16
    private int id;
17
	private String name;
17
    private String name;
18
 
18
 
19
	public int getId() {
19
    public int getId() {
20
		return id;
20
        return id;
21
	}
21
    }
22
 
22
 
23
	public void setId(int id) {
23
    public void setId(int id) {
24
		this.id = id;
24
        this.id = id;
25
	}
25
    }
26
 
26
 
27
	public String getName() {
27
    public String getName() {
28
		return name;
28
        return name;
29
	}
29
    }
30
 
30
 
31
	public void setName(String name) {
31
    public void setName(String name) {
32
		this.name = name;
32
        this.name = name;
33
	}
33
    }
34
 
34
 
35
	@Override
35
    @Override
36
	public int hashCode() {
36
    public int hashCode() {
37
		final int prime = 31;
37
        final int prime = 31;
38
		int result = 1;
38
        int result = 1;
39
		result = prime * result + id;
39
        result = prime * result + id;
40
		result = prime * result + ((name == null) ? 0 : name.hashCode());
40
        result = prime * result + ((name == null) ? 0 : name.hashCode());
41
		return result;
41
        return result;
42
	}
42
    }
43
 
43
 
44
	@Override
44
    @Override
45
	public boolean equals(Object obj) {
45
    public boolean equals(Object obj) {
46
		if (this == obj)
46
        if (this == obj)
47
			return true;
47
            return true;
48
		if (obj == null)
48
        if (obj == null)
49
			return false;
49
            return false;
50
		if (getClass() != obj.getClass())
50
        if (getClass() != obj.getClass())
51
			return false;
51
            return false;
52
		Vendor other = (Vendor) obj;
52
        Vendor other = (Vendor) obj;
53
		if (id != other.id)
53
        if (id != other.id)
54
			return false;
54
            return false;
55
		if (name == null) {
55
        if (name == null) {
56
			if (other.name != null)
56
            if (other.name != null)
57
				return false;
57
                return false;
58
		} else if (!name.equals(other.name))
58
        } else if (!name.equals(other.name))
59
			return false;
59
            return false;
60
		return true;
60
        return true;
61
	}
61
    }
62
 
62
 
63
	@Override
63
    @Override
64
	public String toString() {
64
    public String toString() {
65
		return "vendor [id=" + id + ", name=" + name + "]";
65
        return "vendor [id=" + id + ", name=" + name + "]";
66
	}
66
    }
67
 
67
 
68
	public Vendor() {
68
    public Vendor() {
69
		super();
69
        super();
70
		// TODO Auto-generated constructor stub
70
        // TODO Auto-generated constructor stub
71
	}
71
    }
72
 
72
 
73
}
73
}