Subversion Repositories SmartDukaan

Rev

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