##### Coverage Report - com.ctrip.apollo.biz.entity.Audit

Classes in this File | Line Coverage | Branch Coverage | Complexity
Audit |
50% | 8/16
N/A | N/A
| 1.0;1
Audit$OP |
100% | 2/2
N/A | N/A
| 1.0;1

1 |  |
     package com.ctrip.apollo.biz.entity;
2 |  |
3 |  |
     import javax.persistence.Column;
4 |  |
     import javax.persistence.Entity;
5 |  |
     import javax.persistence.Table;
6 |  |
7 |  |
     import org.hibernate.annotations.SQLDelete;
8 |  |
     import org.hibernate.annotations.Where;
9 |  |
10 |  |
     @Entity
11 |  |
     @Table(name = "Audit")
12 |  |
     @SQLDelete(sql = "Update Audit set isDeleted = 1 where id = ?")
13 |  |
     @Where(clause = "isDeleted = 0")
14 | 22 |
     public class Audit extends BaseEntity {
15 |  |
16 | 22 |
       public enum OP {
17 | 1 |
         INSERT, UPDATE, DELETE
18 |  |
       }
19 |  |
20 |  |
       @Column(name = "EntityName", nullable = false)
21 |  |
       private String entityName;
22 |  |
23 |  |
       @Column(name = "EntityId")
24 |  |
       private Long entityId;
25 |  |
26 |  |
       @Column(name = "OpName", nullable = false)
27 |  |
       private String opName;
28 |  |
29 |  |
       @Column(name = "Comment")
30 |  |
       private String comment;
31 |  |
32 |  |
       public String getComment() {
33 | 0 |
         return comment;
34 |  |
       }
35 |  |
36 |  |
       public Long getEntityId() {
37 | 0 |
         return entityId;
38 |  |
       }
39 |  |
40 |  |
       public String getEntityName() {
41 | 0 |
         return entityName;
42 |  |
       }
43 |  |
44 |  |
       public String getOpName() {
45 | 0 |
         return opName;
46 |  |
       }
47 |  |
48 |  |
       public void setComment(String comment) {
49 | 0 |
         this.comment = comment;
50 | 0 |
       }
51 |  |
52 |  |
       public void setEntityId(Long entityId) {
53 | 21 |
         this.entityId = entityId;
54 | 21 |
       }
55 |  |
56 |  |
       public void setEntityName(String entityName) {
57 | 21 |
         this.entityName = entityName;
58 | 21 |
       }
59 |  |
60 |  |
       public void setOpName(String opName) {
61 | 21 |
         this.opName = opName;
62 | 21 |
       }
63 |  |
64 |  |
       public String toString() {
65 | 0 |
         return toStringHelper().add("entityName", entityName).add("entityId", entityId)
66 | 0 |
             .add("opName", opName).add("comment", comment).toString();
67 |  |
       }
68 |  |
     }