KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cayenne > jpa > map > JpaRelationship


1 /*****************************************************************
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the
7  * "License"); you may not use this file except in compliance
8  * with the License. You may obtain a copy of the License at
9  *
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
20 package org.apache.cayenne.jpa.map;
21
22 import javax.persistence.FetchType;
23
24 public abstract class JpaRelationship extends JpaAttribute {
25
26     protected String JavaDoc targetEntityName;
27     protected FetchType fetch;
28     protected JpaCascade cascade;
29
30     public abstract boolean isToMany();
31
32     public FetchType getFetch() {
33         return fetch;
34     }
35
36     public void setFetch(FetchType fetch) {
37         this.fetch = fetch;
38     }
39
40     public String JavaDoc getTargetEntityName() {
41         return targetEntityName;
42     }
43
44     public void setTargetEntityName(String JavaDoc targetEntityName) {
45         this.targetEntityName = targetEntityName;
46     }
47
48     public JpaCascade getCascade() {
49         return cascade;
50     }
51
52     public void setCascade(JpaCascade cascades) {
53         this.cascade = cascades;
54     }
55
56     @Override JavaDoc
57     public String JavaDoc toString() {
58         String JavaDoc className = getClass().getName();
59         return className.substring(className.lastIndexOf('.') + 1) + ":" + name;
60     }
61 }
62
Popular Tags