/src/main/java/com/google/ie/business/domain/Audit.java

http://thoughtsite.googlecode.com/ · Java · 135 lines · 71 code · 28 blank · 36 comment · 0 complexity · 432e6db6a23612069260e6e68b943811 MD5 · raw file

  1. /* Copyright 2010 Google Inc.
  2. *
  3. * Licensed under the Apache License, Version 2.0 (the "License");
  4. * you may not use this file except in compliance with the License.
  5. * You may obtain a copy of the License at
  6. *
  7. * http://www.apache.org/licenses/LICENSE-2.0
  8. *
  9. * Unless required by applicable law or agreed to in writing, software
  10. * distributed under the License is distributed on an "AS IS" BASIS.
  11. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. * See the License for the specific language governing permissions and
  13. * limitations under the License
  14. */
  15. package com.google.ie.business.domain;
  16. import java.io.Serializable;
  17. import java.util.Date;
  18. import javax.jdo.annotations.Extension;
  19. import javax.jdo.annotations.IdGeneratorStrategy;
  20. import javax.jdo.annotations.IdentityType;
  21. import javax.jdo.annotations.PersistenceCapable;
  22. import javax.jdo.annotations.Persistent;
  23. import javax.jdo.annotations.PrimaryKey;
  24. /**
  25. *
  26. * @author abraina
  27. *
  28. */
  29. @PersistenceCapable(identityType = IdentityType.APPLICATION, detachable = "true")
  30. public class Audit implements Serializable {
  31. /** A unique identifier for the class */
  32. private static final long serialVersionUID = -6200216596199040053L;
  33. @PrimaryKey
  34. @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
  35. @Extension(vendorName = "datanucleus", key = "gae.encoded-pk", value = "true")
  36. private String key;
  37. @Persistent
  38. private String action;
  39. @Persistent
  40. private String entityKey;
  41. @Persistent
  42. private String userKey;
  43. @Persistent
  44. private String entityType;
  45. @Persistent
  46. private Date auditDate;
  47. public Audit() {
  48. }
  49. /**
  50. * @return the key
  51. */
  52. public String getKey() {
  53. return key;
  54. }
  55. /**
  56. * @param key the key to set
  57. */
  58. public void setKey(String key) {
  59. this.key = key;
  60. }
  61. public String getAction() {
  62. return action;
  63. }
  64. public void setAction(String action) {
  65. this.action = action;
  66. }
  67. public String getEntityKey() {
  68. return entityKey;
  69. }
  70. public void setEntityKey(String entityKey) {
  71. this.entityKey = entityKey;
  72. }
  73. public String getUserKey() {
  74. return userKey;
  75. }
  76. public void setUserKey(String userKey) {
  77. this.userKey = userKey;
  78. }
  79. public Date getAuditDate() {
  80. return auditDate;
  81. }
  82. public void setAuditDate(Date auditDate) {
  83. this.auditDate = auditDate;
  84. }
  85. /**
  86. * @param entityType the entityType to set
  87. */
  88. public void setEntityType(String entityType) {
  89. this.entityType = entityType;
  90. }
  91. /**
  92. * @return the entityType
  93. */
  94. public String getEntityType() {
  95. return entityType;
  96. }
  97. /*
  98. * (non-Javadoc)
  99. * @see java.lang.Object#toString()
  100. */
  101. @Override
  102. public String toString() {
  103. return "Audit [action=" + action + ", auditDate=" + auditDate + ", entityKey=" + entityKey
  104. + ", entityType=" + entityType + ", key=" + key + ", userKey=" + userKey
  105. + "]";
  106. }
  107. }