Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
21716 ashik.ali 1
package com.spice.profitmandi.dao.entity.transaction;
21552 ashik.ali 2
 
22550 ashik.ali 3
import javax.persistence.Column;
21552 ashik.ali 4
import javax.persistence.Entity;
5
import javax.persistence.GeneratedValue;
6
import javax.persistence.GenerationType;
7
import javax.persistence.Id;
8
import javax.persistence.Table;
9
 
25544 amit.gupta 10
import org.springframework.beans.factory.annotation.Autowired;
11
 
12
import com.spice.profitmandi.dao.repository.transaction.UserWalletHistoryRepository;
13
 
21552 ashik.ali 14
@Entity
15
@Table(name="transaction.userwallet",schema="transaction")
16
public class UserWallet{
22550 ashik.ali 17
 
25545 amit.gupta 18
	@Autowired 
19
	UserWalletHistoryRepository userWalletHistoryRepository;
25544 amit.gupta 20
 
21552 ashik.ali 21
	@Id
22
	@GeneratedValue(strategy=GenerationType.IDENTITY)
23
	private int id;
24
	private int userId;
25
	private int amount;
26
 
22550 ashik.ali 27
	@Column(name = "refundable_amount")
28
	private int refundableAmount;
29
 
21552 ashik.ali 30
	public int getId() {
31
		return id;
32
	}
33
	public void setId(int id) {
34
		this.id = id;
35
	}
36
	public int getUserId() {
37
		return userId;
38
	}
39
	public void setUserId(int userId) {
40
		this.userId = userId;
41
	}
42
	public int getAmount() {
25544 amit.gupta 43
		return (int)userWalletHistoryRepository.selectSumByWallet(this.id);
21552 ashik.ali 44
	}
45
	public void setAmount(int amount) {
46
		this.amount = amount;
47
	}
22550 ashik.ali 48
	public int getRefundableAmount() {
49
		return refundableAmount;
21552 ashik.ali 50
	}
22550 ashik.ali 51
 
52
	public void setRefundableAmount(int refundableAmount) {
53
		this.refundableAmount = refundableAmount;
21552 ashik.ali 54
	}
21924 ashik.ali 55
 
22009 ashik.ali 56
 
21602 ashik.ali 57
	@Override
21924 ashik.ali 58
	public int hashCode() {
59
		final int prime = 31;
60
		int result = 1;
61
		result = prime * result + id;
62
		return result;
63
	}
64
	@Override
65
	public boolean equals(Object obj) {
66
		if (this == obj)
67
			return true;
68
		if (obj == null)
69
			return false;
70
		if (getClass() != obj.getClass())
71
			return false;
72
		UserWallet other = (UserWallet) obj;
73
		if (id != other.id)
74
			return false;
75
		return true;
76
	}
77
	@Override
21602 ashik.ali 78
	public String toString() {
22550 ashik.ali 79
		return "UserWallet [id=" + id + ", userId=" + userId + ", amount=" + amount + ", refundableAmount="
80
				+ refundableAmount + "]";
21602 ashik.ali 81
	}
82
 
22653 ashik.ali 83
}