PageRenderTime 21ms CodeModel.GetById 17ms app.highlight 2ms RepoModel.GetById 1ms 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
 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 javax.jdo.annotations.Extension;
19import javax.jdo.annotations.IdGeneratorStrategy;
20import javax.jdo.annotations.IdentityType;
21import javax.jdo.annotations.PersistenceCapable;
22import javax.jdo.annotations.Persistent;
23import javax.jdo.annotations.PrimaryKey;
24
25/**
26 * @author Max Ross <maxr@google.com>
27 */
28@PersistenceCapable(identityType = IdentityType.APPLICATION)
29public class HasStringAncestorStringPkJDO {
30  @Persistent
31  @Extension(vendorName="datanucleus", key="gae.parent-pk", value="true")
32  private String ancestorId;
33
34  @PrimaryKey
35  @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
36  @Extension(vendorName = "datanucleus", key = "gae.encoded-pk", value="true")
37  private String id;
38
39  public HasStringAncestorStringPkJDO() {
40  }
41
42  public HasStringAncestorStringPkJDO(String ancestorId) {
43    this(ancestorId, null);
44  }
45
46  public HasStringAncestorStringPkJDO(String ancestorId, String id) {
47    this.ancestorId = ancestorId;
48    this.id = id;
49  }
50
51  public String getAncestorId() {
52    return ancestorId;
53  }
54
55  public String getId() {
56    return id;
57  }
58
59  public void setAncestorId(String ancestorId) {
60    this.ancestorId = ancestorId;
61  }
62}