Groovy Documentation

org.codehaus.groovy.grails.orm.hibernate
[Java] Class HibernateSession

java.lang.Object
  org.grails.datastore.mapping.core.AbstractAttributeStoringSession
      org.codehaus.groovy.grails.orm.hibernate.HibernateSession

@SuppressWarnings("rawtypes")
public class HibernateSession
extends org.grails.datastore.mapping.core.AbstractAttributeStoringSession

Session implementation that wraps a Hibernate org.hibernate.Session.

Authors:
Graeme Rocher
Since:
1.0


Constructor Summary
HibernateSession(HibernateDatastore hibernateDatastore, org.hibernate.SessionFactory sessionFactory)

 
Method Summary
void attach(java.lang.Object o)

org.grails.datastore.mapping.transactions.Transaction beginTransaction()

void clear()

void clear(java.lang.Object o)

boolean contains(java.lang.Object o)

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

void delete(java.lang.Iterable objects)

void delete(java.lang.Object obj)

int deleteAll(org.grails.datastore.mapping.query.api.QueryableCriteria criteria)

Deletes all objects matching the given criteria.

void disconnect()

void flush()

org.grails.datastore.mapping.core.Datastore getDatastore()

javax.persistence.FlushModeType getFlushMode()

org.grails.datastore.mapping.model.MappingContext getMappingContext()

org.springframework.orm.hibernate3.HibernateTemplate getNativeInterface()

org.grails.datastore.mapping.engine.Persister getPersister(java.lang.Object o)

org.grails.datastore.mapping.transactions.Transaction getTransaction()

boolean isConnected()

boolean isDirty(java.lang.Object o)

void lock(java.lang.Object o)

java.lang.Object lock(java.lang.Class type, java.io.Serializable key)

java.io.Serializable persist(java.lang.Object o)

java.util.List persist(java.lang.Iterable objects)

java.lang.Object proxy(java.lang.Class type, java.io.Serializable key)

void refresh(java.lang.Object o)

java.lang.Object retrieve(java.lang.Class type, java.io.Serializable key)

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

java.util.List retrieveAll(java.lang.Class type, java.io.Serializable... keys)

void setFlushMode(javax.persistence.FlushModeType flushMode)

void unlock(java.lang.Object o)

int updateAll(org.grails.datastore.mapping.query.api.QueryableCriteria criteria, java.util.Map properties)

