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

http://thoughtsite.googlecode.com/ · Java · 80 lines · 43 code · 17 blank · 20 comment · 0 complexity · 3ffdc050856f75b2746bed36cf624cd2 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 com.google.appengine.api.datastore.Key;
  17. import com.google.appengine.api.datastore.KeyFactory;
  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. @PersistenceCapable(identityType = IdentityType.APPLICATION)
  25. public class EntityIndex {
  26. @PrimaryKey
  27. @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
  28. private Key key;
  29. @Persistent
  30. private int indexed;
  31. @Persistent
  32. @Extension(vendorName = "datanucleus", key = "gae.parent-pk", value = "true")
  33. private Key parentKey;
  34. /**
  35. * Construct ideaIndexStatus entity whose parent idea identified by
  36. * ideaKey
  37. *
  38. * @param ideaKey
  39. */
  40. public EntityIndex(String parentKey) {
  41. this.parentKey = KeyFactory.stringToKey(parentKey);
  42. }
  43. public EntityIndex() {
  44. }
  45. public int getIndexed() {
  46. return indexed;
  47. }
  48. public void setIndexed(int indexed) {
  49. this.indexed = indexed;
  50. }
  51. public Key getKey() {
  52. return key;
  53. }
  54. public void setKey(Key key) {
  55. this.key = key;
  56. }
  57. public Key getParentKey() {
  58. return parentKey;
  59. }
  60. public void setParentKey(Key parentKey) {
  61. this.parentKey = parentKey;
  62. }
  63. }