Subversion Repositories SmartDukaan

Rev

Rev 23361 | Rev 23398 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
21713 ashik.ali 1
package com.spice.profitmandi.dao.entity.catalog;
21552 ashik.ali 2
 
3
import java.io.Serializable;
4
 
5
import javax.persistence.Column;
6
import javax.persistence.Entity;
21614 kshitij.so 7
import javax.persistence.EnumType;
8
import javax.persistence.Enumerated;
21552 ashik.ali 9
import javax.persistence.GeneratedValue;
10
import javax.persistence.GenerationType;
11
import javax.persistence.Id;
12
import javax.persistence.Table;
13
 
21573 ashik.ali 14
import in.shop2020.model.v1.catalog.ItemType;
15
 
21552 ashik.ali 16
/**
17
 * This class basically contains item details
18
 * 
19
 * @author ashikali
20
 *
21
 */
22
@Entity
23
@Table(name="catalog.item", schema = "catalog")
24
public class Item implements Serializable{
25
 
26
	private static final long serialVersionUID = 1L;
27
 
28
	public Item() {
29
	}
30
 
31
	@Id
32
	@Column(name="id", columnDefinition = "int(11)")
33
	@GeneratedValue(strategy = GenerationType.IDENTITY)
34
	private int id;
35
 
21653 ashik.ali 36
	@Column(name="brand", length = 100)
21552 ashik.ali 37
	private String brand;
38
 
39
	@Column(name = "model_name", length = 100)
40
	private String modelName;
41
 
42
	@Column(name = "model_number", length = 100)
43
	private String modelNumber;
44
 
45
	@Column(name = "color", length = 20)
46
	private String color;
47
 
21898 kshitij.so 48
	@Column(name="catalog_item_id")
49
	private int catalogItemId;
50
 
21614 kshitij.so 51
	@Enumerated(EnumType.STRING)
21573 ashik.ali 52
	@Column(name = "type")
53
	private ItemType type;
54
 
21917 ashik.ali 55
	@Column(name = "hsnCode")
21895 ashik.ali 56
	private String hsnCode;
57
 
22216 ashik.ali 58
	@Column(name = "sellingPrice")
59
	private float sellingPrice;
60
 
21552 ashik.ali 61
	public int getId() {
62
		return id;
63
	}
64
	public void setId(int id) {
65
		this.id = id;
66
	}
67
	public String getBrand() {
68
		return brand;
69
	}
70
	public void setBrand(String brand) {
71
		this.brand = brand;
72
	}
73
	public String getModelName() {
74
		return modelName;
75
	}
76
	public void setModelName(String modelName) {
77
		this.modelName = modelName;
78
	}
79
	public String getModelNumber() {
80
		return modelNumber;
81
	}
82
	public void setModelNumber(String modelNumber) {
83
		this.modelNumber = modelNumber;
84
	}
85
	public String getColor() {
23362 amit.gupta 86
		if(color != null && (color.startsWith("f_") || color.startsWith("F_"))){
23361 amit.gupta 87
			return color.substring(2);
88
		}
21552 ashik.ali 89
		return color;
90
	}
91
	public void setColor(String color) {
92
		this.color = color;
93
	}
94
 
21573 ashik.ali 95
	public ItemType getType() {
96
		return type;
97
	}
98
	public void setType(ItemType type) {
99
		this.type = type;
100
	}
21895 ashik.ali 101
 
102
	public String getHsnCode() {
103
		return hsnCode;
104
	}
105
	public void setHsnCode(String hsnCode) {
106
		this.hsnCode = hsnCode;
107
	}
21898 kshitij.so 108
 
109
	public int getCatalogItemId() {
110
		return catalogItemId;
111
	}
112
	public void setCatalogItemId(int catalogItemId) {
113
		this.catalogItemId = catalogItemId;
114
	}
21924 ashik.ali 115
 
22216 ashik.ali 116
	public float getSellingPrice() {
117
		return sellingPrice;
118
	}
22009 ashik.ali 119
 
22216 ashik.ali 120
	public void setSellingPrice(float sellingPrice) {
121
		this.sellingPrice = sellingPrice;
122
	}
123
 
21602 ashik.ali 124
	@Override
21924 ashik.ali 125
	public int hashCode() {
126
		final int prime = 31;
127
		int result = 1;
128
		result = prime * result + id;
129
		return result;
130
	}
131
	@Override
132
	public boolean equals(Object obj) {
133
		if (this == obj)
134
			return true;
135
		if (obj == null)
136
			return false;
137
		if (getClass() != obj.getClass())
138
			return false;
139
		Item other = (Item) obj;
140
		if (id != other.id)
141
			return false;
142
		return true;
143
	}
144
	@Override
21602 ashik.ali 145
	public String toString() {
146
		return "Item [id=" + id + ", brand=" + brand + ", modelName=" + modelName + ", modelNumber=" + modelNumber
23172 ashik.ali 147
				+ ", color=" + color + ", catalogItemId=" + catalogItemId + ", type=" + type + ", hsnCode=" + hsnCode
148
				+ ", sellingPrice=" + sellingPrice + "]";
21602 ashik.ali 149
	}
21552 ashik.ali 150
 
151
}