| 1 | |
package com.ctrip.framework.apollo.biz.entity; |
| 2 | |
|
| 3 | |
import com.ctrip.framework.apollo.common.entity.BaseEntity; |
| 4 | |
|
| 5 | |
import javax.persistence.Column; |
| 6 | |
import javax.persistence.Entity; |
| 7 | |
import javax.persistence.Table; |
| 8 | |
|
| 9 | |
import org.hibernate.annotations.SQLDelete; |
| 10 | |
import org.hibernate.annotations.Where; |
| 11 | |
|
| 12 | |
@Entity |
| 13 | |
@Table(name = "Privilege") |
| 14 | |
@SQLDelete(sql = "Update Privilege set isDeleted = 1 where id = ?") |
| 15 | |
@Where(clause = "isDeleted = 0") |
| 16 | 5 | public class Privilege extends BaseEntity { |
| 17 | |
|
| 18 | |
@Column(name = "Name", nullable = false) |
| 19 | |
private String name; |
| 20 | |
|
| 21 | |
@Column(name = "PrivilType", nullable = false) |
| 22 | |
private String privilType; |
| 23 | |
|
| 24 | |
@Column(name = "NamespaceId") |
| 25 | |
private long namespaceId; |
| 26 | |
|
| 27 | |
public String getName() { |
| 28 | 1 | return name; |
| 29 | |
} |
| 30 | |
|
| 31 | |
public long getNamespaceId() { |
| 32 | 0 | return namespaceId; |
| 33 | |
} |
| 34 | |
|
| 35 | |
public String getPrivilType() { |
| 36 | 1 | return privilType; |
| 37 | |
} |
| 38 | |
|
| 39 | |
public void setName(String name) { |
| 40 | 4 | this.name = name; |
| 41 | 4 | } |
| 42 | |
|
| 43 | |
public void setNamespaceId(long namespaceId) { |
| 44 | 4 | this.namespaceId = namespaceId; |
| 45 | 4 | } |
| 46 | |
|
| 47 | |
public void setPrivilType(String privilType) { |
| 48 | 4 | this.privilType = privilType; |
| 49 | 4 | } |
| 50 | |
|
| 51 | |
public String toString() { |
| 52 | 0 | return toStringHelper().add("namespaceId", namespaceId).add("privilType", privilType) |
| 53 | 0 | .add("name", name).toString(); |
| 54 | |
} |
| 55 | |
} |