org.hibernate.engine.spi.ManagedEntity Maven / Gradle / Ivy
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2012, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.hibernate.engine.spi;
/**
* Specialized {@link Managed} contract for entity classes. Essentially provides access to information
* about an instance's association to a Session/EntityManager. Specific information includes:
* -
* the association's {@link EntityEntry} (by way of {@link #$$_hibernate_getEntityEntry} and
* {@link #$$_hibernate_setEntityEntry}). EntityEntry describes states, snapshots, etc.
*
* -
* link information. ManagedEntity instances are part of a "linked list", thus link information
* describes the next and previous entries/nodes in that ordering. See
* {@link #$$_hibernate_getNextManagedEntity}, {@link #$$_hibernate_setNextManagedEntity},
* {@link #$$_hibernate_getPreviousManagedEntity}, {@link #$$_hibernate_setPreviousManagedEntity}
*
*
*
* @author Steve Ebersole
*/
public interface ManagedEntity extends Managed {
/**
* Obtain a reference to the entity instance.
*
* @return The entity instance.
*/
public Object $$_hibernate_getEntityInstance();
/**
* Provides access to the associated EntityEntry.
*
* @return The EntityEntry associated with this entity instance.
*
* @see #$$_hibernate_setEntityEntry
*/
public EntityEntry $$_hibernate_getEntityEntry();
/**
* Injects the EntityEntry associated with this entity instance. The EntityEntry represents state associated
* with the entity in regards to its association with a Hibernate Session.
*
* @param entityEntry The EntityEntry associated with this entity instance.
*/
public void $$_hibernate_setEntityEntry(EntityEntry entityEntry);
/**
* Part of entry linking; obtain reference to the previous entry. Can be {@code null}, which should indicate
* this is the head node.
*
* @return The previous entry
*/
public ManagedEntity $$_hibernate_getPreviousManagedEntity();
/**
* Part of entry linking; sets the previous entry. Again, can be {@code null}, which should indicate
* this is (now) the head node.
*
* @param previous The previous entry
*/
public void $$_hibernate_setPreviousManagedEntity(ManagedEntity previous);
/**
* Part of entry linking; obtain reference to the next entry. Can be {@code null}, which should indicate
* this is the tail node.
*
* @return The next entry
*/
public ManagedEntity $$_hibernate_getNextManagedEntity();
/**
* Part of entry linking; sets the next entry. Again, can be {@code null}, which should indicate
* this is (now) the tail node.
*
* @param next The next entry
*/
public void $$_hibernate_setNextManagedEntity(ManagedEntity next);
}