public class HibernateTransaction extends Object implements RequestScopedTransaction
| Modifier | Constructor and Description |
|---|---|
|
HibernateTransaction(org.hibernate.Session session)
Deprecated.
since 2.3.2. Will be removed no later than the release of Elide 3.0.
|
protected |
HibernateTransaction(org.hibernate.Session session,
boolean isScrollEnabled,
org.hibernate.ScrollMode scrollMode)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
User |
accessUser(Object opaqueUser) |
protected CriterionFilterOperation |
buildCriterionFilterOperation(org.hibernate.Criteria criteria)
Build the CriterionFilterOperation for provided criteria
|
void |
close() |
void |
commit() |
<T> T |
createObject(Class<T> entityClass) |
void |
delete(Object object) |
<T> Collection |
filterCollection(Collection collection,
Class<T> entityClass,
Set<Predicate> predicates)
Deprecated.
|
<T> Collection |
filterCollectionWithSortingAndPagination(Collection collection,
Class<T> entityClass,
EntityDictionary dictionary,
Optional<Set<Predicate>> filters,
Optional<Sorting> sorting,
Optional<Pagination> pagination)
Deprecated.
|
void |
flush() |
List<String> |
getIncludeList()
Parse include param into list of include fields.
|
Integer |
getQueryLimit()
Overrideable default query limit for the data store
|
<T> Object |
getRelation(Object entity,
RelationshipType relationshipType,
String relationName,
Class<T> relationClass,
EntityDictionary dictionary,
Optional<FilterExpression> filterExpression,
Sorting sorting,
Pagination pagination) |
<T> Long |
getTotalRecords(Class<T> entityClass) |
boolean |
isJoinQuery()
Should this transaction use JOINs.
|
<T> T |
loadObject(Class<T> loadClass,
Serializable id)
Deprecated.
|
<T> T |
loadObject(Class<T> loadClass,
Serializable id,
Optional<FilterExpression> filterExpression)
load a single record with id and filter.
|
<T> Iterable<T> |
loadObjects(Class<T> loadClass)
Deprecated.
|
<T> Iterable<T> |
loadObjects(Class<T> loadClass,
org.hibernate.Criteria criteria,
Optional<Set<org.hibernate.criterion.Order>> sortingRules,
Optional<Pagination> pagination)
Generates the Hibernate ScrollableIterator for Hibernate Query.
|
<T> Iterable<T> |
loadObjects(Class<T> loadClass,
FilterScope filterScope) |
<T> Iterable<T> |
loadObjectsWithSortingAndPagination(Class<T> entityClass,
FilterScope filterScope) |
protected <T> Collection |
patchRequestFilterCollection(Collection collection,
Class<T> entityClass,
FilterExpression filterExpression)
for PatchRequest use only inMemory tests since objects in the collection may be new and unsaved
|
protected <T> Collection |
patchRequestFilterCollection(Collection collection,
Class<T> entityClass,
Set<Predicate> predicates)
Deprecated.
will be removed in Elide 3.0
|
void |
save(Object object) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsetRequestScopegetRelation, getRelationWithSortingAndPagination, preCommit@Deprecated public HibernateTransaction(org.hibernate.Session session)
session - the sessionprotected HibernateTransaction(org.hibernate.Session session,
boolean isScrollEnabled,
org.hibernate.ScrollMode scrollMode)
session - Hibernate sessionisScrollEnabled - Whether or not scrolling is enabledscrollMode - Scroll mode to use if scrolling enabledpublic void delete(Object object)
delete in interface DataStoreTransactionpublic void save(Object object)
save in interface DataStoreTransactionpublic void flush()
flush in interface DataStoreTransactionpublic void commit()
commit in interface DataStoreTransactionpublic <T> T createObject(Class<T> entityClass)
createObject in interface DataStoreTransaction@Deprecated public <T> T loadObject(Class<T> loadClass, Serializable id)
loadObject in interface DataStoreTransactionpublic <T> T loadObject(Class<T> loadClass, Serializable id, Optional<FilterExpression> filterExpression)
loadObject in interface DataStoreTransactionloadClass - class of query objectid - id of the query objectfilterExpression - FilterExpression contains the predicatesprotected CriterionFilterOperation buildCriterionFilterOperation(org.hibernate.Criteria criteria)
criteria - the criteria@Deprecated public <T> Iterable<T> loadObjects(Class<T> loadClass)
loadObjects in interface DataStoreTransactionpublic <T> Iterable<T> loadObjects(Class<T> loadClass, FilterScope filterScope)
loadObjects in interface DataStoreTransactionpublic <T> Iterable<T> loadObjectsWithSortingAndPagination(Class<T> entityClass, FilterScope filterScope)
loadObjectsWithSortingAndPagination in interface DataStoreTransactionpublic <T> Iterable<T> loadObjects(Class<T> loadClass, org.hibernate.Criteria criteria, Optional<Set<org.hibernate.criterion.Order>> sortingRules, Optional<Pagination> pagination)
T - The return Iterable type.loadClass - The hibernate class to build the query off of.criteria - The criteria to use for filterssortingRules - The possibly empty sorting rules.pagination - The Optional pagination object.public <T> Long getTotalRecords(Class<T> entityClass)
getTotalRecords in interface DataStoreTransactionpublic boolean isJoinQuery()
public List<String> getIncludeList()
public <T> Object getRelation(Object entity, RelationshipType relationshipType, String relationName, Class<T> relationClass, EntityDictionary dictionary, Optional<FilterExpression> filterExpression, Sorting sorting, Pagination pagination)
getRelation in interface DataStoreTransaction@Deprecated public <T> Collection filterCollection(Collection collection, Class<T> entityClass, Set<Predicate> predicates)
filterCollection in interface DataStoreTransactionprotected <T> Collection patchRequestFilterCollection(Collection collection, Class<T> entityClass, FilterExpression filterExpression)
T - the type parametercollection - the collection to filterentityClass - the class of the entities in the collectionfilterExpression - the filter expression@Deprecated protected <T> Collection patchRequestFilterCollection(Collection collection, Class<T> entityClass, Set<Predicate> predicates)
T - the type parametercollection - the collection to filterentityClass - the class of the entities in the collectionpredicates - the set of Predicate's to filter by@Deprecated public <T> Collection filterCollectionWithSortingAndPagination(Collection collection, Class<T> entityClass, EntityDictionary dictionary, Optional<Set<Predicate>> filters, Optional<Sorting> sorting, Optional<Pagination> pagination)
filterCollectionWithSortingAndPagination in interface DataStoreTransactionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic User accessUser(Object opaqueUser)
accessUser in interface DataStoreTransactionpublic Integer getQueryLimit()
Copyright © 2015–2017. All rights reserved.