Methods Summary |
---|
public org.hibernate.Query | createSQLQuery(java.lang.String sql, java.lang.String returnAlias, java.lang.Class returnClass)Create a new instance of Query for the given SQL string.
|
public org.hibernate.Query | createSQLQuery(java.lang.String sql, java.lang.String[] returnAliases, java.lang.Class[] returnClasses)Create a new instance of Query for the given SQL string.
|
public int | delete(java.lang.String query)Delete all objects returned by the query. Return the number of objects deleted.
Note that this is very different from the delete-statement support added in HQL
since 3.1. The functionality here is to actually peform the query and then iterate
the results calling {@link #delete(Object)} individually.
|
public int | delete(java.lang.String query, java.lang.Object value, org.hibernate.type.Type type)Delete all objects returned by the query. Return the number of objects deleted.
Note that this is very different from the delete-statement support added in HQL
since 3.1. The functionality here is to actually peform the query and then iterate
the results calling {@link #delete(Object)} individually.
|
public int | delete(java.lang.String query, java.lang.Object[] values, org.hibernate.type.Type[] types)Delete all objects returned by the query. Return the number of objects deleted.
Note that this is very different from the delete-statement support added in HQL
since 3.1. The functionality here is to actually peform the query and then iterate
the results calling {@link #delete(Object)} individually.
|
public java.util.Collection | filter(java.lang.Object collection, java.lang.String filter)Apply a filter to a persistent collection. A filter is a Hibernate query that may refer to
this, the collection element. Filters allow efficient access to very large lazy
collections. (Executing the filter does not initialize the collection.)
|
public java.util.Collection | filter(java.lang.Object collection, java.lang.String filter, java.lang.Object value, org.hibernate.type.Type type)Apply a filter to a persistent collection. A filter is a Hibernate query that may refer to
this, the collection element.
|
public java.util.Collection | filter(java.lang.Object collection, java.lang.String filter, java.lang.Object[] values, org.hibernate.type.Type[] types)Apply a filter to a persistent collection.
Bind the given parameters to "?" placeholders. A filter is a Hibernate query that
may refer to this, the collection element.
|
public java.util.List | find(java.lang.String query)Execute a query.
|
public java.util.List | find(java.lang.String query, java.lang.Object value, org.hibernate.type.Type type)Execute a query with bind parameters, binding a value to a "?" parameter
in the query string.
|
public java.util.List | find(java.lang.String query, java.lang.Object[] values, org.hibernate.type.Type[] types)Execute a query with bind parameters, binding an array of values to "?"
parameters in the query string.
|
public java.util.Iterator | iterate(java.lang.String query, java.lang.Object[] values, org.hibernate.type.Type[] types)Execute a query and return the results in an iterator. Write the given values to "?"
in the query string. If the query has multiple return values, values will be returned
in an array of type Object[].
Entities returned as results are initialized on demand. The first SQL query returns
identifiers only. So iterate() is usually a less efficient way to retrieve
objects than find().
|
public java.util.Iterator | iterate(java.lang.String query)Execute a query and return the results in an iterator. If the query has multiple
return values, values will be returned in an array of type Object[].
Entities returned as results are initialized on demand. The first SQL query returns
identifiers only. So iterate() is usually a less efficient way to retrieve
objects than find().
|
public java.util.Iterator | iterate(java.lang.String query, java.lang.Object value, org.hibernate.type.Type type)Execute a query and return the results in an iterator. Write the given value to "?"
in the query string. If the query has multiple return values, values will be returned
in an array of type Object[].
Entities returned as results are initialized on demand. The first SQL query returns
identifiers only. So iterate() is usually a less efficient way to retrieve
objects than find().
|
public void | save(java.lang.Object object, java.io.Serializable id)Persist the given transient instance, using the given identifier. This operation
cascades to associated instances if the association is mapped with
cascade="save-update".
|
public void | save(java.lang.String entityName, java.lang.Object object, java.io.Serializable id)Persist the given transient instance, using the given identifier. This operation
cascades to associated instances if the association is mapped with
cascade="save-update".
|
public java.lang.Object | saveOrUpdateCopy(java.lang.Object object)Copy the state of the given object onto the persistent object with the same
identifier. If there is no persistent instance currently associated with
the session, it will be loaded. Return the persistent instance. If the
given instance is unsaved or does not exist in the database, save it and
return it as a newly persistent instance. Otherwise, the given instance
does not become associated with the session.
|
public java.lang.Object | saveOrUpdateCopy(java.lang.Object object, java.io.Serializable id)Copy the state of the given object onto the persistent object with the
given identifier. If there is no persistent instance currently associated
with the session, it will be loaded. Return the persistent instance. If
there is no database row with the given identifier, save the given instance
and return it as a newly persistent instance. Otherwise, the given instance
does not become associated with the session.
|
public java.lang.Object | saveOrUpdateCopy(java.lang.String entityName, java.lang.Object object)Copy the state of the given object onto the persistent object with the same
identifier. If there is no persistent instance currently associated with
the session, it will be loaded. Return the persistent instance. If the
given instance is unsaved or does not exist in the database, save it and
return it as a newly persistent instance. Otherwise, the given instance
does not become associated with the session.
|
public java.lang.Object | saveOrUpdateCopy(java.lang.String entityName, java.lang.Object object, java.io.Serializable id)Copy the state of the given object onto the persistent object with the
given identifier. If there is no persistent instance currently associated
with the session, it will be loaded. Return the persistent instance. If
there is no database row with the given identifier, save the given instance
and return it as a newly persistent instance. Otherwise, the given instance
does not become associated with the session.
|
public void | update(java.lang.Object object, java.io.Serializable id)Update the persistent state associated with the given identifier. An exception
is thrown if there is a persistent instance with the same identifier in the
current session. This operation cascades to associated instances
if the association is mapped with cascade="save-update".
|
public void | update(java.lang.String entityName, java.lang.Object object, java.io.Serializable id)Update the persistent state associated with the given identifier. An exception
is thrown if there is a persistent instance with the same identifier in the
current session. This operation cascades to associated instances
if the association is mapped with cascade="save-update".
|