PageRenderTime 37ms CodeModel.GetById 24ms app.highlight 8ms RepoModel.GetById 1ms app.codeStats 0ms

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

http://datanucleus-appengine.googlecode.com/
Java | 76 lines | 44 code | 14 blank | 18 comment | 0 complexity | 526f5d54564dc501b48b7ec281237bf7 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 java.util.List;
19
20import javax.jdo.annotations.IdGeneratorStrategy;
21import javax.jdo.annotations.IdentityType;
22import javax.jdo.annotations.PersistenceCapable;
23import javax.jdo.annotations.Persistent;
24import javax.jdo.annotations.PrimaryKey;
25
26/**
27 * @author Max Ross <maxr@google.com>
28 */
29@PersistenceCapable(identityType = IdentityType.APPLICATION)
30public class HasEnumJDO {
31  @PrimaryKey
32  @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
33  private Long key;
34
35  @Persistent
36  private MyEnum myEnum;
37  @Persistent
38  private MyEnum[] myEnumArray;
39  @Persistent
40  private List<MyEnum> myEnumList;
41
42
43  public Long getKey() {
44    return key;
45  }
46
47  public void setKey(Long key) {
48    this.key = key;
49  }
50
51  public MyEnum getMyEnum() {
52    return myEnum;
53  }
54
55  public void setMyEnum(MyEnum myEnum) {
56    this.myEnum = myEnum;
57  }
58
59  public MyEnum[] getMyEnumArray() {
60    return myEnumArray;
61  }
62
63  public void setMyEnumArray(MyEnum[] myEnumArray) {
64    this.myEnumArray = myEnumArray;
65  }
66
67  public List<MyEnum> getMyEnumList() {
68    return myEnumList;
69  }
70
71  public void setMyEnumList(List<MyEnum> myEnumList) {
72    this.myEnumList = myEnumList;
73  }
74
75  public enum MyEnum {V1, V2};
76}