PageRenderTime 19ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/tests/com/google/appengine/datanucleus/test/HasStringAncestorStringPkJDO.java

http://datanucleus-appengine.googlecode.com/
Java | 62 lines | 35 code | 9 blank | 18 comment | 0 complexity | f91101c9fb689c34222ad4db7a9392f6 MD5 | raw file
Possible License(s): Apache-2.0
  1. /**********************************************************************
  2. Copyright (c) 2009 Google Inc.
  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. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. **********************************************************************/
  13. package com.google.appengine.datanucleus.test;
  14. import javax.jdo.annotations.Extension;
  15. import javax.jdo.annotations.IdGeneratorStrategy;
  16. import javax.jdo.annotations.IdentityType;
  17. import javax.jdo.annotations.PersistenceCapable;
  18. import javax.jdo.annotations.Persistent;
  19. import javax.jdo.annotations.PrimaryKey;
  20. /**
  21. * @author Max Ross <maxr@google.com>
  22. */
  23. @PersistenceCapable(identityType = IdentityType.APPLICATION)
  24. public class HasStringAncestorStringPkJDO {
  25. @Persistent
  26. @Extension(vendorName="datanucleus", key="gae.parent-pk", value="true")
  27. private String ancestorId;
  28. @PrimaryKey
  29. @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
  30. @Extension(vendorName = "datanucleus", key = "gae.encoded-pk", value="true")
  31. private String id;
  32. public HasStringAncestorStringPkJDO() {
  33. }
  34. public HasStringAncestorStringPkJDO(String ancestorId) {
  35. this(ancestorId, null);
  36. }
  37. public HasStringAncestorStringPkJDO(String ancestorId, String id) {
  38. this.ancestorId = ancestorId;
  39. this.id = id;
  40. }
  41. public String getAncestorId() {
  42. return ancestorId;
  43. }
  44. public String getId() {
  45. return id;
  46. }
  47. public void setAncestorId(String ancestorId) {
  48. this.ancestorId = ancestorId;
  49. }
  50. }