org.hibernate.engine.internal.EntityEntryExtraStateHolder 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
JPMS Module-Info's for a few of the Jakarta Libraries just until they add them in themselves
/*
* 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.engine.internal;
import org.hibernate.engine.spi.EntityEntryExtraState;
/**
* Contains optional state from {@link org.hibernate.engine.spi.EntityEntry}.
*
* @author Emmanuel Bernard
*/
public class EntityEntryExtraStateHolder implements EntityEntryExtraState {
private EntityEntryExtraState next;
private Object[] deletedState;
public Object[] getDeletedState() {
return deletedState;
}
public void setDeletedState(Object[] deletedState) {
this.deletedState = deletedState;
}
//the following methods are handling extraState contracts.
//they are not shared by a common superclass to avoid alignment padding
//we are trading off duplication for padding efficiency
@Override
public void addExtraState(EntityEntryExtraState extraState) {
if ( next == null ) {
next = extraState;
}
else {
next.addExtraState( extraState );
}
}
@Override
public T getExtraState(Class extraStateType) {
if ( next == null ) {
return null;
}
if ( extraStateType.isAssignableFrom( next.getClass() ) ) {
return (T) next;
}
else {
return next.getExtraState( extraStateType );
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy