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

org.hibernate.boot.model.source.internal.hbm.PluralAttributeSourceBagImpl Maven / Gradle / Ivy

There is a newer version: 7.0.0.Alpha1
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.boot.model.source.internal.hbm;

import org.hibernate.boot.jaxb.hbm.spi.JaxbHbmBagCollectionType;
import org.hibernate.boot.model.source.spi.AttributeSourceContainer;
import org.hibernate.boot.model.source.spi.Orderable;
import org.hibernate.boot.model.source.spi.PluralAttributeNature;
import org.hibernate.internal.util.StringHelper;

/**
 * @author Steve Ebersole
 */
public class PluralAttributeSourceBagImpl extends AbstractPluralAttributeSourceImpl implements Orderable {
	private final JaxbHbmBagCollectionType jaxbBagMapping;

	public PluralAttributeSourceBagImpl(
			MappingDocument sourceMappingDocument,
			JaxbHbmBagCollectionType jaxbBagMapping,
			AttributeSourceContainer container) {
		super( sourceMappingDocument, jaxbBagMapping, container );
		this.jaxbBagMapping = jaxbBagMapping;
	}

	@Override
	public PluralAttributeNature getNature() {
		return PluralAttributeNature.BAG;
	}

	@Override
	public XmlElementMetadata getSourceType() {
		return XmlElementMetadata.BAG;
	}

	@Override
	public String getXmlNodeName() {
		return jaxbBagMapping.getNode();
	}

	@Override
	public boolean isOrdered() {
		return StringHelper.isNotEmpty( getOrder() );
	}

	@Override
	public String getOrder() {
		return jaxbBagMapping.getOrderBy();
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy