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:
026: /**
027: *
028: *
029: * Defines the settings and mappings for an entity. Is allowed to be
030: * sparsely populated and used in conjunction with the annotations.
031: * Alternatively, the metadata-complete attribute can be used to
032: * indicate that no annotations on the entity class (and its fields
033: * or properties) are to be processed. If this is the case then
034: * the defaulting rules for the entity and its subelements will
035: * be recursively applied.
036: *
037: * @Target(TYPE) @Retention(RUNTIME)
038: * public @interface Entity {
039: * String name() default "";
040: * }
041: *
042: *
043: *
044: * <p>Java class for entity complex type.
045: *
046: * <p>The following schema fragment specifies the expected content contained within this class.
047: *
048: * <pre>
049: * <complexType name="entity">
050: * <complexContent>
051: * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
052: * <sequence>
053: * <element name="description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
054: * <element name="table" type="{http://java.sun.com/xml/ns/persistence/orm}table" minOccurs="0"/>
055: * <element name="secondary-table" type="{http://java.sun.com/xml/ns/persistence/orm}secondary-table" maxOccurs="unbounded" minOccurs="0"/>
056: * <element name="primary-key-join-column" type="{http://java.sun.com/xml/ns/persistence/orm}primary-key-join-column" maxOccurs="unbounded" minOccurs="0"/>
057: * <element name="id-class" type="{http://java.sun.com/xml/ns/persistence/orm}id-class" minOccurs="0"/>
058: * <element name="inheritance" type="{http://java.sun.com/xml/ns/persistence/orm}inheritance" minOccurs="0"/>
059: * <element name="discriminator-value" type="{http://java.sun.com/xml/ns/persistence/orm}discriminator-value" minOccurs="0"/>
060: * <element name="discriminator-column" type="{http://java.sun.com/xml/ns/persistence/orm}discriminator-column" minOccurs="0"/>
061: * <element name="sequence-generator" type="{http://java.sun.com/xml/ns/persistence/orm}sequence-generator" minOccurs="0"/>
062: * <element name="table-generator" type="{http://java.sun.com/xml/ns/persistence/orm}table-generator" minOccurs="0"/>
063: * <element name="named-query" type="{http://java.sun.com/xml/ns/persistence/orm}named-query" maxOccurs="unbounded" minOccurs="0"/>
064: * <element name="named-native-query" type="{http://java.sun.com/xml/ns/persistence/orm}named-native-query" maxOccurs="unbounded" minOccurs="0"/>
065: * <element name="sql-result-set-mapping" type="{http://java.sun.com/xml/ns/persistence/orm}sql-result-set-mapping" maxOccurs="unbounded" minOccurs="0"/>
066: * <element name="exclude-default-listeners" type="{http://java.sun.com/xml/ns/persistence/orm}emptyType" minOccurs="0"/>
067: * <element name="exclude-superclass-listeners" type="{http://java.sun.com/xml/ns/persistence/orm}emptyType" minOccurs="0"/>
068: * <element name="entity-listeners" type="{http://java.sun.com/xml/ns/persistence/orm}entity-listeners" minOccurs="0"/>
069: * <element name="pre-persist" type="{http://java.sun.com/xml/ns/persistence/orm}pre-persist" minOccurs="0"/>
070: * <element name="post-persist" type="{http://java.sun.com/xml/ns/persistence/orm}post-persist" minOccurs="0"/>
071: * <element name="pre-remove" type="{http://java.sun.com/xml/ns/persistence/orm}pre-remove" minOccurs="0"/>
072: * <element name="post-remove" type="{http://java.sun.com/xml/ns/persistence/orm}post-remove" minOccurs="0"/>
073: * <element name="pre-update" type="{http://java.sun.com/xml/ns/persistence/orm}pre-update" minOccurs="0"/>
074: * <element name="post-update" type="{http://java.sun.com/xml/ns/persistence/orm}post-update" minOccurs="0"/>
075: * <element name="post-load" type="{http://java.sun.com/xml/ns/persistence/orm}post-load" minOccurs="0"/>
076: * <element name="attribute-override" type="{http://java.sun.com/xml/ns/persistence/orm}attribute-override" maxOccurs="unbounded" minOccurs="0"/>
077: * <element name="association-override" type="{http://java.sun.com/xml/ns/persistence/orm}association-override" maxOccurs="unbounded" minOccurs="0"/>
078: * <element name="attributes" type="{http://java.sun.com/xml/ns/persistence/orm}attributes" minOccurs="0"/>
079: * </sequence>
080: * <attribute name="access" type="{http://java.sun.com/xml/ns/persistence/orm}access-type" />
081: * <attribute name="class" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
082: * <attribute name="metadata-complete" type="{http://www.w3.org/2001/XMLSchema}boolean" />
083: * <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
084: * </restriction>
085: * </complexContent>
086: * </complexType>
087: * </pre>
088: *
089: *
090: */
091: @XmlAccessorType(XmlAccessType.FIELD)
092: @XmlType(name="entity",propOrder={"description","table","secondaryTable","primaryKeyJoinColumn","idClass","inheritance","discriminatorValue","discriminatorColumn","sequenceGenerator","tableGenerator","namedQuery","namedNativeQuery","sqlResultSetMapping","excludeDefaultListeners","excludeSuperclassListeners","entityListeners","prePersist","postPersist","preRemove","postRemove","preUpdate","postUpdate","postLoad","attributeOverride","associationOverride","attributes"})
093: public class Entity implements Mapping {
094:
095: protected String description;
096: protected Table table;
097: @XmlElement(name="secondary-table")
098: protected List<SecondaryTable> secondaryTable;
099: @XmlElement(name="primary-key-join-column")
100: protected List<PrimaryKeyJoinColumn> primaryKeyJoinColumn;
101: @XmlElement(name="id-class")
102: protected IdClass idClass;
103: protected Inheritance inheritance;
104: @XmlElement(name="discriminator-value")
105: protected String discriminatorValue;
106: @XmlElement(name="discriminator-column")
107: protected DiscriminatorColumn discriminatorColumn;
108: @XmlElement(name="sequence-generator")
109: protected SequenceGenerator sequenceGenerator;
110: @XmlElement(name="table-generator")
111: protected TableGenerator tableGenerator;
112: @XmlElement(name="named-query")
113: protected List<NamedQuery> namedQuery;
114: @XmlElement(name="named-native-query")
115: protected List<NamedNativeQuery> namedNativeQuery;
116: @XmlElement(name="sql-result-set-mapping")
117: protected List<SqlResultSetMapping> sqlResultSetMapping;
118: @XmlElement(name="exclude-default-listeners")
119: protected EmptyType excludeDefaultListeners;
120: @XmlElement(name="exclude-superclass-listeners")
121: protected EmptyType excludeSuperclassListeners;
122: @XmlElement(name="entity-listeners")
123: protected EntityListeners entityListeners;
124: @XmlElement(name="pre-persist")
125: protected PrePersist prePersist;
126: @XmlElement(name="post-persist")
127: protected PostPersist postPersist;
128: @XmlElement(name="pre-remove")
129: protected PreRemove preRemove;
130: @XmlElement(name="post-remove")
131: protected PostRemove postRemove;
132: @XmlElement(name="pre-update")
133: protected PreUpdate preUpdate;
134: @XmlElement(name="post-update")
135: protected PostUpdate postUpdate;
136: @XmlElement(name="post-load")
137: protected PostLoad postLoad;
138: @XmlElement(name="attribute-override")
139: protected List<AttributeOverride> attributeOverride;
140: @XmlElement(name="association-override")
141: protected List<AssociationOverride> associationOverride;
142: protected Attributes attributes;
143: @XmlAttribute
144: protected AccessType access;
145: @XmlAttribute(name="class",required=true)
146: protected String clazz;
147: @XmlAttribute(name="metadata-complete")
148: protected Boolean metadataComplete;
149: @XmlAttribute
150: protected String name;
151:
152: /**
153: * Gets the value of the description property.
154: *
155: * @return
156: * possible object is
157: * {@link String }
158: *
159: */
160: public String getDescription() {
161: return description;
162: }
163:
164: /**
165: * Sets the value of the description property.
166: *
167: * @param value
168: * allowed object is
169: * {@link String }
170: *
171: */
172: public void setDescription(String value) {
173: this .description = value;
174: }
175:
176: /**
177: * Gets the value of the table property.
178: *
179: * @return
180: * possible object is
181: * {@link Table }
182: *
183: */
184: public Table getTable() {
185: return table;
186: }
187:
188: /**
189: * Sets the value of the table property.
190: *
191: * @param value
192: * allowed object is
193: * {@link Table }
194: *
195: */
196: public void setTable(Table value) {
197: this .table = value;
198: }
199:
200: /**
201: * Gets the value of the secondaryTable property.
202: *
203: * <p>
204: * This accessor method returns a reference to the live list,
205: * not a snapshot. Therefore any modification you make to the
206: * returned list will be present inside the JAXB object.
207: * This is why there is not a <CODE>set</CODE> method for the secondaryTable property.
208: *
209: * <p>
210: * For example, to add a new item, do as follows:
211: * <pre>
212: * getSecondaryTable().add(newItem);
213: * </pre>
214: *
215: *
216: * <p>
217: * Objects of the following type(s) are allowed in the list
218: * {@link SecondaryTable }
219: *
220: *
221: */
222: public List<SecondaryTable> getSecondaryTable() {
223: if (secondaryTable == null) {
224: secondaryTable = new ArrayList<SecondaryTable>();
225: }
226: return this .secondaryTable;
227: }
228:
229: /**
230: * Gets the value of the primaryKeyJoinColumn property.
231: *
232: * <p>
233: * This accessor method returns a reference to the live list,
234: * not a snapshot. Therefore any modification you make to the
235: * returned list will be present inside the JAXB object.
236: * This is why there is not a <CODE>set</CODE> method for the primaryKeyJoinColumn property.
237: *
238: * <p>
239: * For example, to add a new item, do as follows:
240: * <pre>
241: * getPrimaryKeyJoinColumn().add(newItem);
242: * </pre>
243: *
244: *
245: * <p>
246: * Objects of the following type(s) are allowed in the list
247: * {@link PrimaryKeyJoinColumn }
248: *
249: *
250: */
251: public List<PrimaryKeyJoinColumn> getPrimaryKeyJoinColumn() {
252: if (primaryKeyJoinColumn == null) {
253: primaryKeyJoinColumn = new ArrayList<PrimaryKeyJoinColumn>();
254: }
255: return this .primaryKeyJoinColumn;
256: }
257:
258: /**
259: * Gets the value of the idClass property.
260: *
261: * @return
262: * possible object is
263: * {@link IdClass }
264: *
265: */
266: public IdClass getIdClass() {
267: return idClass;
268: }
269:
270: /**
271: * Sets the value of the idClass property.
272: *
273: * @param value
274: * allowed object is
275: * {@link IdClass }
276: *
277: */
278: public void setIdClass(IdClass value) {
279: this .idClass = value;
280: }
281:
282: /**
283: * Gets the value of the inheritance property.
284: *
285: * @return
286: * possible object is
287: * {@link Inheritance }
288: *
289: */
290: public Inheritance getInheritance() {
291: return inheritance;
292: }
293:
294: /**
295: * Sets the value of the inheritance property.
296: *
297: * @param value
298: * allowed object is
299: * {@link Inheritance }
300: *
301: */
302: public void setInheritance(Inheritance value) {
303: this .inheritance = value;
304: }
305:
306: /**
307: * Gets the value of the discriminatorValue property.
308: *
309: * @return
310: * possible object is
311: * {@link String }
312: *
313: */
314: public String getDiscriminatorValue() {
315: return discriminatorValue;
316: }
317:
318: /**
319: * Sets the value of the discriminatorValue property.
320: *
321: * @param value
322: * allowed object is
323: * {@link String }
324: *
325: */
326: public void setDiscriminatorValue(String value) {
327: this .discriminatorValue = value;
328: }
329:
330: /**
331: * Gets the value of the discriminatorColumn property.
332: *
333: * @return
334: * possible object is
335: * {@link DiscriminatorColumn }
336: *
337: */
338: public DiscriminatorColumn getDiscriminatorColumn() {
339: return discriminatorColumn;
340: }
341:
342: /**
343: * Sets the value of the discriminatorColumn property.
344: *
345: * @param value
346: * allowed object is
347: * {@link DiscriminatorColumn }
348: *
349: */
350: public void setDiscriminatorColumn(DiscriminatorColumn value) {
351: this .discriminatorColumn = value;
352: }
353:
354: /**
355: * Gets the value of the sequenceGenerator property.
356: *
357: * @return
358: * possible object is
359: * {@link SequenceGenerator }
360: *
361: */
362: public SequenceGenerator getSequenceGenerator() {
363: return sequenceGenerator;
364: }
365:
366: /**
367: * Sets the value of the sequenceGenerator property.
368: *
369: * @param value
370: * allowed object is
371: * {@link SequenceGenerator }
372: *
373: */
374: public void setSequenceGenerator(SequenceGenerator value) {
375: this .sequenceGenerator = value;
376: }
377:
378: /**
379: * Gets the value of the tableGenerator property.
380: *
381: * @return
382: * possible object is
383: * {@link TableGenerator }
384: *
385: */
386: public TableGenerator getTableGenerator() {
387: return tableGenerator;
388: }
389:
390: /**
391: * Sets the value of the tableGenerator property.
392: *
393: * @param value
394: * allowed object is
395: * {@link TableGenerator }
396: *
397: */
398: public void setTableGenerator(TableGenerator value) {
399: this .tableGenerator = value;
400: }
401:
402: /**
403: * Gets the value of the namedQuery property.
404: *
405: * <p>
406: * This accessor method returns a reference to the live list,
407: * not a snapshot. Therefore any modification you make to the
408: * returned list will be present inside the JAXB object.
409: * This is why there is not a <CODE>set</CODE> method for the namedQuery property.
410: *
411: * <p>
412: * For example, to add a new item, do as follows:
413: * <pre>
414: * getNamedQuery().add(newItem);
415: * </pre>
416: *
417: *
418: * <p>
419: * Objects of the following type(s) are allowed in the list
420: * {@link NamedQuery }
421: *
422: *
423: */
424: public List<NamedQuery> getNamedQuery() {
425: if (namedQuery == null) {
426: namedQuery = new ArrayList<NamedQuery>();
427: }
428: return this .namedQuery;
429: }
430:
431: /**
432: * Gets the value of the namedNativeQuery property.
433: *
434: * <p>
435: * This accessor method returns a reference to the live list,
436: * not a snapshot. Therefore any modification you make to the
437: * returned list will be present inside the JAXB object.
438: * This is why there is not a <CODE>set</CODE> method for the namedNativeQuery property.
439: *
440: * <p>
441: * For example, to add a new item, do as follows:
442: * <pre>
443: * getNamedNativeQuery().add(newItem);
444: * </pre>
445: *
446: *
447: * <p>
448: * Objects of the following type(s) are allowed in the list
449: * {@link NamedNativeQuery }
450: *
451: *
452: */
453: public List<NamedNativeQuery> getNamedNativeQuery() {
454: if (namedNativeQuery == null) {
455: namedNativeQuery = new ArrayList<NamedNativeQuery>();
456: }
457: return this .namedNativeQuery;
458: }
459:
460: /**
461: * Gets the value of the sqlResultSetMapping property.
462: *
463: * <p>
464: * This accessor method returns a reference to the live list,
465: * not a snapshot. Therefore any modification you make to the
466: * returned list will be present inside the JAXB object.
467: * This is why there is not a <CODE>set</CODE> method for the sqlResultSetMapping property.
468: *
469: * <p>
470: * For example, to add a new item, do as follows:
471: * <pre>
472: * getSqlResultSetMapping().add(newItem);
473: * </pre>
474: *
475: *
476: * <p>
477: * Objects of the following type(s) are allowed in the list
478: * {@link SqlResultSetMapping }
479: *
480: *
481: */
482: public List<SqlResultSetMapping> getSqlResultSetMapping() {
483: if (sqlResultSetMapping == null) {
484: sqlResultSetMapping = new ArrayList<SqlResultSetMapping>();
485: }
486: return this .sqlResultSetMapping;
487: }
488:
489: /**
490: * Gets the value of the excludeDefaultListeners property.
491: *
492: * @return
493: * possible object is
494: * {@link boolean }
495: *
496: */
497: public boolean isExcludeDefaultListeners() {
498: return excludeDefaultListeners != null;
499: }
500:
501: /**
502: * Sets the value of the excludeDefaultListeners property.
503: *
504: * @param value
505: * allowed object is
506: * {@link boolean }
507: *
508: */
509: public void setExcludeDefaultListeners(boolean value) {
510: this .excludeDefaultListeners = value ? new EmptyType() : null;
511: }
512:
513: /**
514: * Gets the value of the excludeSuperclassListeners property.
515: *
516: * @return
517: * possible object is
518: * {@link boolean }
519: *
520: */
521: public boolean isExcludeSuperclassListeners() {
522: return excludeSuperclassListeners != null;
523: }
524:
525: /**
526: * Sets the value of the excludeSuperclassListeners property.
527: *
528: * @param value
529: * allowed object is
530: * {@link boolean }
531: *
532: */
533: public void setExcludeSuperclassListeners(boolean value) {
534: this .excludeSuperclassListeners = value ? new EmptyType()
535: : null;
536: }
537:
538: /**
539: * Gets the value of the entityListeners property.
540: *
541: * @return
542: * possible object is
543: * {@link EntityListeners }
544: *
545: */
546: public EntityListeners getEntityListeners() {
547: return entityListeners;
548: }
549:
550: /**
551: * Sets the value of the entityListeners property.
552: *
553: * @param value
554: * allowed object is
555: * {@link EntityListeners }
556: *
557: */
558: public void setEntityListeners(EntityListeners value) {
559: this .entityListeners = value;
560: }
561:
562: /**
563: * Gets the value of the prePersist property.
564: *
565: * @return
566: * possible object is
567: * {@link PrePersist }
568: *
569: */
570: public PrePersist getPrePersist() {
571: return prePersist;
572: }
573:
574: /**
575: * Sets the value of the prePersist property.
576: *
577: * @param value
578: * allowed object is
579: * {@link PrePersist }
580: *
581: */
582: public void setPrePersist(PrePersist value) {
583: this .prePersist = value;
584: }
585:
586: /**
587: * Gets the value of the postPersist property.
588: *
589: * @return
590: * possible object is
591: * {@link PostPersist }
592: *
593: */
594: public PostPersist getPostPersist() {
595: return postPersist;
596: }
597:
598: /**
599: * Sets the value of the postPersist property.
600: *
601: * @param value
602: * allowed object is
603: * {@link PostPersist }
604: *
605: */
606: public void setPostPersist(PostPersist value) {
607: this .postPersist = value;
608: }
609:
610: /**
611: * Gets the value of the preRemove property.
612: *
613: * @return
614: * possible object is
615: * {@link PreRemove }
616: *
617: */
618: public PreRemove getPreRemove() {
619: return preRemove;
620: }
621:
622: /**
623: * Sets the value of the preRemove property.
624: *
625: * @param value
626: * allowed object is
627: * {@link PreRemove }
628: *
629: */
630: public void setPreRemove(PreRemove value) {
631: this .preRemove = value;
632: }
633:
634: /**
635: * Gets the value of the postRemove property.
636: *
637: * @return
638: * possible object is
639: * {@link PostRemove }
640: *
641: */
642: public PostRemove getPostRemove() {
643: return postRemove;
644: }
645:
646: /**
647: * Sets the value of the postRemove property.
648: *
649: * @param value
650: * allowed object is
651: * {@link PostRemove }
652: *
653: */
654: public void setPostRemove(PostRemove value) {
655: this .postRemove = value;
656: }
657:
658: /**
659: * Gets the value of the preUpdate property.
660: *
661: * @return
662: * possible object is
663: * {@link PreUpdate }
664: *
665: */
666: public PreUpdate getPreUpdate() {
667: return preUpdate;
668: }
669:
670: /**
671: * Sets the value of the preUpdate property.
672: *
673: * @param value
674: * allowed object is
675: * {@link PreUpdate }
676: *
677: */
678: public void setPreUpdate(PreUpdate value) {
679: this .preUpdate = value;
680: }
681:
682: /**
683: * Gets the value of the postUpdate property.
684: *
685: * @return
686: * possible object is
687: * {@link PostUpdate }
688: *
689: */
690: public PostUpdate getPostUpdate() {
691: return postUpdate;
692: }
693:
694: /**
695: * Sets the value of the postUpdate property.
696: *
697: * @param value
698: * allowed object is
699: * {@link PostUpdate }
700: *
701: */
702: public void setPostUpdate(PostUpdate value) {
703: this .postUpdate = value;
704: }
705:
706: /**
707: * Gets the value of the postLoad property.
708: *
709: * @return
710: * possible object is
711: * {@link PostLoad }
712: *
713: */
714: public PostLoad getPostLoad() {
715: return postLoad;
716: }
717:
718: /**
719: * Sets the value of the postLoad property.
720: *
721: * @param value
722: * allowed object is
723: * {@link PostLoad }
724: *
725: */
726: public void setPostLoad(PostLoad value) {
727: this .postLoad = value;
728: }
729:
730: /**
731: * Gets the value of the attributeOverride property.
732: *
733: * <p>
734: * This accessor method returns a reference to the live list,
735: * not a snapshot. Therefore any modification you make to the
736: * returned list will be present inside the JAXB object.
737: * This is why there is not a <CODE>set</CODE> method for the attributeOverride property.
738: *
739: * <p>
740: * For example, to add a new item, do as follows:
741: * <pre>
742: * getAttributeOverride().add(newItem);
743: * </pre>
744: *
745: *
746: * <p>
747: * Objects of the following type(s) are allowed in the list
748: * {@link AttributeOverride }
749: *
750: *
751: */
752: public List<AttributeOverride> getAttributeOverride() {
753: if (attributeOverride == null) {
754: attributeOverride = new ArrayList<AttributeOverride>();
755: }
756: return this .attributeOverride;
757: }
758:
759: /**
760: * Gets the value of the associationOverride property.
761: *
762: * <p>
763: * This accessor method returns a reference to the live list,
764: * not a snapshot. Therefore any modification you make to the
765: * returned list will be present inside the JAXB object.
766: * This is why there is not a <CODE>set</CODE> method for the associationOverride property.
767: *
768: * <p>
769: * For example, to add a new item, do as follows:
770: * <pre>
771: * getAssociationOverride().add(newItem);
772: * </pre>
773: *
774: *
775: * <p>
776: * Objects of the following type(s) are allowed in the list
777: * {@link AssociationOverride }
778: *
779: *
780: */
781: public List<AssociationOverride> getAssociationOverride() {
782: if (associationOverride == null) {
783: associationOverride = new ArrayList<AssociationOverride>();
784: }
785: return this .associationOverride;
786: }
787:
788: /**
789: * Gets the value of the attributes property.
790: *
791: * @return
792: * possible object is
793: * {@link Attributes }
794: *
795: */
796: public Attributes getAttributes() {
797: return attributes;
798: }
799:
800: /**
801: * Sets the value of the attributes property.
802: *
803: * @param value
804: * allowed object is
805: * {@link Attributes }
806: *
807: */
808: public void setAttributes(Attributes value) {
809: this .attributes = value;
810: }
811:
812: /**
813: * Gets the value of the access property.
814: *
815: * @return
816: * possible object is
817: * {@link AccessType }
818: *
819: */
820: public AccessType getAccess() {
821: return access;
822: }
823:
824: /**
825: * Sets the value of the access property.
826: *
827: * @param value
828: * allowed object is
829: * {@link AccessType }
830: *
831: */
832: public void setAccess(AccessType value) {
833: this .access = value;
834: }
835:
836: /**
837: * Gets the value of the clazz property.
838: *
839: * @return
840: * possible object is
841: * {@link String }
842: *
843: */
844: public String getClazz() {
845: return clazz;
846: }
847:
848: /**
849: * Sets the value of the clazz property.
850: *
851: * @param value
852: * allowed object is
853: * {@link String }
854: *
855: */
856: public void setClazz(String value) {
857: this .clazz = value;
858: }
859:
860: /**
861: * Gets the value of the metadataComplete property.
862: *
863: * @return
864: * possible object is
865: * {@link Boolean }
866: *
867: */
868: public Boolean isMetadataComplete() {
869: return metadataComplete;
870: }
871:
872: /**
873: * Sets the value of the metadataComplete property.
874: *
875: * @param value
876: * allowed object is
877: * {@link Boolean }
878: *
879: */
880: public void setMetadataComplete(Boolean value) {
881: this .metadataComplete = value;
882: }
883:
884: /**
885: * Gets the value of the name property.
886: *
887: * @return
888: * possible object is
889: * {@link String }
890: *
891: */
892: public String getName() {
893: return name;
894: }
895:
896: /**
897: * Sets the value of the name property.
898: *
899: * @param value
900: * allowed object is
901: * {@link String }
902: *
903: */
904: public void setName(String value) {
905: this .name = value;
906: }
907:
908: public void addField(Field field) {
909: if (field == null)
910: throw new NullPointerException("field is null");
911: if (field instanceof Id) {
912: if (attributes == null)
913: attributes = new Attributes();
914: attributes.getId().add((Id) field);
915: } else if (field instanceof Basic) {
916: if (attributes == null)
917: attributes = new Attributes();
918: attributes.getBasic().add((Basic) field);
919: } else if (field instanceof Transient) {
920: if (attributes == null)
921: attributes = new Attributes();
922: attributes.getTransient().add((Transient) field);
923: } else if (field instanceof AttributeOverride) {
924: getAttributeOverride().add((AttributeOverride) field);
925: } else {
926: throw new IllegalArgumentException("Unknown field type "
927: + field.getClass());
928: }
929: }
930: }
|