| 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 = "Audit") |
| 14 | |
@SQLDelete(sql = "Update Audit set isDeleted = 1 where id = ?") |
| 15 | |
@Where(clause = "isDeleted = 0") |
| 16 | 26 | public class Audit extends BaseEntity { |
| 17 | |
|
| 18 | 26 | public enum OP { |
| 19 | 1 | INSERT, UPDATE, DELETE |
| 20 | |
} |
| 21 | |
|
| 22 | |
@Column(name = "EntityName", nullable = false) |
| 23 | |
private String entityName; |
| 24 | |
|
| 25 | |
@Column(name = "EntityId") |
| 26 | |
private Long entityId; |
| 27 | |
|
| 28 | |
@Column(name = "OpName", nullable = false) |
| 29 | |
private String opName; |
| 30 | |
|
| 31 | |
@Column(name = "Comment") |
| 32 | |
private String comment; |
| 33 | |
|
| 34 | |
public String getComment() { |
| 35 | 0 | return comment; |
| 36 | |
} |
| 37 | |
|
| 38 | |
public Long getEntityId() { |
| 39 | 0 | return entityId; |
| 40 | |
} |
| 41 | |
|
| 42 | |
public String getEntityName() { |
| 43 | 0 | return entityName; |
| 44 | |
} |
| 45 | |
|
| 46 | |
public String getOpName() { |
| 47 | 0 | return opName; |
| 48 | |
} |
| 49 | |
|
| 50 | |
public void setComment(String comment) { |
| 51 | 0 | this.comment = comment; |
| 52 | 0 | } |
| 53 | |
|
| 54 | |
public void setEntityId(Long entityId) { |
| 55 | 25 | this.entityId = entityId; |
| 56 | 25 | } |
| 57 | |
|
| 58 | |
public void setEntityName(String entityName) { |
| 59 | 25 | this.entityName = entityName; |
| 60 | 25 | } |
| 61 | |
|
| 62 | |
public void setOpName(String opName) { |
| 63 | 25 | this.opName = opName; |
| 64 | 25 | } |
| 65 | |
|
| 66 | |
public String toString() { |
| 67 | 0 | return toStringHelper().add("entityName", entityName).add("entityId", entityId) |
| 68 | 0 | .add("opName", opName).add("comment", comment).toString(); |
| 69 | |
} |
| 70 | |
} |