org.hibernate.boot.model.source.spi.PluralAttributeNature Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hibernate-core Show documentation
Show all versions of hibernate-core Show documentation
Hibernate's core ORM functionality
/*
* 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;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* Describes the nature of the collection itself as declared by the metadata.
*
* @author Steve Ebersole
*/
public enum PluralAttributeNature {
BAG( Collection.class, false ),
ID_BAG( Collection.class, false ),
SET( Set.class, false ),
LIST( List.class, true ),
ARRAY( Object[].class, true ),
MAP( Map.class, true );
private final boolean indexed;
private final Class reportedJavaType;
PluralAttributeNature(Class reportedJavaType, boolean indexed) {
this.reportedJavaType = reportedJavaType;
this.indexed = indexed;
}
public Class reportedJavaType() {
return reportedJavaType;
}
public boolean isIndexed() {
return indexed;
}
}