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

http://datanucleus-appengine.googlecode.com/ · Java · 85 lines · 51 code · 16 blank · 18 comment · 0 complexity · 63e6b5474276b45c6001910aada68418 MD5 · raw file

  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 HasOneToOnesWithDifferentCascadesJDO {
  25. @PrimaryKey
  26. @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
  27. @Extension(vendorName="datanucleus", key="gae.encoded-pk", value="true")
  28. private String id;
  29. @Persistent(dependent = "true")
  30. private HasStringAncestorStringPkJDO cascadeAllChild;
  31. @Persistent(dependent = "true")
  32. private HasKeyAncestorStringPkJDO cascadeAllChildWithKeyAncestor;
  33. @Persistent(dependent = "false")
  34. private HasStringAncestorKeyPkJDO cascadePersistChild;
  35. @Persistent(dependent = "false")
  36. @Extension(vendorName="datanucleus", key="cascade-persist", value="false")
  37. private HasKeyAncestorKeyPkJDO cascadeRemoveChild;
  38. public String getId() {
  39. return id;
  40. }
  41. public HasStringAncestorStringPkJDO getCascadeAllChild() {
  42. return cascadeAllChild;
  43. }
  44. public void setCascadeAllChild(HasStringAncestorStringPkJDO cascadeAllChild) {
  45. this.cascadeAllChild = cascadeAllChild;
  46. }
  47. public HasStringAncestorKeyPkJDO getCascadePersistChild() {
  48. return cascadePersistChild;
  49. }
  50. public void setCascadePersistChild(HasStringAncestorKeyPkJDO cascadePersistChild) {
  51. this.cascadePersistChild = cascadePersistChild;
  52. }
  53. public HasKeyAncestorKeyPkJDO getCascadeRemoveChild() {
  54. return cascadeRemoveChild;
  55. }
  56. public void setCascadeRemoveChild(HasKeyAncestorKeyPkJDO cascadeRemoveChild) {
  57. this.cascadeRemoveChild = cascadeRemoveChild;
  58. }
  59. public HasKeyAncestorStringPkJDO getCascadeAllChildWithKeyAncestor() {
  60. return cascadeAllChildWithKeyAncestor;
  61. }
  62. public void setCascadeAllChildWithKeyAncestor(
  63. HasKeyAncestorStringPkJDO cascadeAllChildWithKeyAncestor) {
  64. this.cascadeAllChildWithKeyAncestor = cascadeAllChildWithKeyAncestor;
  65. }
  66. }