org.codehaus.groovy.grails.orm.hibernate
Class HibernateSession

java.lang.Object
  extended by org.grails.datastore.mapping.core.AbstractAttributeStoringSession
      extended by org.codehaus.groovy.grails.orm.hibernate.AbstractHibernateSession
          extended by org.codehaus.groovy.grails.orm.hibernate.HibernateSession
All Implemented Interfaces:
org.grails.datastore.mapping.core.Session

public class HibernateSession
extends org.codehaus.groovy.grails.orm.hibernate.AbstractHibernateSession

Session implementation that wraps a Hibernate Session.

Since:
1.0

Field Summary
 
Fields inherited from class org.codehaus.groovy.grails.orm.hibernate.AbstractHibernateSession
connected, datastore, hibernateTemplate
 
Fields inherited from class org.grails.datastore.mapping.core.AbstractAttributeStoringSession
attributes, sessionPropertyMap
 
Constructor Summary
HibernateSession(HibernateDatastore hibernateDatastore, org.hibernate.SessionFactory sessionFactory)
           
 
Method Summary
 org.grails.datastore.mapping.query.Query createQuery(java.lang.Class type)
           
 int deleteAll(org.grails.datastore.mapping.query.api.QueryableCriteria criteria)
          Deletes all objects matching the given criteria.
 javax.persistence.FlushModeType getFlushMode()
           
protected  GrailsHibernateTemplate getHibernateTemplate()
           
 java.io.Serializable getObjectIdentifier(java.lang.Object instance)
           
 java.util.List retrieveAll(java.lang.Class type, java.lang.Iterable keys)
           
 void setFlushMode(javax.persistence.FlushModeType flushMode)
           
 int updateAll(org.grails.datastore.mapping.query.api.QueryableCriteria criteria, java.util.Map<java.lang.String,java.lang.Object> properties)
          Updates all objects matching the given criteria and property values.
 
Methods inherited from class org.codehaus.groovy.grails.orm.hibernate.AbstractHibernateSession
attach, beginTransaction, clear, clear, contains, delete, delete, disconnect, flush, getDatastore, getIterableAsCollection, getMappingContext, getNativeInterface, getPersister, getTransaction, insert, isConnected, isDirty, lock, lock, persist, persist, proxy, refresh, retrieve, retrieveAll, unlock
 
Methods inherited from class org.grails.datastore.mapping.core.AbstractAttributeStoringSession
clearSessionProperty, getAttribute, getSessionProperty, removeAttributesForEntity, setAttribute, setSessionProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HibernateSession

public HibernateSession(HibernateDatastore hibernateDatastore,
                        org.hibernate.SessionFactory sessionFactory)
Method Detail

getObjectIdentifier

public java.io.Serializable getObjectIdentifier(java.lang.Object instance)

deleteAll

public int deleteAll(org.grails.datastore.mapping.query.api.QueryableCriteria criteria)
Deletes all objects matching the given criteria.

Parameters:
criteria - The criteria
Returns:
The total number of records deleted

updateAll

public int updateAll(org.grails.datastore.mapping.query.api.QueryableCriteria criteria,
                     java.util.Map<java.lang.String,java.lang.Object> properties)
Updates all objects matching the given criteria and property values.

Parameters:
criteria - The criteria
properties - The properties
Returns:
The total number of records updated

retrieveAll

public java.util.List retrieveAll(java.lang.Class type,
                                  java.lang.Iterable keys)

createQuery

public org.grails.datastore.mapping.query.Query createQuery(java.lang.Class type)

getHibernateTemplate

protected GrailsHibernateTemplate getHibernateTemplate()

setFlushMode

public void setFlushMode(javax.persistence.FlushModeType flushMode)

getFlushMode

public javax.persistence.FlushModeType getFlushMode()