Package org.hibernate
package org.hibernate
This package defines the central Hibernate APIs, beginning with
SessionFactory
, which represents an instance of
Hibernate at runtime and is the source of new instances of
Session
and StatelessSession
,
the most important APIs exposing persistence-related operations for
entities. The interface SharedSessionContract
declares operations that are common to both stateful and stateless sessions.
Playing important supporting roles here, we also have
Transaction
, Filter
,
and Cache
.
APIs related to querying are now defined under the namespace
org.hibernate.query
.
-
ClassDescriptionAn exception that occurs while reading mapping annotations.Indicates failure of an assertion: a possible bug in Hibernate.Deprecated, for removal: This API element is subject to removal in a future version.Specify a batch size, that is, how many entities should be fetched in each request to the database, for an invocation of
Session.findMultiple(Class, List, FindOption...)
.An API for directly querying and managing the second-level cache.Controls how the session interacts with the second-level cache or query cache.Intended to be thrown fromInterceptor
callbacks.Indicates the manner in which JDBC connections are acquired.Enumerates various policies for releasing JDBC connections.During a flush cycle, Hibernate needs to determine which of the entities associated with aSession
are dirty, meaning modified.Responsible for identifying when attributes are dirty.ProvidesCustomEntityDirtinessStrategy.AttributeChecker
with meta information about the attributes being checked.A callback to drive dirty checking.Raised whenever a duplicate for a certain type occurs, such as a duplicate class, table, or property name.Enumeration of the types of things that can be duplicated.AFindOption
which requests a named fetch profile.An object capable of determining the entity name for a given entity instance.Represents an association fetching strategy.Exception forNotFoundAction.EXCEPTION
.Allows control over an enabled filter at runtime.Represents a flushing strategy.Various utility functions for working with proxies and lazy collection references.Operations for obtaining references to persistent collections of a certain type.Marks a group of exceptions that generally indicate an internal Hibernate error or bug.The base type for exceptions thrown by Hibernate.Loads an entity by its primary identifier.Marks the annotated Java element as incubating, potentially recursively.Thrown if Hibernate can't instantiate a class at runtime.Allows user code to inspect and/or change entity property values before they are written to the database, or after they are read from the database.Marks the annotated Java element as forming part of the internal implementation of Hibernate, meaning that clients should expect absolutely no guarantees with regard to the binary stability from release to release.Thrown when a mapping is found to be invalid.Wraps aSQLException
arising from the JDBC driver.Indicates an attempt to access unfetched data outside the context of an open statefulSession
.Defines a list of useful constant values that may be used to specify long column lengths in the JPAColumn
annotation.Instances represent a lock mode for a row of a relational database table.Contains a set of options describing how a row of a database table mapped by an entity should be locked.An exception that occurs while reading mapping sources, either XML or annotations, usually as a result of something screwy in the O/R mappings.Loads multiple instances of a given entity type at once, by specifying a list of identifier values.Loads an entity by its natural identifier, which may be a composite value comprising more than one attribute of the entity.Loads multiple instances of a given entity type at once, by specifying a list of natural id values.This exception is thrown when an operation would break session-scoped identity.Thrown when the application callsQuery.getSingleResult()
orQuery.uniqueResult()
and the query returns more than one row from the database.Thrown when the user tries to do something illegal with a deleted object.Thrown whenSession.find(Class, Object)
fails to select a row with the given primary key (identifier value).Thrown when the user passes a persistent instance to aSession
method that expects a transient instance.Thrown when a pessimistic locking conflict occurs.A problem occurred accessing a property of an instance of a persistent class by reflection, or via enhanced entities.Indicates that an expected getter or setter method could not be found on a class.Thrown when the (illegal) value of a property can not be persisted.A problem occurred translating a Hibernate query to SQL due to illegal query syntax, an operation which is not well-typed, an unresolvable reference to an entity or attribute, an unknown named query, or any similar problem.Indicates a problem with the runtime arguments bound to query parameters.Thrown when a database query timeout occurs.AFindOption
which requests that entities be loaded inReadOnlyMode.READ_ONLY
mode or in regularReadOnlyMode.READ_WRITE
mode.Indicates that the annotated element is planned for removal as part of a deprecation process.Deprecated.sinceSession.replicate(Object, ReplicationMode)
is deprecatedIndicates an attempt was made to use a closed resource, such as a closedSession
orSessionFactory
.A result iterator that allows moving around within the results by arbitrary increments.Specifies the type of JDBC scrollable result set to use underneath aScrollableResults
.The main runtime interface between a Java application and Hibernate.Allows creation of a newSession
with specific options.Implemented by custom listeners that respond to low-level events involving interactions between theSession
and the database or second-level cache.Thrown when the user calls a method of aSession
that is in an inappropriate state for the given call (for example, the session is closed or disconnected).ASessionFactory
represents an "instance" of Hibernate: it maintains the runtime metamodel representing persistent entities, their attributes, their associations, and their mappings to relational database tables, along with configuration that affects the runtime behavior of Hibernate, and instances of services that Hibernate needs to perform its duties.Allows reaction to basicSessionFactory
lifecycle events.SpecializedSessionBuilder
with access to stuff from another session.Declares operations that are common betweenSession
andStatelessSession
.Loads an entity by its natural identifier.A specializedStaleStateException
that carries information about the particular entity instance that was the source of the failure.Thrown when a version number or timestamp check failed, indicating that theSession
contained stale data (when using long transactions with versioning).A command-oriented API often used for performing bulk operations against the database.Allows creation of a newStatelessSession
with specific options.Enumerates the possible storage strategies for offset or zoned datetimes.Represents a resource-local transaction, where resource-local is interpreted by Hibernate to mean any transaction under the control of Hibernate.Indicates that a transaction could not be begun, committed or rolled back.Thrown when user code causes the end of a transaction that is being managed by theSessionFactory
.Thrown when the user passes a transient instance to aSession
method that expects a persistent instance.Thrown when a property cannot be persisted because it is an association with a transient unsaved entity instance.Used when a user provided type does not match the expected one.Indicates an attempt was made to refer to an unknown entity name or class.Indicates a request against an unknown filter name.Indicates a request against an unknown fetch profile name.Thrown when Hibernate could not resolve an object by id, especially when loading an association.Information about the version of Hibernate.Thrown when loading an entity (by identifier) results in a value that cannot be treated as the subclass type requested by the caller.
SessionEventListener
directly.