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