org.hibernate.type.OrderedSetType Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hibernate-core-jakarta Show documentation
Show all versions of hibernate-core-jakarta Show documentation
Hibernate O/RM implementation of the Jakarta Persistence specification
The 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.type;
import org.hibernate.internal.util.collections.CollectionHelper;
import org.hibernate.type.spi.TypeConfiguration;
/**
* A specialization of the set type, with (resultset-based) ordering.
*/
public class OrderedSetType extends SetType {
public OrderedSetType(TypeConfiguration typeConfiguration, String role, String propertyRef) {
super( typeConfiguration, role, propertyRef );
}
@Override
public Object instantiate(int anticipatedSize) {
return anticipatedSize > 0
? CollectionHelper.linkedSetOfSize( anticipatedSize )
: CollectionHelper.linkedSet();
}
}