PageRenderTime 80ms CodeModel.GetById 73ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

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

http://datanucleus-appengine.googlecode.com/
Java | 59 lines | 33 code | 8 blank | 18 comment | 0 complexity | ac4f004ed1d394167630aaa9466ec65b 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;
24import javax.jdo.annotations.Version;
25import javax.jdo.annotations.VersionStrategy;
26
27/**
28 * @author Max Ross <maxr@google.com>
29 */
30@PersistenceCapable(identityType = IdentityType.APPLICATION)
31@Version(
32    strategy = VersionStrategy.VERSION_NUMBER,
33    extensions = {@Extension(vendorName="datanucleus", key="field-name", value="versionField")})
34public class HasVersionWithFieldJDO {
35  @PrimaryKey
36  @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
37  private Long id;
38
39  @Persistent
40  private String value;
41
42  private long versionField;
43
44  public Long getId() {
45    return id;
46  }
47
48  public long getVersion() {
49    return versionField;
50  }
51
52  public String getValue() {
53    return value;
54  }
55
56  public void setValue(String value) {
57    this.value = value;
58  }
59}