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

http://thoughtsite.googlecode.com/ · Java · 125 lines · 58 code · 22 blank · 45 comment · 0 complexity · 592a4de6343a20cfa607c27729a94424 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.Inheritance;
  22. import javax.jdo.annotations.InheritanceStrategy;
  23. import javax.jdo.annotations.PersistenceCapable;
  24. import javax.jdo.annotations.Persistent;
  25. import javax.jdo.annotations.PrimaryKey;
  26. @PersistenceCapable(identityType = IdentityType.APPLICATION, detachable = "true")
  27. @Inheritance(strategy = InheritanceStrategy.SUBCLASS_TABLE)
  28. public abstract class Vote implements Serializable {
  29. /** A unique identifier for the class */
  30. private static final long serialVersionUID = 8590211958439336159L;
  31. @PrimaryKey
  32. @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
  33. @Extension(vendorName = "datanucleus", key = "gae.encoded-pk", value = "true")
  34. private String key;
  35. @Persistent
  36. private boolean positiveVote;
  37. @Persistent
  38. private long votePoints;
  39. @Persistent
  40. private Date votingDate;
  41. @Persistent
  42. private String creatorKey;
  43. /**
  44. * @return the creatorKey
  45. */
  46. public String getCreatorKey() {
  47. return creatorKey;
  48. }
  49. /**
  50. * @param creatorKey the creatorKey to set
  51. */
  52. public void setCreatorKey(String creatorKey) {
  53. this.creatorKey = creatorKey;
  54. }
  55. /**
  56. * @return the key
  57. */
  58. public String getKey() {
  59. return key;
  60. }
  61. /**
  62. * @param key the key to set
  63. */
  64. public void setKey(String key) {
  65. this.key = key;
  66. }
  67. /**
  68. * @return the positiveVote
  69. */
  70. public boolean isPositiveVote() {
  71. return positiveVote;
  72. }
  73. /**
  74. * @param positiveVote the positiveVote to set
  75. */
  76. public void setPositiveVote(boolean positiveVote) {
  77. this.positiveVote = positiveVote;
  78. }
  79. /**
  80. * @return the votePoints
  81. */
  82. public long getVotePoints() {
  83. return votePoints;
  84. }
  85. /**
  86. * @param votePoints the votePoints to set
  87. */
  88. public void setVotePoints(long votePoints) {
  89. this.votePoints = votePoints;
  90. }
  91. /**
  92. * @return the votingDate
  93. */
  94. public Date getVotingDate() {
  95. return votingDate;
  96. }
  97. /**
  98. * @param votingDate the votingDate to set
  99. */
  100. public void setVotingDate(Date votingDate) {
  101. this.votingDate = votingDate;
  102. }
  103. }