Source Code Cross Referenced for OneToMany.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 OneToMany {
032:         *           Class targetEntity() default void.class;
033:         *           CascadeType[] cascade() default {};
034:         *           FetchType fetch() default LAZY;
035:         *           String mappedBy() default "";
036:         *         }
037:         *
038:         *
039:         *
040:         * <p>Java class for one-to-many complex type.
041:         *
042:         * <p>The following schema fragment specifies the expected content contained within this class.
043:         *
044:         * <pre>
045:         * &lt;complexType name="one-to-many">
046:         *   &lt;complexContent>
047:         *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
048:         *       &lt;sequence>
049:         *         &lt;element name="order-by" type="{http://java.sun.com/xml/ns/persistence/orm}order-by" minOccurs="0"/>
050:         *         &lt;element name="map-key" type="{http://java.sun.com/xml/ns/persistence/orm}map-key" minOccurs="0"/>
051:         *         &lt;choice>
052:         *           &lt;element name="join-table" type="{http://java.sun.com/xml/ns/persistence/orm}join-table" minOccurs="0"/>
053:         *           &lt;element name="join-column" type="{http://java.sun.com/xml/ns/persistence/orm}join-column" maxOccurs="unbounded" minOccurs="0"/>
054:         *         &lt;/choice>
055:         *         &lt;element name="cascade" type="{http://java.sun.com/xml/ns/persistence/orm}cascade-type" minOccurs="0"/>
056:         *       &lt;/sequence>
057:         *       &lt;attribute name="fetch" type="{http://java.sun.com/xml/ns/persistence/orm}fetch-type" />
058:         *       &lt;attribute name="mapped-by" type="{http://www.w3.org/2001/XMLSchema}string" />
059:         *       &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
060:         *       &lt;attribute name="target-entity" type="{http://www.w3.org/2001/XMLSchema}string" />
061:         *     &lt;/restriction>
062:         *   &lt;/complexContent>
063:         * &lt;/complexType>
064:         * </pre>
065:         *
066:         *
067:         */
068:        @XmlAccessorType(XmlAccessType.FIELD)
069:        @XmlType(name="one-to-many",propOrder={"orderBy","mapKey","joinTable","joinColumn","cascade"})
070:        public class OneToMany implements  RelationField {
071:
072:            @XmlElement(name="order-by")
073:            protected String orderBy;
074:            @XmlElement(name="map-key")
075:            protected MapKey mapKey;
076:            @XmlElement(name="join-table")
077:            protected JoinTable joinTable;
078:            @XmlElement(name="join-column")
079:            protected List<JoinColumn> joinColumn;
080:            protected CascadeType cascade;
081:            @XmlAttribute
082:            protected FetchType fetch;
083:            @XmlAttribute(name="mapped-by")
084:            protected String mappedBy;
085:            @XmlAttribute(required=true)
086:            protected String name;
087:            @XmlAttribute(name="target-entity")
088:            protected String targetEntity;
089:            @XmlTransient
090:            protected RelationField relatedField;
091:            @XmlTransient
092:            protected boolean syntheticField;
093:
094:            /**
095:             * Gets the value of the orderBy property.
096:             *
097:             * @return
098:             *     possible object is
099:             *     {@link String }
100:             *
101:             */
102:            public String getOrderBy() {
103:                return orderBy;
104:            }
105:
106:            /**
107:             * Sets the value of the orderBy property.
108:             *
109:             * @param value
110:             *     allowed object is
111:             *     {@link String }
112:             *
113:             */
114:            public void setOrderBy(String value) {
115:                this .orderBy = value;
116:            }
117:
118:            /**
119:             * Gets the value of the mapKey property.
120:             *
121:             * @return
122:             *     possible object is
123:             *     {@link MapKey }
124:             *
125:             */
126:            public MapKey getMapKey() {
127:                return mapKey;
128:            }
129:
130:            /**
131:             * Sets the value of the mapKey property.
132:             *
133:             * @param value
134:             *     allowed object is
135:             *     {@link MapKey }
136:             *
137:             */
138:            public void setMapKey(MapKey value) {
139:                this .mapKey = value;
140:            }
141:
142:            /**
143:             * Gets the value of the joinTable property.
144:             *
145:             * @return
146:             *     possible object is
147:             *     {@link JoinTable }
148:             *
149:             */
150:            public JoinTable getJoinTable() {
151:                return joinTable;
152:            }
153:
154:            /**
155:             * Sets the value of the joinTable property.
156:             *
157:             * @param value
158:             *     allowed object is
159:             *     {@link JoinTable }
160:             *
161:             */
162:            public void setJoinTable(JoinTable value) {
163:                this .joinTable = value;
164:            }
165:
166:            /**
167:             * Gets the value of the joinColumn property.
168:             *
169:             * <p>
170:             * This accessor method returns a reference to the live list,
171:             * not a snapshot. Therefore any modification you make to the
172:             * returned list will be present inside the JAXB object.
173:             * This is why there is not a <CODE>set</CODE> method for the joinColumn property.
174:             *
175:             * <p>
176:             * For example, to add a new item, do as follows:
177:             * <pre>
178:             *    getJoinColumn().add(newItem);
179:             * </pre>
180:             *
181:             *
182:             * <p>
183:             * Objects of the following type(s) are allowed in the list
184:             * {@link JoinColumn }
185:             *
186:             *
187:             */
188:            public List<JoinColumn> getJoinColumn() {
189:                if (joinColumn == null) {
190:                    joinColumn = new ArrayList<JoinColumn>();
191:                }
192:                return this .joinColumn;
193:            }
194:
195:            /**
196:             * Gets the value of the cascade property.
197:             *
198:             * @return
199:             *     possible object is
200:             *     {@link CascadeType }
201:             *
202:             */
203:            public CascadeType getCascade() {
204:                return cascade;
205:            }
206:
207:            /**
208:             * Sets the value of the cascade property.
209:             *
210:             * @param value
211:             *     allowed object is
212:             *     {@link CascadeType }
213:             *
214:             */
215:            public void setCascade(CascadeType value) {
216:                this .cascade = value;
217:            }
218:
219:            /**
220:             * Gets the value of the fetch property.
221:             *
222:             * @return
223:             *     possible object is
224:             *     {@link FetchType }
225:             *
226:             */
227:            public FetchType getFetch() {
228:                return fetch;
229:            }
230:
231:            /**
232:             * Sets the value of the fetch property.
233:             *
234:             * @param value
235:             *     allowed object is
236:             *     {@link FetchType }
237:             *
238:             */
239:            public void setFetch(FetchType value) {
240:                this .fetch = value;
241:            }
242:
243:            /**
244:             * Gets the value of the mappedBy property.
245:             *
246:             * @return
247:             *     possible object is
248:             *     {@link String }
249:             *
250:             */
251:            public String getMappedBy() {
252:                return mappedBy;
253:            }
254:
255:            /**
256:             * Sets the value of the mappedBy property.
257:             *
258:             * @param value
259:             *     allowed object is
260:             *     {@link String }
261:             *
262:             */
263:            public void setMappedBy(String value) {
264:                this .mappedBy = value;
265:            }
266:
267:            /**
268:             * Gets the value of the name property.
269:             *
270:             * @return
271:             *     possible object is
272:             *     {@link String }
273:             *
274:             */
275:            public String getName() {
276:                return name;
277:            }
278:
279:            /**
280:             * Sets the value of the name property.
281:             *
282:             * @param value
283:             *     allowed object is
284:             *     {@link String }
285:             *
286:             */
287:            public void setName(String value) {
288:                this .name = value;
289:            }
290:
291:            /**
292:             * Gets the value of the targetEntity property.
293:             *
294:             * @return
295:             *     possible object is
296:             *     {@link String }
297:             *
298:             */
299:            public String getTargetEntity() {
300:                return targetEntity;
301:            }
302:
303:            /**
304:             * Sets the value of the targetEntity property.
305:             *
306:             * @param value
307:             *     allowed object is
308:             *     {@link String }
309:             *
310:             */
311:            public void setTargetEntity(String value) {
312:                this .targetEntity = value;
313:            }
314:
315:            /**
316:             * This is only used for xml converters and will normally return null.
317:             * Gets the field on the target entity for this relationship.
318:             * @return the field on the target entity for this relationship.
319:             */
320:            public RelationField getRelatedField() {
321:                return relatedField;
322:            }
323:
324:            /**
325:             * Gets the field on the target entity for this relationship.
326:             * @param value field on the target entity for this relationship.
327:             */
328:            public void setRelatedField(RelationField value) {
329:                this .relatedField = value;
330:            }
331:
332:            /**
333:             * This is only used for xml converters and will normally return false.
334:             * A true value indicates that this field was generated for CMR back references.
335:             * @return true if this field was generated for CMR back references.
336:             */
337:            public boolean isSyntheticField() {
338:                return syntheticField;
339:            }
340:
341:            /**
342:             * This is only used for xml converters and will normally return false.
343:             * A true value indicates that this field was generated for CMR back references.
344:             * @return true if this field was generated for CMR back references.
345:             */
346:            public void setSyntheticField(boolean syntheticField) {
347:                this.syntheticField = syntheticField;
348:            }
349:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.