Updates all objects matching the given criteria and property values.

 
Methods inherited from class org.grails.datastore.mapping.core.AbstractAttributeStoringSession
org.grails.datastore.mapping.core.AbstractAttributeStoringSession#getAttribute(java.lang.Object, java.lang.String), org.grails.datastore.mapping.core.AbstractAttributeStoringSession#setAttribute(java.lang.Object, java.lang.String, java.lang.Object), org.grails.datastore.mapping.core.AbstractAttributeStoringSession#isConnected(), org.grails.datastore.mapping.core.AbstractAttributeStoringSession#disconnect(), org.grails.datastore.mapping.core.AbstractAttributeStoringSession#wait(), org.grails.datastore.mapping.core.AbstractAttributeStoringSession#wait(long), org.grails.datastore.mapping.core.AbstractAttributeStoringSession#wait(long, int), org.grails.datastore.mapping.core.AbstractAttributeStoringSession#equals(java.lang.Object), org.grails.datastore.mapping.core.AbstractAttributeStoringSession#toString(), org.grails.datastore.mapping.core.AbstractAttributeStoringSession#hashCode(), org.grails.datastore.mapping.core.AbstractAttributeStoringSession#getClass(), org.grails.datastore.mapping.core.AbstractAttributeStoringSession#notify(), org.grails.datastore.mapping.core.AbstractAttributeStoringSession#notifyAll(), org.grails.datastore.mapping.core.AbstractAttributeStoringSession#lock(java.lang.Class, java.io.Serializable), org.grails.datastore.mapping.core.AbstractAttributeStoringSession#lock(java.lang.Object), org.grails.datastore.mapping.core.AbstractAttributeStoringSession#clear(java.lang.Object), org.grails.datastore.mapping.core.AbstractAttributeStoringSession#clear(), org.grails.datastore.mapping.core.AbstractAttributeStoringSession#contains(java.lang.Object), org.grails.datastore.mapping.core.AbstractAttributeStoringSession#flush(), org.grails.datastore.mapping.core.AbstractAttributeStoringSession#delete(java.lang.Iterable), org.grails.datastore.mapping.core.AbstractAttributeStoringSession#delete(java.lang.Object), org.grails.datastore.mapping.core.AbstractAttributeStoringSession#unlock(java.lang.Object), org.grails.datastore.mapping.core.AbstractAttributeStoringSession#retrieve(java.lang.Class, java.io.Serializable), org.grails.datastore.mapping.core.AbstractAttributeStoringSession#refresh(java.lang.Object), org.grails.datastore.mapping.core.AbstractAttributeStoringSession#isDirty(java.lang.Object), org.grails.datastore.mapping.core.AbstractAttributeStoringSession#proxy(java.lang.Class, java.io.Serializable), org.grails.datastore.mapping.core.AbstractAttributeStoringSession#attach(java.lang.Object), org.grails.datastore.mapping.core.AbstractAttributeStoringSession#deleteAll(org.grails.datastore.mapping.query.api.QueryableCriteria), org.grails.datastore.mapping.core.AbstractAttributeStoringSession#updateAll(org.grails.datastore.mapping.query.api.QueryableCriteria, java.util.Map), org.grails.datastore.mapping.core.AbstractAttributeStoringSession#setFlushMode(javax.persistence.FlushModeType), org.grails.datastore.mapping.core.AbstractAttributeStoringSession#getMappingContext(), org.grails.datastore.mapping.core.AbstractAttributeStoringSession#createQuery(java.lang.Class), org.grails.datastore.mapping.core.AbstractAttributeStoringSession#getPersister(java.lang.Object), org.grails.datastore.mapping.core.AbstractAttributeStoringSession#getFlushMode(), org.grails.datastore.mapping.core.AbstractAttributeStoringSession#getTransaction(), org.grails.datastore.mapping.core.AbstractAttributeStoringSession#persist(java.lang.Iterable), org.grails.datastore.mapping.core.AbstractAttributeStoringSession#persist(java.lang.Object), org.grails.datastore.mapping.core.AbstractAttributeStoringSession#beginTransaction(), org.grails.datastore.mapping.core.AbstractAttributeStoringSession#retrieveAll(java.lang.Class, [Ljava.io.Serializable;), org.grails.datastore.mapping.core.AbstractAttributeStoringSession#retrieveAll(java.lang.Class, java.lang.Iterable), org.grails.datastore.mapping.core.AbstractAttributeStoringSession#getDatastore(), org.grails.datastore.mapping.core.AbstractAttributeStoringSession#getNativeInterface()
 
Methods inherited from class java.lang.Object
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Constructor Detail

HibernateSession

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


 
Method Detail

attach

public void attach(java.lang.Object o)


beginTransaction

public org.grails.datastore.mapping.transactions.Transaction beginTransaction()


clear

public void clear()


clear

public void clear(java.lang.Object o)


contains

public boolean contains(java.lang.Object o)


createQuery

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


delete

public void delete(java.lang.Iterable objects)


delete

public void delete(java.lang.Object obj)


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


disconnect

@Override
public void disconnect()


flush

public void flush()


getDatastore

public org.grails.datastore.mapping.core.Datastore getDatastore()


getFlushMode

public javax.persistence.FlushModeType getFlushMode()


getMappingContext

public org.grails.datastore.mapping.model.MappingContext getMappingContext()


getNativeInterface

public org.springframework.orm.hibernate3.HibernateTemplate getNativeInterface()


getPersister

public org.grails.datastore.mapping.engine.Persister getPersister(java.lang.Object o)


getTransaction

public org.grails.datastore.mapping.transactions.Transaction getTransaction()


isConnected

@Override
public boolean isConnected()


isDirty

public boolean isDirty(java.lang.Object o)


lock

public void lock(java.lang.Object o)


lock

public java.lang.Object lock(java.lang.Class type, java.io.Serializable key)


persist

public java.io.Serializable persist(java.lang.Object o)


persist

public java.util.List persist(java.lang.Iterable objects)


proxy

public java.lang.Object proxy(java.lang.Class type, java.io.Serializable key)


refresh

public void refresh(java.lang.Object o)


retrieve

public java.lang.Object retrieve(java.lang.Class type, java.io.Serializable key)


retrieveAll

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


retrieveAll

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


setFlushMode

public void setFlushMode(javax.persistence.FlushModeType flushMode)


unlock

public void unlock(java.lang.Object o)


updateAll

public int updateAll(org.grails.datastore.mapping.query.api.QueryableCriteria criteria, java.util.Map 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


 

Groovy Documentation