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

http://datanucleus-appengine.googlecode.com/ · Java · 51 lines · 25 code · 7 blank · 19 comment · 0 complexity · 292819ffb968c1178aa596cff22c96ca MD5 · raw file

  1. /*
  2. * /**********************************************************************
  3. * Copyright (c) 2009 Google Inc.
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License");
  6. * you may not use this file except in compliance with the License.
  7. * You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. * **********************************************************************/
  17. package com.google.appengine.datanucleus.test;
  18. import javax.jdo.annotations.Embedded;
  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. * @author Max Ross <maxr@google.com>
  26. */
  27. @PersistenceCapable(identityType = IdentityType.APPLICATION)
  28. public class HasEmbeddedWithKeyPkJDO {
  29. @PrimaryKey
  30. @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
  31. private Long id;
  32. @Persistent
  33. @Embedded(nullIndicatorColumn="str")
  34. private HasKeyPkJDO embedded;
  35. public Long getId() {
  36. return id;
  37. }
  38. public HasKeyPkJDO getEmbedded() {
  39. return embedded;
  40. }
  41. public void setEmbedded(HasKeyPkJDO embedded) {
  42. this.embedded = embedded;
  43. }
  44. }