PageRenderTime 23ms CodeModel.GetById 10ms app.highlight 7ms RepoModel.GetById 2ms app.codeStats 0ms

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

http://datanucleus-appengine.googlecode.com/
Java | 54 lines | 27 code | 9 blank | 18 comment | 0 complexity | ae1ef6c1d8a8eca8938ba97cf008ffff 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 org.datanucleus.api.jpa.annotations.Extension;
19
20import javax.persistence.Entity;
21import javax.persistence.GeneratedValue;
22import javax.persistence.GenerationType;
23import javax.persistence.Id;
24
25/**
26 * @author Max Ross <maxr@google.com>
27 */
28@Entity
29public class HasEncodedStringPkSeparateIdFieldJPA {
30
31  @Id
32  @GeneratedValue(strategy= GenerationType.IDENTITY)
33  @Extension(vendorName="datanucleus", key="gae.encoded-pk", value="true")
34  private String key;
35
36  @Extension(vendorName = "datanucleus", key="gae.pk-id", value="true")
37  private Long id;
38
39  public String getKey() {
40    return key;
41  }
42
43  public void setId(String key) {
44    this.key = key;
45  }
46
47  public Long getId() {
48    return id;
49  }
50
51  public void setId(Long id) {
52    this.id = id;
53  }
54}