org.hibernate.id.enhanced.PooledLoThreadLocalOptimizer Maven / Gradle / Ivy
/*
* 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.id.enhanced;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import org.hibernate.HibernateException;
import org.hibernate.id.IntegralDataTypeHolder;
import org.hibernate.internal.CoreMessageLogger;
import org.jboss.logging.Logger;
/**
* Variation of {@link PooledOptimizer} which interprets the incoming database value as the lo value, rather than
* the hi value, as well as using thread local to cache the generation state.
*
* @author Stuart Douglas
* @author Scott Marlow
* @author Steve Ebersole
* @see PooledOptimizer
*/
public class PooledLoThreadLocalOptimizer extends AbstractOptimizer {
private static final CoreMessageLogger LOG = Logger.getMessageLogger(
CoreMessageLogger.class,
PooledLoOptimizer.class.getName()
);
private final ThreadLocal singleTenantState = ThreadLocal.withInitial( GenerationState::new );
private final ThreadLocal
© 2015 - 2025 Weber Informatics LLC | Privacy Policy