Package net.sf.basedb.core.hibernate
Class EntityQueryWrapper<R>
java.lang.Object
net.sf.basedb.core.hibernate.QueryWrapper<R>
net.sf.basedb.core.hibernate.EntityQueryWrapper<R>
- All Implemented Interfaces:
javax.persistence.Query
,javax.persistence.TypedQuery<R>
,BasicQueryContract<CommonQueryContract>
,Query<R>
,CommonQueryContract
,Query<R>
Wraps a hibernate query and adds checks so that unsaved items aren't
added to the query as parameters. This is normally not detected until the
query is executed. By wrapping a query with this class the same situation is
detected immediately when adding the parameter to the query, which makes
it easier to find problems.
- Version:
- 2.5
- Author:
- nicklas
- Last modified
- $Date: 2018-11-06 15:50:29 +0100 (ti, 06 nov 2018) $
-
Field Summary
Fields inherited from class net.sf.basedb.core.hibernate.QueryWrapper
query
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate void
checkEntity
(IdentifiableData entity) private void
checkEntityArray
(Object[] values) private void
checkEntityCollection
(Collection<?> values) Deprecated.Deprecated.setParameter
(int position, Object val) setParameter
(int position, Object val, Type type) setParameter
(String name, Object val) setParameter
(String name, Object val, Type type) setParameter
(javax.persistence.Parameter<T> param, T val) setParameter
(QueryParameter<P> param, P val, Type type) setParameter
(QueryParameter<T> param, T val) setParameterList
(String name, Object[] vals) setParameterList
(String name, Object[] vals, Type type) setParameterList
(String name, Collection vals) setParameterList
(String name, Collection vals, Type type) setParameterList
(QueryParameter<P> param, Collection<P> values) Methods inherited from class net.sf.basedb.core.hibernate.QueryWrapper
addQueryHint, applyGraph, determineProperBooleanType, determineProperBooleanType, executeUpdate, getCacheMode, getCacheRegion, getComment, getFetchSize, getFirstResult, getFlushMode, getHibernateFlushMode, getHints, getLockMode, getLockOptions, getMaxResults, getNamedParameters, getParameter, getParameter, getParameter, getParameter, getParameterMetadata, getParameters, getParameterValue, getParameterValue, getParameterValue, getProducer, getQueryOptions, getQueryString, getReturnAliases, getReturnTypes, getTimeout, isBound, isCacheable, isReadOnly, iterate, list, scroll, scroll, setBigDecimal, setBigDecimal, setBigInteger, setBigInteger, setBinary, setBinary, setBoolean, setBoolean, setByte, setByte, setCacheable, setCacheMode, setCacheRegion, setCalendar, setCalendar, setCalendarDate, setCalendarDate, setCharacter, setCharacter, setComment, setDate, setDate, setDouble, setDouble, setFetchSize, setFirstResult, setFloat, setFloat, setFlushMode, setFlushMode, setHibernateFlushMode, setHint, setInteger, setInteger, setLocale, setLocale, setLockMode, setLockMode, setLockOptions, setLong, setLong, setMaxResults, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameterList, setParameterList, setParameterList, setParameterList, setParameters, setProperties, setProperties, setReadOnly, setResultTransformer, setSerializable, setSerializable, setShort, setShort, setString, setString, setText, setText, setTime, setTime, setTimeout, setTimestamp, setTimestamp, stream, uniqueResult, uniqueResultOptional, unwrap
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.hibernate.Query
getHibernateFirstResult, getHibernateMaxResults, setHibernateFirstResult, setHibernateMaxResults
Methods inherited from interface org.hibernate.query.Query
applyFetchGraph, applyLoadGraph, getResultList, getResultStream, getSingleResult
-
Constructor Details
-
EntityQueryWrapper
-
-
Method Details
-
setEntity
Deprecated. -
setEntity
Deprecated. -
setParameter
- Specified by:
setParameter
in interfacejavax.persistence.Query
- Specified by:
setParameter
in interfaceQuery<R>
- Specified by:
setParameter
in interfaceQuery<R>
- Specified by:
setParameter
in interfacejavax.persistence.TypedQuery<R>
- Overrides:
setParameter
in classQueryWrapper<R>
- Throws:
HibernateException
-
setParameter
- Specified by:
setParameter
in interfacejavax.persistence.Query
- Specified by:
setParameter
in interfaceQuery<R>
- Specified by:
setParameter
in interfaceQuery<R>
- Specified by:
setParameter
in interfacejavax.persistence.TypedQuery<R>
- Overrides:
setParameter
in classQueryWrapper<R>
- Throws:
HibernateException
-
setParameter
- Specified by:
setParameter
in interfaceQuery<R>
- Specified by:
setParameter
in interfaceQuery<R>
- Overrides:
setParameter
in classQueryWrapper<R>
-
setParameter
- Specified by:
setParameter
in interfaceQuery<R>
- Specified by:
setParameter
in interfaceQuery<R>
- Overrides:
setParameter
in classQueryWrapper<R>
-
setParameterList
- Specified by:
setParameterList
in interfaceQuery<R>
- Specified by:
setParameterList
in interfaceQuery<R>
- Overrides:
setParameterList
in classQueryWrapper<R>
- Throws:
HibernateException
-
setParameterList
- Specified by:
setParameterList
in interfaceQuery<R>
- Specified by:
setParameterList
in interfaceQuery<R>
- Overrides:
setParameterList
in classQueryWrapper<R>
- Throws:
HibernateException
-
setParameterList
- Specified by:
setParameterList
in interfaceQuery<R>
- Specified by:
setParameterList
in interfaceQuery<R>
- Overrides:
setParameterList
in classQueryWrapper<R>
- Throws:
HibernateException
-
setParameterList
- Specified by:
setParameterList
in interfaceQuery<R>
- Specified by:
setParameterList
in interfaceQuery<R>
- Overrides:
setParameterList
in classQueryWrapper<R>
- Throws:
HibernateException
-
setParameter
- Specified by:
setParameter
in interfacejavax.persistence.Query
- Specified by:
setParameter
in interfaceQuery<R>
- Specified by:
setParameter
in interfaceQuery<R>
- Specified by:
setParameter
in interfacejavax.persistence.TypedQuery<R>
- Overrides:
setParameter
in classQueryWrapper<R>
-
setParameter
- Specified by:
setParameter
in interfaceQuery<R>
- Specified by:
setParameter
in interfaceQuery<R>
- Overrides:
setParameter
in classQueryWrapper<R>
-
setParameter
- Specified by:
setParameter
in interfaceQuery<R>
- Specified by:
setParameter
in interfaceQuery<R>
- Overrides:
setParameter
in classQueryWrapper<R>
-
setParameterList
- Specified by:
setParameterList
in interfaceQuery<R>
- Specified by:
setParameterList
in interfaceQuery<R>
- Overrides:
setParameterList
in classQueryWrapper<R>
-
checkEntity
-
checkEntityCollection
-
checkEntityArray
-