Subversion Repositories SmartDukaan

Rev

Rev 35095 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
34474 aman.kumar 1
package com.spice.profitmandi.dao.entity.scratch;
2
 
3
 
4
import javax.persistence.*;
5
 
6
@Entity
35095 aman 7
@NamedQuery(
8
        name = "decrementGift",
9
        query = "UPDATE GiftEntity g SET g.maxRedemptions = g.maxRedemptions - 1 WHERE g.id = :giftId AND g.maxRedemptions > 0"
10
)
34474 aman.kumar 11
@Table(name = "web.gifts")
12
public class GiftEntity {
13
    @Id
14
    @GeneratedValue(strategy = GenerationType.IDENTITY)
15
    private Integer id;
16
    private String name;
17
    @Column(name = "thumbnail_url")
18
    private String thumbnailUrl;
19
    @Column(name = "min_cart_value")
20
    private Double minCartValue;
21
    @Column(name = "max_redemptions")
22
    private Integer maxRedemptions;
23
    @Column(name = "offer_id")
24
    private Integer offerId;
25
    @Column(name = "product_category")
26
    private String productCategory;
27
    @Column(name = "fofo_store")
28
    private String fofoStore;
29
    @Column(name = "max_cart_value")
30
    private Double maxCartValue;
35253 aman 31
    @Column(name = "is_default")
32
    private Boolean isDefault;
34474 aman.kumar 33
 
35253 aman 34
    public GiftEntity(Integer id, String name, String thumbnailUrl, Integer validity, Double minCartValue, Integer maxRedemptions, Integer offerId, String productCategory, String fofoStore, Double maxCartValue, Boolean isDefault) {
34474 aman.kumar 35
        this.id = id;
36
        this.name = name;
37
        this.thumbnailUrl = thumbnailUrl;
38
        this.minCartValue = minCartValue;
39
        this.maxRedemptions = maxRedemptions;
40
        this.offerId = offerId;
41
        this.productCategory = productCategory;
42
        this.fofoStore = fofoStore;
43
        this.maxCartValue = maxCartValue;
35253 aman 44
        this.isDefault = isDefault;
34474 aman.kumar 45
 
46
    }
47
 
48
    public GiftEntity() {
49
 
50
    }
51
 
52
    public Integer getId() {
53
        return id;
54
    }
55
 
56
    public void setId(Integer id) {
57
        this.id = id;
58
    }
59
 
60
    public String getName() {
61
        return name;
62
    }
63
 
64
    public void setName(String name) {
65
        this.name = name;
66
    }
67
 
68
    public String getThumbnailUrl() {
69
        return thumbnailUrl;
70
    }
71
 
72
    public void setThumbnailUrl(String thumbnailUrl) {
73
        this.thumbnailUrl = thumbnailUrl;
74
    }
75
 
76
    public Double getMinCartValue() {
77
        return minCartValue;
78
    }
79
 
80
    public void setMinCartValue(Double minCartValue) {
81
        this.minCartValue = minCartValue;
82
    }
83
 
84
    public Integer getMaxRedemptions() {
85
        return maxRedemptions;
86
    }
87
 
88
    public void setMaxRedemptions(Integer maxRedemptions) {
89
        this.maxRedemptions = maxRedemptions;
90
    }
91
 
92
    public Integer getOfferId() {
93
        return offerId;
94
    }
95
 
96
    public void setOfferId(Integer offerId) {
97
        this.offerId = offerId;
98
    }
99
 
100
    public Double getMaxCartValue() {
101
        return maxCartValue;
102
    }
103
 
104
    public void setMaxCartValue(Double maxCartValue) {
105
        this.maxCartValue = maxCartValue;
106
    }
107
 
108
    public String getProductCategory() {
109
        return productCategory;
110
    }
111
 
112
    public void setProductCategory(String productCategory) {
113
        this.productCategory = productCategory;
114
    }
115
 
116
    public String getFofoStore() {
117
        return fofoStore;
118
    }
119
 
120
    public void setFofoStore(String fofoStore) {
121
        this.fofoStore = fofoStore;
122
    }
123
 
35253 aman 124
    public Boolean isDefault() {
125
        return isDefault;
126
    }
34474 aman.kumar 127
 
35253 aman 128
    public void setIsDefault(Boolean aDefault) {
129
        isDefault = aDefault;
130
    }
131
 
34474 aman.kumar 132
    @Override
133
    public String toString() {
134
        return "Gift{" +
135
                "id=" + id +
136
                ", name='" + name + '\'' +
137
                ", thumbnailUrl='" + thumbnailUrl + '\'' +
138
                ", minCartValue=" + minCartValue +
139
                ", maxRedemptions=" + maxRedemptions +
140
                ", offerId=" + offerId +
141
                ", productCategory=" + productCategory +
142
                ", fofoStore=" + fofoStore +
143
                ", maxCartValue=" + maxCartValue +
35253 aman 144
                ", isDefault=" + isDefault +
34474 aman.kumar 145
                '}';
146
    }
147
}