|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object toolbox.services.BaseService toolbox.services.dao.DaoService toolbox.dao.orm.ORMQueryServiceImpl
public class ORMQueryServiceImpl
Default implementation of the ORMQueryService
interface.
This implementation is driven by an external XML configuration document
and it is assumend that entities are implementations of the
toolbox.dao.DaoBean
interface.
This implementation is also a subclass of the
toolbox.services.dao.DaoService
which
makes it possible to incorporate it into a service registry configuration.
Instances of this service must be configured as singletons within the
service registry.
Constructor Summary | |
---|---|
ORMQueryServiceImpl()
Default constructor. |
Method Summary | |
---|---|
void |
create(java.lang.String name,
java.lang.String confHome,
ServiceEnvironment env,
XMLProperties xmlProps)
Initialises the member ORMConfig instance using the provided XML configuration. |
java.util.List |
getReferenceIds(java.lang.String mapping)
Return a List of Strings that contain the names of the reference columns for the given mapping. |
java.util.List |
resolve(java.lang.String mapping)
Resolve the relationships of the named mapping. |
java.util.List |
resolve(java.lang.String mapping,
java.util.Map params)
Resolve the relationships of the named mapping and narrow the results using the provided query parameters. |
java.lang.Object |
resolve(java.lang.String mapping,
java.lang.Object key)
Resolve the relationships of a single database entity using a primary key value. |
java.util.List |
resolve(java.lang.String mapping,
PreparedQuery query,
java.lang.String postfix)
Resolve the relationships of the named mapping and narrow the results using the provided PreparedQuery instance. |
void |
setReferences(java.lang.String mapping,
java.lang.Object instance)
Set all the relationships for the given entity instance, given that the reference identifiers are available on the entity. |
void |
setReferences(java.lang.String mapping,
java.lang.Object instance,
java.lang.Object[] refIds)
Set all the relationships for the given entity instance. |
Methods inherited from class toolbox.services.dao.DaoService |
---|
checkConstraint, destroy, doCustomQuery, doCustomQuery, getDaoManager, getDaoWorker, getNextSequenceValue, insertDaoBean, insertDaoBean, updateDaoBean, updateDaoBean |
Methods inherited from class toolbox.services.BaseService |
---|
getConfigHome, getName, getProperties, getProperty, getXMLProperties, logConfig, logFine, logFiner, logFinest, logInfo, logSevere, logWarning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ORMQueryServiceImpl()
Method Detail |
---|
public void create(java.lang.String name, java.lang.String confHome, ServiceEnvironment env, XMLProperties xmlProps) throws ServiceException
create
in interface Service
create
in class DaoService
name
- The name of the service.confHome
- The path to the configuration home directory.env
- ServiceEnvironment of this service.xmlProps
- XML configuration properties.
ServiceException
- if the service cannot be created.public java.util.List resolve(java.lang.String mapping) throws DaoException
resolve
in interface ORMQueryService
mapping
- String containing the name of the relational mapping.
DaoException
- if the mapping cannot be resolved.public java.util.List resolve(java.lang.String mapping, java.util.Map params) throws DaoException
resolve
in interface ORMQueryService
mapping
- String containing the name of the relational mapping.params
- Map instance containing query parameters.
DaoException
- if the mapping cannot be resolved.public java.util.List resolve(java.lang.String mapping, PreparedQuery query, java.lang.String postfix) throws DaoException
resolve
in interface ORMQueryService
mapping
- String containing the name of the relational mapping.query
- PreparedQuery instance containing query parameters.postfix
- An optional postfix to append to the query.
DaoException
- if the mapping cannot be resolved.public java.lang.Object resolve(java.lang.String mapping, java.lang.Object key) throws DaoException
resolve
in interface ORMQueryService
mapping
- String containing the name of the relational mapping.key
- Object instance containing the primary key of the
entity to resolve.
DaoException
- if the mapping cannot be resolved.public void setReferences(java.lang.String mapping, java.lang.Object instance, java.lang.Object[] refIds) throws DaoException
setReferences
in interface ORMQueryService
mapping
- String containing the name of the relational mapping.instance
- Object instance that represents an entity with none of
it's relationships resolved.refIds
- Object array containing the identifiers of the entities
that are referenced by the entity instance.
DaoException
- if the relationships cannot resolved and applied to
the given entity instance.public void setReferences(java.lang.String mapping, java.lang.Object instance) throws DaoException
setReferences
in interface ORMQueryService
mapping
- String containing the name of the relational mapping.instance
- Object instance that represents an entity with none of
it's relationships resolved.
DaoException
- if the relationships cannot resolved and applied to
the given entity instance.public java.util.List getReferenceIds(java.lang.String mapping)
getReferenceIds
in interface ORMQueryService
mapping
- String containing the name of the relational mapping.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |