Advertisement
Guest User

action entity

a guest
Jul 15th, 2014
4
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.36 KB | None | 0 0
  1. import javax.persistence.*;
  2. import java.util.Date;
  3. import java.util.Map;
  4. import java.util.UUID;
  5. import javax.persistence.Index;
  6. import javax.persistence.Id;
  7. import javax.persistence.Table;
  8.  
  9. @Entity
  10. @Table(name="Action",
  11.         indexes = {
  12.         @Index(name="action_serverId_idx", columnList="serverId")
  13. })
  14. public class Action {
  15.  
  16.     @Id()
  17.     private UUID id = UUID.randomUUID();
  18.  
  19.     private String userSession;
  20.     private String referer;
  21.     private String userAgent;
  22.     private Date requestTime;
  23.     private Integer actionType;
  24.     private Map<Date, String> context;
  25.     private int serverId;
  26.  
  27.     public Map<Date, String> getContext() {
  28.         return context;
  29.     }
  30.  
  31.     public void setContext(Map<Date, String> context) {
  32.         this.context = context;
  33.     }
  34.  
  35.     public Date getRequestTime() {
  36.         return requestTime;
  37.     }
  38.  
  39.     public void setRequestTime(Date requestTime) {
  40.         this.requestTime = requestTime;
  41.     }
  42.  
  43.     public UUID getId() {
  44.         return id;
  45.     }
  46.  
  47.     public void setId(UUID id) {
  48.         this.id = id;
  49.     }
  50.  
  51.     public String getUserSession() {
  52.         return userSession;
  53.     }
  54.  
  55.     public void setUserSession(String userSession) {
  56.         this.userSession = userSession;
  57.     }
  58.  
  59.     public String getReferer() {
  60.         return referer;
  61.     }
  62.  
  63.     public void setReferer(String referer) {
  64.         this.referer = referer;
  65.     }
  66.  
  67.     public String getUserAgent() {
  68.         return userAgent;
  69.     }
  70.  
  71.     public void setUserAgent(String userAgent) {
  72.         this.userAgent = userAgent;
  73.     }
  74.  
  75.     public Integer getActionType() {
  76.         return actionType;
  77.     }
  78.  
  79.     public void setActionType(Integer actionType) {
  80.         this.actionType = actionType;
  81.     }
  82.  
  83.     public int getServerId() {
  84.         return serverId;
  85.     }
  86.  
  87.     public void setServerId(int serverId) {
  88.         this.serverId = serverId;
  89.     }
  90.  
  91.     @Override
  92.     public String toString() {
  93.         return "Action{" +
  94.                 "id=" + id +
  95.                 ", userSession='" + userSession + '\'' +
  96.                 ", referer='" + referer + '\'' +
  97.                 ", userAgent='" + userAgent + '\'' +
  98.                 ", requestTime=" + requestTime +
  99.                 ", actionType=" + actionType +
  100.                 ", context=" + context +
  101.                 ", serverId=" + serverId +
  102.                 '}';
  103.     }
  104. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement