PageRenderTime 100ms CodeModel.GetById 96ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

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

http://datanucleus-appengine.googlecode.com/
Java | 56 lines | 30 code | 8 blank | 18 comment | 0 complexity | 1c83ecbb04ec6020b91e9776a671729a 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.Key;
19
20import javax.jdo.annotations.Extension;
21import javax.jdo.annotations.IdGeneratorStrategy;
22import javax.jdo.annotations.IdentityType;
23import javax.jdo.annotations.PersistenceCapable;
24import javax.jdo.annotations.Persistent;
25import javax.jdo.annotations.PrimaryKey;
26
27/**
28 * @author Max Ross <maxr@google.com>
29 */
30@PersistenceCapable(identityType = IdentityType.APPLICATION)
31public class HasKeyAncestorStringPkJDO {
32  @PrimaryKey
33  @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
34  @Extension(vendorName = "datanucleus", key = "gae.encoded-pk", value="true")
35  private String key;
36
37  @Persistent
38  @Extension(vendorName="datanucleus", key="gae.parent-pk", value="true")
39  private Key ancestorKey;
40
41  public String getKey() {
42    return key;
43  }
44
45  public void setKey(String key) {
46    this.key = key;
47  }
48
49  public Key getAncestorKey() {
50    return ancestorKey;
51  }
52
53  public void setAncestorKey(Key ancestorKey) {
54    this.ancestorKey = ancestorKey;
55  }
56}