Package org.grails.orm.hibernate
Class HibernateSession
java.lang.Object
org.grails.datastore.mapping.core.AbstractAttributeStoringSession
org.grails.orm.hibernate.AbstractHibernateSession
org.grails.orm.hibernate.HibernateSession
- All Implemented Interfaces:
org.grails.datastore.mapping.core.Session,org.grails.datastore.mapping.query.api.QueryAliasAwareSession,org.grails.datastore.mapping.query.QueryCreator
Session implementation that wraps a Hibernate
Session.- Since:
- 1.0
-
Field Summary
Fields inherited from class org.grails.orm.hibernate.AbstractHibernateSession
connected, datastore, hibernateTemplateFields inherited from class org.grails.datastore.mapping.core.AbstractAttributeStoringSession
attributes, sessionPropertyMap -
Constructor Summary
ConstructorsConstructorDescriptionHibernateSession(HibernateDatastore hibernateDatastore, org.hibernate.SessionFactory sessionFactory) HibernateSession(HibernateDatastore hibernateDatastore, org.hibernate.SessionFactory sessionFactory, int defaultFlushMode) -
Method Summary
Modifier and TypeMethodDescriptionorg.grails.datastore.mapping.query.QuerycreateQuery(Class type) org.grails.datastore.mapping.query.QuerycreateQuery(Class type, String alias) longdeleteAll(org.grails.datastore.mapping.query.api.QueryableCriteria criteria) Deletes all objects matching the given criteria.jakarta.persistence.FlushModeTypeprotected GrailsHibernateTemplategetObjectIdentifier(Object instance) retrieveAll(Class type, Iterable keys) voidsetFlushMode(jakarta.persistence.FlushModeType flushMode) longupdateAll(org.grails.datastore.mapping.query.api.QueryableCriteria criteria, Map<String, Object> properties) Updates all objects matching the given criteria and property values.Methods inherited from class org.grails.orm.hibernate.AbstractHibernateSession
attach, beginTransaction, beginTransaction, clear, clear, contains, delete, delete, disconnect, flush, getDatastore, getIterableAsCollection, getMappingContext, getNativeInterface, getPersister, getTransaction, hasTransaction, insert, isConnected, isDirty, isSchemaless, lock, lock, persist, persist, proxy, refresh, retrieve, retrieveAll, setSynchronizedWithTransaction, unlockMethods inherited from class org.grails.datastore.mapping.core.AbstractAttributeStoringSession
clearSessionProperty, getAttribute, getSessionProperty, removeAttributesForEntity, setAttribute, setSessionPropertyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.grails.datastore.mapping.core.Session
clearSessionProperty, getAttribute, getSessionProperty, setAttribute, setSessionProperty
-
Constructor Details
-
HibernateSession
public HibernateSession(HibernateDatastore hibernateDatastore, org.hibernate.SessionFactory sessionFactory, int defaultFlushMode) -
HibernateSession
public HibernateSession(HibernateDatastore hibernateDatastore, org.hibernate.SessionFactory sessionFactory)
-
-
Method Details
-
getObjectIdentifier
-
deleteAll
public long 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 long updateAll(org.grails.datastore.mapping.query.api.QueryableCriteria criteria, Map<String, Object> properties) Updates all objects matching the given criteria and property values.- Parameters:
criteria- The criteriaproperties- The properties- Returns:
- The total number of records updated
-
retrieveAll
-
createQuery
-
createQuery
-
getHibernateTemplate
-
setFlushMode
public void setFlushMode(jakarta.persistence.FlushModeType flushMode) -
getFlushMode
public jakarta.persistence.FlushModeType getFlushMode()- Specified by:
getFlushModein interfaceorg.grails.datastore.mapping.core.Session- Specified by:
getFlushModein classAbstractHibernateSession
-