Source Code Cross Referenced for ManyToOne.java in  » J2EE » openejb3 » org » apache » openejb » jee » jpa » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » openejb3 » org.apache.openejb.jee.jpa 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * Licensed to the Apache Software Foundation (ASF) under one or more
003:         * contributor license agreements.  See the NOTICE file distributed with
004:         * this work for additional information regarding copyright ownership.
005:         * The ASF licenses this file to You under the Apache License, Version 2.0
006:         * (the "License"); you may not use this file except in compliance with
007:         * the License.  You may obtain a copy of the License at
008:         *
009:         *     http://www.apache.org/licenses/LICENSE-2.0
010:         *
011:         * Unless required by applicable law or agreed to in writing, software
012:         * distributed under the License is distributed on an "AS IS" BASIS,
013:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         * See the License for the specific language governing permissions and
015:         * limitations under the License.
016:         */package org.apache.openejb.jee.jpa;
017:
018:        import java.util.ArrayList;
019:        import java.util.List;
020:        import javax.xml.bind.annotation.XmlAccessType;
021:        import javax.xml.bind.annotation.XmlAccessorType;
022:        import javax.xml.bind.annotation.XmlAttribute;
023:        import javax.xml.bind.annotation.XmlElement;
024:        import javax.xml.bind.annotation.XmlType;
025:        import javax.xml.bind.annotation.XmlTransient;
026:
027:        /**
028:         *
029:         *
030:         *         @Target({METHOD, FIELD}) @Retention(RUNTIME)
031:         *         public @interface ManyToOne {
032:         *           Class targetEntity() default void.class;
033:         *           CascadeType[] cascade() default {};
034:         *           FetchType fetch() default EAGER;
035:         *           boolean optional() default true;
036:         *         }
037:         *
038:         *
039:         *
040:         * <p>Java class for many-to-one complex type.
041:         *
042:         * <p>The following schema fragment specifies the expected content contained within this class.
043:         *
044:         * <pre>
045:         * &lt;complexType name="many-to-one">
046:         *   &lt;complexContent>
047:         *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
048:         *       &lt;sequence>
049:         *         &lt;choice>
050:         *           &lt;element name="join-column" type="{http://java.sun.com/xml/ns/persistence/orm}join-column" maxOccurs="unbounded" minOccurs="0"/>
051:         *           &lt;element name="join-table" type="{http://java.sun.com/xml/ns/persistence/orm}join-table" minOccurs="0"/>
052:         *         &lt;/choice>
053:         *         &lt;element name="cascade" type="{http://java.sun.com/xml/ns/persistence/orm}cascade-type" minOccurs="0"/>
054:         *       &lt;/sequence>
055:         *       &lt;attribute name="fetch" type="{http://java.sun.com/xml/ns/persistence/orm}fetch-type" />
056:         *       &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
057:         *       &lt;attribute name="optional" type="{http://www.w3.org/2001/XMLSchema}boolean" />
058:         *       &lt;attribute name="target-entity" type="{http://www.w3.org/2001/XMLSchema}string" />
059:         *     &lt;/restriction>
060:         *   &lt;/complexContent>
061:         * &lt;/complexType>
062:         * </pre>
063:         *
064:         *
065:         */
066:        @XmlAccessorType(XmlAccessType.FIELD)
067:        @XmlType(name="many-to-one",propOrder={"joinColumn","joinTable","cascade"})
068:        public class ManyToOne implements  RelationField {
069:
070:            @XmlElement(name="join-column")
071:            protected List<JoinColumn> joinColumn;
072:            @XmlElement(name="join-table")
073:            protected JoinTable joinTable;
074:            protected CascadeType cascade;
075:            @XmlAttribute
076:            protected FetchType fetch;
077:            @XmlAttribute(required=true)
078:            protected String name;
079:            @XmlAttribute
080:            protected Boolean optional;
081:            @XmlAttribute(name="target-entity")
082:            protected String targetEntity;
083:            @XmlTransient
084:            protected RelationField relatedField;
085:            @XmlTransient
086:            protected boolean syntheticField;
087:
088:            /**
089:             * Gets the value of the joinColumn property.
090:             *
091:             * <p>
092:             * This accessor method returns a reference to the live list,
093:             * not a snapshot. Therefore any modification you make to the
094:             * returned list will be present inside the JAXB object.
095:             * This is why there is not a <CODE>set</CODE> method for the joinColumn property.
096:             *
097:             * <p>
098:             * For example, to add a new item, do as follows:
099:             * <pre>
100:             *    getJoinColumn().add(newItem);
101:             * </pre>
102:             *
103:             *
104:             * <p>
105:             * Objects of the following type(s) are allowed in the list
106:             * {@link JoinColumn }
107:             *
108:             *
109:             */
110:            public List<JoinColumn> getJoinColumn() {
111:                if (joinColumn == null) {
112:                    joinColumn = new ArrayList<JoinColumn>();
113:                }
114:                return this .joinColumn;
115:            }
116:
117:            /**
118:             * Gets the value of the joinTable property.
119:             *
120:             * @return
121:             *     possible object is
122:             *     {@link JoinTable }
123:             *
124:             */
125:            public JoinTable getJoinTable() {
126:                return joinTable;
127:            }
128:
129:            /**
130:             * Sets the value of the joinTable property.
131:             *
132:             * @param value
133:             *     allowed object is
134:             *     {@link JoinTable }
135:             *
136:             */
137:            public void setJoinTable(JoinTable value) {
138:                this .joinTable = value;
139:            }
140:
141:            /**
142:             * Gets the value of the cascade property.
143:             *
144:             * @return
145:             *     possible object is
146:             *     {@link CascadeType }
147:             *
148:             */
149:            public CascadeType getCascade() {
150:                return cascade;
151:            }
152:
153:            /**
154:             * Sets the value of the cascade property.
155:             *
156:             * @param value
157:             *     allowed object is
158:             *     {@link CascadeType }
159:             *
160:             */
161:            public void setCascade(CascadeType value) {
162:                this .cascade = value;
163:            }
164:
165:            /**
166:             * Gets the value of the fetch property.
167:             *
168:             * @return
169:             *     possible object is
170:             *     {@link FetchType }
171:             *
172:             */
173:            public FetchType getFetch() {
174:                return fetch;
175:            }
176:
177:            /**
178:             * Sets the value of the fetch property.
179:             *
180:             * @param value
181:             *     allowed object is
182:             *     {@link FetchType }
183:             *
184:             */
185:            public void setFetch(FetchType value) {
186:                this .fetch = value;
187:            }
188:
189:            /**
190:             * Gets the value of the name property.
191:             *
192:             * @return
193:             *     possible object is
194:             *     {@link String }
195:             *
196:             */
197:            public String getName() {
198:                return name;
199:            }
200:
201:            /**
202:             * Sets the value of the name property.
203:             *
204:             * @param value
205:             *     allowed object is
206:             *     {@link String }
207:             *
208:             */
209:            public void setName(String value) {
210:                this .name = value;
211:            }
212:
213:            /**
214:             * Gets the value of the optional property.
215:             *
216:             * @return
217:             *     possible object is
218:             *     {@link Boolean }
219:             *
220:             */
221:            public Boolean isOptional() {
222:                return optional;
223:            }
224:
225:            /**
226:             * Sets the value of the optional property.
227:             *
228:             * @param value
229:             *     allowed object is
230:             *     {@link Boolean }
231:             *
232:             */
233:            public void setOptional(Boolean value) {
234:                this .optional = value;
235:            }
236:
237:            /**
238:             * Gets the value of the targetEntity property.
239:             *
240:             * @return
241:             *     possible object is
242:             *     {@link String }
243:             *
244:             */
245:            public String getTargetEntity() {
246:                return targetEntity;
247:            }
248:
249:            /**
250:             * Sets the value of the targetEntity property.
251:             *
252:             * @param value
253:             *     allowed object is
254:             *     {@link String }
255:             *
256:             */
257:            public void setTargetEntity(String value) {
258:                this .targetEntity = value;
259:            }
260:
261:            public String getMappedBy() {
262:                throw new UnsupportedOperationException(
263:                        "Many to one element can not have mapped-by");
264:            }
265:
266:            public void setMappedBy(String value) {
267:                throw new UnsupportedOperationException(
268:                        "Many to one element can not have mapped-by");
269:            }
270:
271:            /**
272:             * This is only used for xml converters and will normally return null.
273:             * Gets the field on the target entity for this relationship.
274:             * @return the field on the target entity for this relationship.
275:             */
276:            public RelationField getRelatedField() {
277:                return relatedField;
278:            }
279:
280:            /**
281:             * Gets the field on the target entity for this relationship.
282:             * @param value field on the target entity for this relationship.
283:             */
284:            public void setRelatedField(RelationField value) {
285:                this .relatedField = value;
286:            }
287:
288:            /**
289:             * This is only used for xml converters and will normally return false.
290:             * A true value indicates that this field was generated for CMR back references.
291:             * @return true if this field was generated for CMR back references.
292:             */
293:            public boolean isSyntheticField() {
294:                return syntheticField;
295:            }
296:
297:            /**
298:             * This is only used for xml converters and will normally return false.
299:             * A true value indicates that this field was generated for CMR back references.
300:             * @return true if this field was generated for CMR back references.
301:             */
302:            public void setSyntheticField(boolean syntheticField) {
303:                this.syntheticField = syntheticField;
304:            }
305:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.