Subversion Repositories SmartDukaan

Rev

Rev 34474 | Go to most recent revision | 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;
31
 
32
 
33
    public GiftEntity(Integer id, String name, String thumbnailUrl, Integer validity, Double minCartValue, Integer maxRedemptions, Integer offerId, String productCategory, String fofoStore, Double maxCartValue) {
34
        this.id = id;
35
        this.name = name;
36
        this.thumbnailUrl = thumbnailUrl;
37
        this.minCartValue = minCartValue;
38
        this.maxRedemptions = maxRedemptions;
39
        this.offerId = offerId;
40
        this.productCategory = productCategory;
41
        this.fofoStore = fofoStore;
42
        this.maxCartValue = maxCartValue;
43
 
44
    }
45
 
46
    public GiftEntity() {
47
 
48
    }
49
 
50
    public Integer getId() {
51
        return id;
52
    }
53
 
54
    public void setId(Integer id) {
55
        this.id = id;
56
    }
57
 
58
    public String getName() {
59
        return name;
60
    }
61
 
62
    public void setName(String name) {
63
        this.name = name;
64
    }
65
 
66
    public String getThumbnailUrl() {
67
        return thumbnailUrl;
68
    }
69
 
70
    public void setThumbnailUrl(String thumbnailUrl) {
71
        this.thumbnailUrl = thumbnailUrl;
72
    }
73
 
74
    public Double getMinCartValue() {
75
        return minCartValue;
76
    }
77
 
78
    public void setMinCartValue(Double minCartValue) {
79
        this.minCartValue = minCartValue;
80
    }
81
 
82
    public Integer getMaxRedemptions() {
83
        return maxRedemptions;
84
    }
85
 
86
    public void setMaxRedemptions(Integer maxRedemptions) {
87
        this.maxRedemptions = maxRedemptions;
88
    }
89
 
90
    public Integer getOfferId() {
91
        return offerId;
92
    }
93
 
94
    public void setOfferId(Integer offerId) {
95
        this.offerId = offerId;
96
    }
97
 
98
    public Double getMaxCartValue() {
99
        return maxCartValue;
100
    }
101
 
102
    public void setMaxCartValue(Double maxCartValue) {
103
        this.maxCartValue = maxCartValue;
104
    }
105
 
106
    public String getProductCategory() {
107
        return productCategory;
108
    }
109
 
110
    public void setProductCategory(String productCategory) {
111
        this.productCategory = productCategory;
112
    }
113
 
114
    public String getFofoStore() {
115
        return fofoStore;
116
    }
117
 
118
    public void setFofoStore(String fofoStore) {
119
        this.fofoStore = fofoStore;
120
    }
121
 
122
 
123
    @Override
124
    public String toString() {
125
        return "Gift{" +
126
                "id=" + id +
127
                ", name='" + name + '\'' +
128
                ", thumbnailUrl='" + thumbnailUrl + '\'' +
129
                ", minCartValue=" + minCartValue +
130
                ", maxRedemptions=" + maxRedemptions +
131
                ", offerId=" + offerId +
132
                ", productCategory=" + productCategory +
133
                ", fofoStore=" + fofoStore +
134
                ", maxCartValue=" + maxCartValue +
135
                '}';
136
    }
137
}