PageRenderTime 21ms CodeModel.GetById 16ms app.highlight 3ms RepoModel.GetById 1ms 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
  1/**********************************************************************
  2Copyright (c) 2009 Google Inc.
  3
  4Licensed under the Apache License, Version 2.0 (the "License");
  5you may not use this file except in compliance with the License.
  6You may obtain a copy of the License at
  7
  8http://www.apache.org/licenses/LICENSE-2.0
  9
 10Unless required by applicable law or agreed to in writing, software
 11distributed under the License is distributed on an "AS IS" BASIS,
 12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13See the License for the specific language governing permissions and
 14limitations under the License.
 15**********************************************************************/
 16package com.google.appengine.datanucleus.test;
 17
 18import com.google.appengine.api.datastore.Link;
 19
 20import javax.jdo.annotations.FetchGroup;
 21import javax.jdo.annotations.FetchGroups;
 22import javax.jdo.annotations.IdGeneratorStrategy;
 23import javax.jdo.annotations.IdentityType;
 24import javax.jdo.annotations.PersistenceCapable;
 25import javax.jdo.annotations.Persistent;
 26import javax.jdo.annotations.PrimaryKey;
 27
 28/**
 29 * @author Max Ross <maxr@google.com>
 30 */
 31@PersistenceCapable(identityType = IdentityType.APPLICATION)
 32@FetchGroups({
 33    @FetchGroup(name="fg1", members = {@Persistent(name="str3")}),
 34    @FetchGroup(name="fg2", members = {@Persistent(name="str4")})
 35})
 36public class HasFetchGroupsJDO {
 37  @PrimaryKey
 38  @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
 39  private Long id;
 40
 41  @Persistent
 42  String str1;
 43
 44  @Persistent(defaultFetchGroup = "true")
 45  String str2;
 46
 47  @Persistent(defaultFetchGroup = "false")
 48  String str3;
 49
 50  @Persistent
 51  String str4;
 52
 53  @Persistent(defaultFetchGroup = "false")
 54  Link link;
 55
 56
 57  public Long getId() {
 58    return id;
 59  }
 60
 61  public void setId(Long id) {
 62    this.id = id;
 63  }
 64
 65  public String getStr1() {
 66    return str1;
 67  }
 68
 69  public void setStr1(String str1) {
 70    this.str1 = str1;
 71  }
 72
 73  public String getStr2() {
 74    return str2;
 75  }
 76
 77  public void setStr2(String str2) {
 78    this.str2 = str2;
 79  }
 80
 81  public String getStr3() {
 82    return str3;
 83  }
 84
 85  public void setStr3(String str3) {
 86    this.str3 = str3;
 87  }
 88
 89  public String getStr4() {
 90    return str4;
 91  }
 92
 93  public void setStr4(String str4) {
 94    this.str4 = str4;
 95  }
 96
 97  public Link getLink() {
 98    return link;
 99  }
100
101  public void setLink(Link link) {
102    this.link = link;
103  }
104}