Skip to content
Vadim Lopatin edited this page Jun 20, 2013 · 2 revisions

Query

Query is HibernateD interface to run parametrized queries written in HQL - SQL-like language.

Similar to Hibernate Query

Key methods:

Method Description
string getQueryString() Get the query string.
Object uniqueObject() Convenience method to return a single instance that matches the query, or null if the query returns no results.
Object uniqueObject(Object obj) Convenience method to return a single instance that matches the query, or null if the query returns no results. Reusing existing buffer.
T uniqueResult(T : Object)() Convenience method to return a single instance that matches the query, or null if the query returns no results.
T uniqueResult(T : Object)(T obj) Convenience method to return a single instance that matches the query, or null if the query returns no results. Reusing existing buffer.
Variant[] uniqueRow() Convenience method to return a single instance that matches the query, or null if the query returns no results.
Object[] listObjects() Return the query results as a List of entity objects
T[] list(T : Object)() Return the query results as a List of entity objects
Variant[][] listRows() Return the query results as a List which each row as Variant array
Query setParameterVariant(string name, Variant val) Bind a value to a named query parameter (all :parameters used in query should be bound before executing query).
Query setParameter(T)(string name, T val) Bind a value to a named query parameter (all :parameters used in query should be bound before executing query).
Clone this wiki locally