org.jboss.shrinkwrap.descriptor.api.persistence20.PersistenceDescriptor Maven / Gradle / Ivy
Show all versions of shrinkwrap-descriptors-api-javaee Show documentation
package org.jboss.shrinkwrap.descriptor.api.persistence20;
import java.util.ArrayList;
import java.util.List;
import org.jboss.shrinkwrap.descriptor.api.Child;
import org.jboss.shrinkwrap.descriptor.api.persistence20.PersistenceUnit;
import org.jboss.shrinkwrap.descriptor.api.Descriptor;
import org.jboss.shrinkwrap.descriptor.api.DescriptorNamespace;
import org.jboss.shrinkwrap.descriptor.api.persistence.*;
/**
*
* This deployment descriptor provides the functionalities as described in the specification
*
* Example:
*
*
* PersistenceDescriptor descriptor = Descriptors.create(PersistenceDescriptor.class);
*
*
*
* @author Ralf Battenfeld
* @author Andrew Lee Rubinger
* @author George Gastaldi
*/
public interface PersistenceDescriptor extends Descriptor, DescriptorNamespace,
PersistenceCommonDescriptor> {
// --------------------------------------------------------------------------------------------------------||
// ClassName: PersistenceDescriptor ElementName: persistence:persistence-unit ElementType : persistence-unit
// MaxOccurs: -unbounded isGeneric: false isAttribute: false isEnum: false isDataType: false
// --------------------------------------------------------------------------------------------------------||
/**
* If not already created, a new persistence-unit
element will be created and returned.
* Otherwise, the first existing persistence-unit
element will be returned.
* @return the instance defined for the element persistence-unit
*/
public PersistenceUnit getOrCreatePersistenceUnit();
/**
* Creates a new persistence-unit
element
* @return the new created instance of PersistenceUnit
*/
public PersistenceUnit createPersistenceUnit();
/**
* Returns all persistence-unit
elements
* @return list of persistence-unit
*/
public List> getAllPersistenceUnit();
/**
* Removes all persistence-unit
elements
* @return the current instance of PersistenceUnit
*/
public PersistenceDescriptor removeAllPersistenceUnit();
// --------------------------------------------------------------------------------------------------------||
// ClassName: PersistenceDescriptor ElementName: xsd:token ElementType : version
// MaxOccurs: - isGeneric: false isAttribute: true isEnum: false isDataType: true
// --------------------------------------------------------------------------------------------------------||
public static final String VERSION = "2.0";
/**
* Sets the version
attribute
* @param version the value for the attribute version
* @return the current instance of PersistenceDescriptor
*/
public PersistenceDescriptor version(String version);
/**
* Returns the version
attribute
* @return the value defined for the attribute version
*/
public String getVersion();
/**
* Removes the version
attribute
* @return the current instance of PersistenceDescriptor
*/
public PersistenceDescriptor removeVersion();
}