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

org.hibernate.envers.configuration.internal.metadata.EntityXmlMappingData Maven / Gradle / Ivy

There is a newer version: 7.0.0.Alpha3
Show newest version
/*
 * Hibernate, Relational Persistence for Idiomatic Java
 *
 * License: GNU Lesser General Public License (LGPL), version 2.1 or later.
 * See the lgpl.txt file in the root directory or .
 */
package org.hibernate.envers.configuration.internal.metadata;

import java.util.ArrayList;
import java.util.List;

import org.dom4j.Document;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;

/**
 * @author Adam Warski (adam at warski dot org)
 */
public class EntityXmlMappingData {
	private Document mainXmlMapping;
	private List additionalXmlMappings;
	/**
	 * The xml element that maps the class. The root can be one of the folowing elements:
	 * class, subclass, union-subclass, joined-subclass
	 */
	private Element classMapping;

	public EntityXmlMappingData() {
		mainXmlMapping = DocumentHelper.createDocument();
		additionalXmlMappings = new ArrayList<>();
	}

	public Document getMainXmlMapping() {
		return mainXmlMapping;
	}

	public List getAdditionalXmlMappings() {
		return additionalXmlMappings;
	}

	public Document newAdditionalMapping() {
		Document additionalMapping = DocumentHelper.createDocument();
		additionalXmlMappings.add( additionalMapping );

		return additionalMapping;
	}

	public Element getClassMapping() {
		return classMapping;
	}

	public void setClassMapping(Element classMapping) {
		this.classMapping = classMapping;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy