PageRenderTime 24ms CodeModel.GetById 10ms RepoModel.GetById 0ms app.codeStats 0ms

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

http://datanucleus-appengine.googlecode.com/
Java | 104 lines | 65 code | 21 blank | 18 comment | 0 complexity | 898aecf2667fc845e758a63b897e22b9 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 com.google.appengine.api.datastore.Link;
  15. import javax.jdo.annotations.FetchGroup;
  16. import javax.jdo.annotations.FetchGroups;
  17. import javax.jdo.annotations.IdGeneratorStrategy;
  18. import javax.jdo.annotations.IdentityType;
  19. import javax.jdo.annotations.PersistenceCapable;
  20. import javax.jdo.annotations.Persistent;
  21. import javax.jdo.annotations.PrimaryKey;
  22. /**
  23. * @author Max Ross <maxr@google.com>
  24. */
  25. @PersistenceCapable(identityType = IdentityType.APPLICATION)
  26. @FetchGroups({
  27. @FetchGroup(name="fg1", members = {@Persistent(name="str3")}),
  28. @FetchGroup(name="fg2", members = {@Persistent(name="str4")})
  29. })
  30. public class HasFetchGroupsJDO {
  31. @PrimaryKey
  32. @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
  33. private Long id;
  34. @Persistent
  35. String str1;
  36. @Persistent(defaultFetchGroup = "true")
  37. String str2;
  38. @Persistent(defaultFetchGroup = "false")
  39. String str3;
  40. @Persistent
  41. String str4;
  42. @Persistent(defaultFetchGroup = "false")
  43. Link link;
  44. public Long getId() {
  45. return id;
  46. }
  47. public void setId(Long id) {
  48. this.id = id;
  49. }
  50. public String getStr1() {
  51. return str1;
  52. }
  53. public void setStr1(String str1) {
  54. this.str1 = str1;
  55. }
  56. public String getStr2() {
  57. return str2;
  58. }
  59. public void setStr2(String str2) {
  60. this.str2 = str2;
  61. }
  62. public String getStr3() {
  63. return str3;
  64. }
  65. public void setStr3(String str3) {
  66. this.str3 = str3;
  67. }
  68. public String getStr4() {
  69. return str4;
  70. }
  71. public void setStr4(String str4) {
  72. this.str4 = str4;
  73. }
  74. public Link getLink() {
  75. return link;
  76. }
  77. public void setLink(Link link) {
  78. this.link = link;
  79. }
  80. }