Subversion Repositories SmartDukaan

Rev

Rev 25546 | Rev 29990 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 25546 Rev 28521
Line 3... Line 3...
3
import javax.persistence.Column;
3
import javax.persistence.Column;
4
import javax.persistence.Entity;
4
import javax.persistence.Entity;
5
import javax.persistence.GeneratedValue;
5
import javax.persistence.GeneratedValue;
6
import javax.persistence.GenerationType;
6
import javax.persistence.GenerationType;
7
import javax.persistence.Id;
7
import javax.persistence.Id;
-
 
8
import javax.persistence.NamedQueries;
-
 
9
import javax.persistence.NamedQuery;
8
import javax.persistence.Table;
10
import javax.persistence.Table;
9
 
11
 
10
@Entity
12
@Entity
11
@Table(name="transaction.userwallet",schema="transaction")
13
@Table(name = "transaction.userwallet", schema = "transaction")
12
public class UserWallet{
14
@NamedQueries({
13
	
15
		@NamedQuery(name = "UserWallet.getSummary", query = "select new com.spice.profitmandi.dao.model.AccountStatementModel(uwh.referenceType, sum(case when uwh.amount>0 then amount else 0 end), sum(case when uwh.amount<0 then -amount else 0 end))\tfrom UserWalletHistory uwh where uwh.walletId=:walletId \tand uwh.timestamp between :startDate and :endDate group by uwh.referenceType") })
-
 
16
public class UserWallet {
14
	
17
 
15
	@Id
18
	@Id
16
	@GeneratedValue(strategy=GenerationType.IDENTITY)
19
	@GeneratedValue(strategy = GenerationType.IDENTITY)
17
	private int id;
20
	private int id;
18
	private int userId;
21
	private int userId;
19
	private int amount;
22
	private int amount;
20
	
23
 
21
	@Column(name = "refundable_amount")
24
	@Column(name = "refundable_amount")
22
	private int refundableAmount;
25
	private int refundableAmount;
23
	
26
 
24
	public int getId() {
27
	public int getId() {
25
		return id;
28
		return id;
26
	}
29
	}
-
 
30
 
27
	public void setId(int id) {
31
	public void setId(int id) {
28
		this.id = id;
32
		this.id = id;
29
	}
33
	}
-
 
34
 
30
	public int getUserId() {
35
	public int getUserId() {
31
		return userId;
36
		return userId;
32
	}
37
	}
33
 
38
 
34
	public void setUserId(int userId) {
39
	public void setUserId(int userId) {
35
		this.userId = userId;
40
		this.userId = userId;
36
	}
41
	}
-
 
42
 
37
	public int getAmount() {
43
	public int getAmount() {
38
		return amount;
44
		return amount;
39
	}
45
	}
-
 
46
 
40
	public void setAmount(int amount) {
47
	public void setAmount(int amount) {
41
		this.amount = amount;
48
		this.amount = amount;
42
	}
49
	}
-
 
50
 
43
	public int getRefundableAmount() {
51
	public int getRefundableAmount() {
44
		return refundableAmount;
52
		return refundableAmount;
45
	}
53
	}
46
	
54
 
47
	public void setRefundableAmount(int refundableAmount) {
55
	public void setRefundableAmount(int refundableAmount) {
48
		this.refundableAmount = refundableAmount;
56
		this.refundableAmount = refundableAmount;
49
	}
57
	}
50
	
-
 
51
	
58
 
52
	@Override
59
	@Override
53
	public int hashCode() {
60
	public int hashCode() {
54
		final int prime = 31;
61
		final int prime = 31;
55
		int result = 1;
62
		int result = 1;
56
		result = prime * result + id;
63
		result = prime * result + id;
57
		return result;
64
		return result;
58
	}
65
	}
-
 
66
 
59
	@Override
67
	@Override
60
	public boolean equals(Object obj) {
68
	public boolean equals(Object obj) {
61
		if (this == obj)
69
		if (this == obj)
62
			return true;
70
			return true;
63
		if (obj == null)
71
		if (obj == null)
Line 67... Line 75...
67
		UserWallet other = (UserWallet) obj;
75
		UserWallet other = (UserWallet) obj;
68
		if (id != other.id)
76
		if (id != other.id)
69
			return false;
77
			return false;
70
		return true;
78
		return true;
71
	}
79
	}
-
 
80
 
72
	@Override
81
	@Override
73
	public String toString() {
82
	public String toString() {
74
		return "UserWallet [id=" + id + ", userId=" + userId + ", amount=" + amount + ", refundableAmount="
83
		return "UserWallet [id=" + id + ", userId=" + userId + ", amount=" + amount + ", refundableAmount="
75
				+ refundableAmount + "]";
84
				+ refundableAmount + "]";
76
	}
85
	}
77
	
86
 
78
}
87
}
79
88