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.retailer_brand", schema = "dtr", uniqueConstraints = {@UniqueConstraint(columnNames = {"retailer_id", "brand_id"})})
21545 ashik.ali 23
@NamedQueries({
24
	@NamedQuery(name="RetailerBrand.selectByRetailerId", query="select rb from RetailerBrand rb where rb.retailerId= :retailerId"),
25
	@NamedQuery(name="RetailerBrand.deleteByRetailerAndBrandId", query="delete from RetailerBrand rb where rb.retailerId= :retailerId and rb.brandId = :brandId"),
26
	@NamedQuery(name = "RetailerBrand.selectBrandNamesByRetailerId", query = "select b.name from RetailerBrand rb join Brand b on b.id = rb.brandId where rb.retailerId = :retailerId")
27
})
28
public class RetailerBrand implements Serializable{
29
 
30
	private static final long serialVersionUID = 1L;
31
 
32
	@Id
33
	@Column(name="id", unique=true, updatable=false)
34
	@GeneratedValue(strategy = GenerationType.IDENTITY)
35
	private int id;
36
 
37
	public RetailerBrand() {
38
	}
39
 
40
	public int getId() {
41
		return id;
42
	}
43
	public void setId(int id) {
44
		this.id = id;
45
	}
46
	@Column(name="retailer_id", unique=false, updatable=false)
47
	private int retailerId;
48
 
49
	@Column(name="brand_id", unique = false)
50
	private int brandId;
51
 
52
	public int getRetailerId() {
53
		return retailerId;
54
	}
55
 
56
	public void setRetailerId(int retailerId) {
57
		this.retailerId = retailerId;
58
	}
59
 
60
	public int getBrandId() {
61
		return brandId;
62
	}
63
	public void setBrandId(int brandId) {
64
		this.brandId = brandId;
65
	}
66
 
67
	@Override
68
	public String toString() {
69
		return "RetailerBrand [retailerId=" + retailerId + ", brandId=" + brandId + "]";
70
	}
71
 
72
}