01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing,
13: * software distributed under the License is distributed on an
14: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: */
19: package org.apache.openjpa.persistence.external;
20:
21: import javax.persistence.Column;
22: import javax.persistence.Entity;
23: import javax.persistence.GeneratedValue;
24: import javax.persistence.Id;
25: import javax.persistence.Table;
26:
27: import org.apache.openjpa.persistence.ExternalValues;
28: import org.apache.openjpa.persistence.Type;
29:
30: @Entity
31: @Table(name="ExternalizationEntityA")
32: public class EntityA implements java.io.Serializable {
33: private static final long serialVersionUID = 1L;
34:
35: @Id
36: @GeneratedValue
37: private int id;
38:
39: @ExternalValues({"SMALL=SML","MEDIUM=MID","LARGE=LRG"})
40: @Column(length=3)
41: private String s1;
42:
43: @ExternalValues({"SMALL=5","MEDIUM=8","LARGE=15"})
44: @Type(int.class)
45: private String s2;
46:
47: public EntityA() {
48: }
49:
50: public int getId() {
51: return id;
52: }
53:
54: public String getS1() {
55: return s1;
56: }
57:
58: public void setS1(String s1) {
59: this .s1 = s1;
60: }
61:
62: public String getS2() {
63: return s2;
64: }
65:
66: public void setS2(String s2) {
67: this.s2 = s2;
68: }
69: }
|