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.jdbc.annotations;
20:
21: import java.util.*;
22:
23: import javax.persistence.*;
24:
25: import org.apache.openjpa.jdbc.meta.strats.*;
26: import org.apache.openjpa.persistence.*;
27: import org.apache.openjpa.persistence.jdbc.*;
28:
29: @Entity
30: @DataStoreId(strategy=GenerationType.SEQUENCE,generator="system")
31: @DataCache(enabled=false)
32: @FetchGroup(name="detail",attributes={@FetchAttribute(name="rel",recursionDepth=-1),@FetchAttribute(name="seq")})
33: @VersionStrategy(StateComparisonVersionStrategy.ALIAS)
34: public class ExtensionsEntity {
35:
36: @GeneratedValue(generator="uuid-hex")
37: @Column(name="UUID_HEX")
38: private String uuid;
39:
40: @Basic(fetch=FetchType.LAZY)
41: @GeneratedValue(strategy=GenerationType.SEQUENCE,generator="system")
42: @ReadOnly
43: private int seq;
44:
45: @ManyToOne(fetch=FetchType.LAZY)
46: @JoinColumn(name="REL_ID",referencedColumnName="ID")
47: @Dependent
48: @InverseLogical("owner")
49: private ExtensionsEntity rel;
50:
51: @ManyToOne
52: @JoinColumn(name="OWNER_ID",referencedColumnName="ID")
53: private ExtensionsEntity owner;
54:
55: @ManyToMany
56: @LRS
57: private Collection<ExtensionsEntity> lrs;
58:
59: @ManyToMany
60: @EagerFetchMode(FetchMode.JOIN)
61: @ElementClassCriteria
62: @ElementDependent
63: private Collection<ExtensionsEntity> eager;
64:
65: @ExternalValues({"M=1","F=2"})
66: @Type(int.class)
67: private char externalValues;
68:
69: @Persistent
70: @Externalizer("getName")
71: @Factory("Class.forName")
72: private Class externalizer;
73:
74: public char getExternalValues() {
75: return this .externalValues;
76: }
77:
78: public void setExternalValues(char externalValues) {
79: this .externalValues = externalValues;
80: }
81:
82: public Class getExternalizer() {
83: return this .externalizer;
84: }
85:
86: public void setExternalizer(Class externalizer) {
87: this.externalizer = externalizer;
88: }
89: }
|