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 javax.xml.bind.annotation.XmlAccessType;
019: import javax.xml.bind.annotation.XmlAccessorType;
020: import javax.xml.bind.annotation.XmlElement;
021: import javax.xml.bind.annotation.XmlType;
022:
023: /**
024: *
025: *
026: * These defaults are applied to the persistence unit as a whole
027: * unless they are overridden by local annotation or XML
028: * element settings.
029: *
030: * schema - Used as the schema for all tables or secondary tables
031: * that apply to the persistence unit
032: * catalog - Used as the catalog for all tables or secondary tables
033: * that apply to the persistence unit
034: * access - Used as the access type for all managed classes in
035: * the persistence unit
036: * cascade-persist - Adds cascade-persist to the set of cascade options
037: * in entity relationships of the persistence unit
038: * entity-listeners - List of default entity listeners to be invoked
039: * on each entity in the persistence unit.
040: *
041: *
042: *
043: * <p>Java class for persistence-unit-defaults complex type.
044: *
045: * <p>The following schema fragment specifies the expected content contained within this class.
046: *
047: * <pre>
048: * <complexType name="persistence-unit-defaults">
049: * <complexContent>
050: * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
051: * <sequence>
052: * <element name="schema" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
053: * <element name="catalog" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
054: * <element name="access" type="{http://java.sun.com/xml/ns/persistence/orm}access-type" minOccurs="0"/>
055: * <element name="cascade-persist" type="{http://java.sun.com/xml/ns/persistence/orm}emptyType" minOccurs="0"/>
056: * <element name="entity-listeners" type="{http://java.sun.com/xml/ns/persistence/orm}entity-listeners" minOccurs="0"/>
057: * </sequence>
058: * </restriction>
059: * </complexContent>
060: * </complexType>
061: * </pre>
062: *
063: *
064: */
065: @XmlAccessorType(XmlAccessType.FIELD)
066: @XmlType(name="persistence-unit-defaults",propOrder={"schema","catalog","access","cascadePersist","entityListeners"})
067: public class PersistenceUnitDefaults {
068:
069: protected String schema;
070: protected String catalog;
071: protected AccessType access;
072: @XmlElement(name="cascade-persist")
073: protected EmptyType cascadePersist;
074: @XmlElement(name="entity-listeners")
075: protected EntityListeners entityListeners;
076:
077: /**
078: * Gets the value of the schema property.
079: *
080: * @return
081: * possible object is
082: * {@link String }
083: *
084: */
085: public String getSchema() {
086: return schema;
087: }
088:
089: /**
090: * Sets the value of the schema property.
091: *
092: * @param value
093: * allowed object is
094: * {@link String }
095: *
096: */
097: public void setSchema(String value) {
098: this .schema = value;
099: }
100:
101: /**
102: * Gets the value of the catalog property.
103: *
104: * @return
105: * possible object is
106: * {@link String }
107: *
108: */
109: public String getCatalog() {
110: return catalog;
111: }
112:
113: /**
114: * Sets the value of the catalog property.
115: *
116: * @param value
117: * allowed object is
118: * {@link String }
119: *
120: */
121: public void setCatalog(String value) {
122: this .catalog = value;
123: }
124:
125: /**
126: * Gets the value of the access property.
127: *
128: * @return
129: * possible object is
130: * {@link AccessType }
131: *
132: */
133: public AccessType getAccess() {
134: return access;
135: }
136:
137: /**
138: * Sets the value of the access property.
139: *
140: * @param value
141: * allowed object is
142: * {@link AccessType }
143: *
144: */
145: public void setAccess(AccessType value) {
146: this .access = value;
147: }
148:
149: /**
150: * Gets the value of the cascadePersist property.
151: *
152: * @return
153: * possible object is
154: * {@link boolean }
155: *
156: */
157: public boolean isCascadePersist() {
158: return cascadePersist != null;
159: }
160:
161: /**
162: * Sets the value of the cascadePersist property.
163: *
164: * @param value
165: * allowed object is
166: * {@link boolean }
167: *
168: */
169: public void setCascadePersist(boolean value) {
170: this .cascadePersist = value ? new EmptyType() : null;
171: }
172:
173: /**
174: * Gets the value of the entityListeners property.
175: *
176: * @return
177: * possible object is
178: * {@link EntityListeners }
179: *
180: */
181: public EntityListeners getEntityListeners() {
182: return entityListeners;
183: }
184:
185: /**
186: * Sets the value of the entityListeners property.
187: *
188: * @param value
189: * allowed object is
190: * {@link EntityListeners }
191: *
192: */
193: public void setEntityListeners(EntityListeners value) {
194: this.entityListeners = value;
195: }
196:
197: }
|