@Transactional(readOnly=true) public class QueryImpl extends AbstractLevel1Service implements LocalQuery
Modifier and Type | Field and Description |
---|---|
protected java.lang.Class<? extends org.apache.lucene.analysis.Analyzer> |
analyzer |
protected TimeoutSetter |
timeoutSetter |
queryFactory, sessionFactory
Constructor and Description |
---|
QueryImpl() |
Modifier and Type | Method and Description |
---|---|
java.lang.Long |
aggByQuery(java.lang.String agg,
java.lang.String field,
java.lang.String query,
ome.parameters.Parameters params) |
java.util.Map<java.lang.String,java.lang.Long> |
aggMapByQuery(java.lang.String agg,
java.lang.String mapKey,
java.lang.String field,
java.lang.String query,
ome.parameters.Parameters params) |
boolean |
checkProperty(java.lang.String type,
java.lang.String property)
Checks if a property is defined on a mapped Hibernate type.
|
boolean |
checkType(java.lang.String type)
Checks if a type has been mapped in Hibernate.
|
void |
clear() |
boolean |
contains(java.lang.Object obj)
Tests if an object is currently contained in the session.
|
void |
evict(java.lang.Object obj)
Removes an object graph from the session.
|
<T> T |
execute(org.springframework.orm.hibernate3.HibernateCallback callback)
Executes a
HibernateCallback |
<T> T |
execute(Query<T> query)
Executes a locally defined Query.
|
ome.model.IObject |
find(java.lang.Class klass,
long id) |
<T extends ome.model.IObject> |
findAll(java.lang.Class<T> klass,
ome.parameters.Filter filter) |
<T extends ome.model.IObject> |
findAllByExample(T example,
ome.parameters.Filter filter) |
<T extends ome.model.IObject> |
findAllByFullText(java.lang.Class<T> type,
java.lang.String query,
ome.parameters.Parameters params) |
<T extends ome.model.IObject> |
findAllByQuery(java.lang.String queryName,
ome.parameters.Parameters params) |
<T extends ome.model.IObject> |
findAllByString(java.lang.Class<T> klass,
java.lang.String fieldName,
java.lang.String value,
boolean caseSensitive,
ome.parameters.Filter filter) |
<T extends ome.model.IObject> |
findByExample(T example) |
<T extends ome.model.IObject> |
findByQuery(java.lang.String queryName,
ome.parameters.Parameters params) |
<T extends ome.model.IObject> |
findByString(java.lang.Class<T> klass,
java.lang.String fieldName,
java.lang.String value) |
ome.model.IObject |
get(java.lang.Class klass,
long id) |
java.lang.Class<? extends ome.api.ServiceInterface> |
getServiceInterface() |
void |
initialize(java.lang.Object obj)
Uses the Hibernate static method
initialize to prepare an
object for shipping over the wire. |
static boolean |
isProbablyTimeout(org.springframework.dao.DataAccessResourceFailureException exception) |
protected void |
parseFilter(org.hibernate.Criteria c,
ome.parameters.Filter f)
Responsible for applying the information provided in a
Filter to a Criteria
instance. |
java.util.List<java.lang.Object[]> |
projection(java.lang.String query,
ome.parameters.Parameters p) |
<T extends ome.model.IObject> |
refresh(T iObject) |
void |
setAnalyzer(java.lang.Class<? extends org.apache.lucene.analysis.Analyzer> analyzer) |
void |
setTimeoutSetter(TimeoutSetter timeoutSetter) |
getBeanHelper, getQueryFactory, getSessionFactory, selfConfigure, setQueryFactory, setSessionFactory
protected java.lang.Class<? extends org.apache.lucene.analysis.Analyzer> analyzer
protected TimeoutSetter timeoutSetter
public void setAnalyzer(java.lang.Class<? extends org.apache.lucene.analysis.Analyzer> analyzer)
public void setTimeoutSetter(TimeoutSetter timeoutSetter)
public java.lang.Class<? extends ome.api.ServiceInterface> getServiceInterface()
getServiceInterface
in interface ome.system.SelfConfigurableService
@Transactional(readOnly=false) public boolean contains(java.lang.Object obj)
LocalQuery
contains
in interface LocalQuery
@Transactional(readOnly=false) public void evict(java.lang.Object obj)
LocalQuery
evict
in interface LocalQuery
@Transactional(readOnly=false) public void clear()
clear
in interface LocalQuery
public void initialize(java.lang.Object obj)
LocalQuery
initialize
to prepare an
object for shipping over the wire.
It is better to do this in your queries.initialize
in interface LocalQuery
Hibernate
@Transactional(propagation=SUPPORTS) public boolean checkType(java.lang.String type)
LocalQuery
checkType
in interface LocalQuery
type
- String representation of a full-qualified Hibernate-mapped
type.@Transactional(propagation=SUPPORTS) public boolean checkProperty(java.lang.String type, java.lang.String property)
LocalQuery
checkProperty
in interface LocalQuery
type
- String representation of a full-qualified Hibernate-mapped
type.property
- Property as defined in Hibernate NOT the public final static
Strings on our IObject classes.public static boolean isProbablyTimeout(org.springframework.dao.DataAccessResourceFailureException exception)
exception
- a wrapped query exceptionpublic <T> T execute(org.springframework.orm.hibernate3.HibernateCallback callback)
LocalQuery
HibernateCallback
execute
in interface LocalQuery
callback
- An implementation of the HibernateCallback interface.LocalQuery.execute(HibernateCallback)
public <T> T execute(Query<T> query)
LocalQuery
execute
in interface LocalQuery
query
- A subclass of the Query
interface.LocalQuery.execute(Query)
public ome.model.IObject get(java.lang.Class klass, long id) throws ome.conditions.ValidationException
get
in interface ome.api.IQuery
ome.conditions.ValidationException
public ome.model.IObject find(java.lang.Class klass, long id)
find
in interface ome.api.IQuery
public <T extends ome.model.IObject> java.util.List<T> findAll(java.lang.Class<T> klass, ome.parameters.Filter filter)
findAll
in interface ome.api.IQuery
public <T extends ome.model.IObject> T findByExample(T example) throws ome.conditions.ApiUsageException
findByExample
in interface ome.api.IQuery
ome.conditions.ApiUsageException
public <T extends ome.model.IObject> java.util.List<T> findAllByExample(T example, ome.parameters.Filter filter)
findAllByExample
in interface ome.api.IQuery
public <T extends ome.model.IObject> T findByString(java.lang.Class<T> klass, java.lang.String fieldName, java.lang.String value) throws ome.conditions.ApiUsageException
findByString
in interface ome.api.IQuery
ome.conditions.ApiUsageException
public <T extends ome.model.IObject> java.util.List<T> findAllByString(java.lang.Class<T> klass, java.lang.String fieldName, java.lang.String value, boolean caseSensitive, ome.parameters.Filter filter) throws ome.conditions.ApiUsageException
findAllByString
in interface ome.api.IQuery
ome.conditions.ApiUsageException
public <T extends ome.model.IObject> T findByQuery(java.lang.String queryName, ome.parameters.Parameters params) throws ome.conditions.ValidationException
findByQuery
in interface ome.api.IQuery
ome.conditions.ValidationException
public <T extends ome.model.IObject> java.util.List<T> findAllByQuery(java.lang.String queryName, ome.parameters.Parameters params)
findAllByQuery
in interface ome.api.IQuery
public <T extends ome.model.IObject> java.util.List<T> findAllByFullText(java.lang.Class<T> type, java.lang.String query, ome.parameters.Parameters params)
findAllByFullText
in interface ome.api.IQuery
public java.util.List<java.lang.Object[]> projection(java.lang.String query, ome.parameters.Parameters p)
projection
in interface ome.api.IQuery
public java.lang.Long aggByQuery(java.lang.String agg, java.lang.String field, java.lang.String query, ome.parameters.Parameters params)
public java.util.Map<java.lang.String,java.lang.Long> aggMapByQuery(java.lang.String agg, java.lang.String mapKey, java.lang.String field, java.lang.String query, ome.parameters.Parameters params)
public <T extends ome.model.IObject> T refresh(T iObject) throws ome.conditions.ApiUsageException
refresh
in interface ome.api.IQuery
ome.conditions.ApiUsageException
protected void parseFilter(org.hibernate.Criteria c, ome.parameters.Filter f)
Filter
to a Criteria
instance.c
- a criteria instancef
- a filter to limit a query