All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.openejb.jee.jpa.fragment.PersistenceUnitFragment Maven / Gradle / Ivy

The newest version!
/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.openejb.jee.jpa.fragment;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import java.util.ArrayList;
import java.util.List;

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "description",
    "mappingFile",
    "jarFile",
    "clazz",
    "excludeUnlistedClasses"
})
public class PersistenceUnitFragment {

    protected String description;
    @XmlElement(name = "mapping-file", required = true)
    protected List mappingFile;
    @XmlElement(name = "jar-file", required = true)
    protected List jarFile;
    @XmlElement(name = "class", required = true)
    protected List clazz;
    @XmlElement(name = "exclude-unlisted-classes", defaultValue = "false")
    protected boolean excludeUnlistedClasses;
    @XmlAttribute(required = true)
    protected String name;

    public PersistenceUnitFragment() {
        // no-op
    }

    public PersistenceUnitFragment(final String unitName) {
        this.name = unitName;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(final String value) {
        this.description = value;
    }

    public List getMappingFile() {
        if (mappingFile == null) {
            mappingFile = new ArrayList();
        }
        return this.mappingFile;
    }

    public List getClazz() {
        if (clazz == null) {
            clazz = new ArrayList();
        }
        return this.clazz;
    }

    public boolean addClass(final String s) {
        return getClazz().add(s);
    }

    public boolean addClass(final Class clazz) {
        return addClass(clazz.getName());
    }

    public boolean isExcludeUnlistedClasses() {
        return excludeUnlistedClasses;
    }

    public void setExcludeUnlistedClasses(final boolean value) {
        this.excludeUnlistedClasses = value;
    }

    public String getName() {
        return name;
    }

    public void setName(final String value) {
        this.name = value;
    }

    public List getJarFile() {
        if (jarFile == null) {
            jarFile = new ArrayList();
        }
        return this.jarFile;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy