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.annotations.common.apps.annotApp.annotype;
20:
21: import java.util.*;
22:
23: import javax.persistence.*;
24:
25: import org.apache.openjpa.persistence.*;
26:
27: /**
28: * <p>Entity used to test parsing of @OrderBy.</p>
29: *
30: * @author Abe White
31: */
32: @Entity
33: public class OrderByEntity {
34:
35: @Id
36: private long id;
37: private String string;
38:
39: @PersistentCollection
40: @OrderBy
41: private List<String> strings = new ArrayList();
42:
43: @ManyToMany
44: @OrderBy
45: @JoinTable(name="ORDERBY_PKRELS",inverseJoinColumns=@JoinColumn(name="REL_ID",referencedColumnName="ID"))
46: private List<OrderByEntity> pkRels = new ArrayList();
47:
48: @ManyToMany
49: @OrderBy("string desc")
50: @JoinTable(name="ORDERBY_STRINGRELS",inverseJoinColumns=@JoinColumn(name="REL_ID",referencedColumnName="ID"))
51: private List<OrderByEntity> stringRels = new ArrayList();
52:
53: public long getId() {
54: return this .id;
55: }
56:
57: public void setId(long id) {
58: this .id = id;
59: }
60:
61: public String getString() {
62: return this .string;
63: }
64:
65: public void setString(String string) {
66: this .string = string;
67: }
68:
69: public List<String> getStrings() {
70: return this .strings;
71: }
72:
73: public List<OrderByEntity> getPKRels() {
74: return this .pkRels;
75: }
76:
77: public List<OrderByEntity> getStringRels() {
78: return this.stringRels;
79: }
80: }
|