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

org.hibernate.boot.model.source.spi.PluralAttributeElementNature 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.spi;

/**
 * Describes the nature of plural attribute elements in terms of relational implications.
 *
 * @author Steve Ebersole
 * @author Gail Badner
 */
public enum PluralAttributeElementNature {
	/**
	 * The collection elements are basic, simple values.
	 */
	BASIC( false, false ),
	/**
	 * The collection elements are compositions.
	 */
	AGGREGATE( false, true ),
	/**
	 * The collection elements represent entity's in a one-to-many association.
	 */
	ONE_TO_MANY,
	/**
	 * The collection elements represent entity's in a many-to-many association.
	 */
	MANY_TO_MANY,
	/**
	 * The collection elements represent entity's in a multi-valued ANY mapping.
	 */
	MANY_TO_ANY;

	private final boolean isAssociation;
	private final boolean isCascadeable;

	PluralAttributeElementNature() {
		this( true, true );
	}

	PluralAttributeElementNature(boolean association, boolean cascadeable) {
		this.isAssociation = association;
		this.isCascadeable = cascadeable;
	}

	public boolean isAssociation() {
		return isAssociation;
	}

	public boolean isCascadeable() {
		return isCascadeable;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy