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

org.hibernate.envers.boot.model.ColumnContainer Maven / Gradle / Ivy

There is a newer version: 7.0.0.Beta2
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.boot.model;

import java.util.List;

import org.hibernate.mapping.Selectable;
import org.hibernate.mapping.Value;

/**
 * Contract for a container of columns.
 *
 * @author Chris Cranford
 */
public interface ColumnContainer {

	/**
	 * Get all columns that are part of this property
	 * @return unmodifiable list of property columns
	 */
	List getColumns();

	/**
	 * Add a column to the container.
	 *
	 * @param column the column, must not be {@code null}
	 */
	void addColumn(Column column);

	/**
	 * Takes a {@link Value} and injects its columns into the Envers container mapping.
	 *
	 * @param value the value mapping
	 */
	default void addColumnsFromValue(Value value) {
		final List selectables = value.getSelectables();
		for ( Selectable s : selectables ) {
			addColumn( Column.from( s ) );
		}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy