org.hibernate.envers.boot.model.ColumnContainer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hibernate-envers Show documentation
Show all versions of hibernate-envers Show documentation
Hibernate's entity version (audit/history) support
/*
* 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 ) );
}
}
}