Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
21720 ashik.ali 1
package com.spice.profitmandi.dao.entity.dtr;
21545 ashik.ali 2
 
3
import java.io.Serializable;
4
 
5
import javax.persistence.Column;
6
import javax.persistence.Entity;
7
import javax.persistence.GeneratedValue;
8
import javax.persistence.GenerationType;
9
import javax.persistence.Id;
10
import javax.persistence.NamedQueries;
11
import javax.persistence.NamedQuery;
12
import javax.persistence.Table;
13
import javax.persistence.UniqueConstraint;
14
 
15
/**
16
 * This class basically contains api details
17
 * 
18
 * @author ashikali
19
 *
20
 */
21
@Entity
21720 ashik.ali 22
@Table(name="dtr.shop_address", schema = "dtr", uniqueConstraints = {@UniqueConstraint(columnNames = {"shop_id","address_id"})})
21545 ashik.ali 23
@NamedQueries({
24
	@NamedQuery(name="ShopAddress.selectAddressByShopId", query="select a from ShopAddress sa join Address a on a.id = sa.addressId where sa.shopId= :shopId"),
25
	@NamedQuery(name="ShopAddress.deleteByShopId", query="delete from ShopAddress sa where sa.shopId= :shopId")
26
})
27
public class ShopAddress implements Serializable{
28
 
29
	private static final long serialVersionUID = 1L;
30
 
31
	public ShopAddress() {
32
	}
33
 
34
	@Id
35
	@Column(name="id", unique=true, updatable=false)
36
	@GeneratedValue(strategy = GenerationType.IDENTITY)
37
	private int id;
38
 
39
	@Column(name="shop_id", unique=false, updatable=false)
40
	private int shopId;
41
 
42
	@Column(name="address_id", unique = false)
43
	private int addressId;
44
 
45
	public int getId() {
46
		return id;
47
	}
48
 
49
	public void setId(int id) {
50
		this.id = id;
51
	}
52
 
53
	public int getShopId() {
54
		return shopId;
55
	}
56
 
57
	public void setShopId(int shopId) {
58
		this.shopId = shopId;
59
	}
60
 
61
	public int getAddressId() {
62
		return addressId;
63
	}
64
 
65
	public void setAddressId(int addressId) {
66
		this.addressId = addressId;
67
	}
68
 
69
	@Override
70
	public String toString() {
71
		return "ShopAddress [shopId=" + shopId + ", addressId=" + addressId + "]";
72
	}
73
 
74
 
75
}