.. java:import:: org.apache.commons.lang StringUtils .. java:import:: org.motechproject.mds.domain Entity .. java:import:: org.motechproject.mds.domain Field .. java:import:: org.motechproject.mds.ex EntityNotFoundException .. java:import:: org.motechproject.mds.ex SecurityException .. java:import:: org.motechproject.mds.filter Filter .. java:import:: org.motechproject.mds.query Property .. java:import:: org.motechproject.mds.query QueryExecution .. java:import:: org.motechproject.mds.query QueryParams .. java:import:: org.motechproject.mds.repository AllEntities .. java:import:: org.motechproject.mds.repository MotechDataRepository .. java:import:: org.motechproject.mds.util InstanceSecurityRestriction .. java:import:: org.motechproject.mds.util PropertyUtil .. java:import:: org.motechproject.mds.util SecurityMode .. java:import:: org.springframework.beans.factory.annotation Autowired .. java:import:: org.springframework.beans.factory.annotation Qualifier .. java:import:: org.springframework.orm.jdo JdoTransactionManager .. java:import:: org.springframework.stereotype Service .. java:import:: org.springframework.transaction.annotation Transactional .. java:import:: org.springframework.transaction.support TransactionCallback .. java:import:: org.springframework.transaction.support TransactionTemplate .. java:import:: javax.annotation PostConstruct .. java:import:: javax.jdo Query .. java:import:: java.util Arrays .. java:import:: java.util Collection .. java:import:: java.util HashMap .. java:import:: java.util List .. java:import:: java.util Map .. java:import:: java.util Set DefaultMotechDataService ======================== .. java:package:: org.motechproject.mds.service :noindex: .. java:type:: @Service public abstract class DefaultMotechDataService implements MotechDataService This is a basic implementation of \ :java:ref:`org.motechproject.mds.service.MotechDataService`\ . Mainly it is used as super class to create a service related with the given entity schema in \ :java:ref:`org.motechproject.mds.builder.EntityInfrastructureBuilder`\ but it can be also used by other services inside this package. :param : the type of entity schema. Methods ------- count ^^^^^ .. java:method:: @Override @Transactional public long count() :outertype: DefaultMotechDataService count ^^^^^ .. java:method:: protected long count(List properties) :outertype: DefaultMotechDataService countForFilter ^^^^^^^^^^^^^^ .. java:method:: @Override @Transactional public long countForFilter(Filter filter) :outertype: DefaultMotechDataService create ^^^^^^ .. java:method:: @Override @Transactional public T create(T object) :outertype: DefaultMotechDataService delete ^^^^^^ .. java:method:: @Override @Transactional public void delete(T object) :outertype: DefaultMotechDataService delete ^^^^^^ .. java:method:: @Override @Transactional public void delete(String primaryKeyName, Object value) :outertype: DefaultMotechDataService deleteAll ^^^^^^^^^ .. java:method:: @Override @Transactional public void deleteAll() :outertype: DefaultMotechDataService doInTransaction ^^^^^^^^^^^^^^^ .. java:method:: @Override public R doInTransaction(TransactionCallback transactionCallback) :outertype: DefaultMotechDataService executeQuery ^^^^^^^^^^^^ .. java:method:: @Override @Transactional public R executeQuery(QueryExecution queryExecution) :outertype: DefaultMotechDataService filter ^^^^^^ .. java:method:: @Override @Transactional public List filter(Filter filter) :outertype: DefaultMotechDataService filter ^^^^^^ .. java:method:: @Override @Transactional public List filter(Filter filter, QueryParams queryParams) :outertype: DefaultMotechDataService findById ^^^^^^^^ .. java:method:: @Override public T findById(Long id) :outertype: DefaultMotechDataService findTrashInstanceById ^^^^^^^^^^^^^^^^^^^^^ .. java:method:: @Override @Transactional public T findTrashInstanceById(Object instanceId, Object entityId) :outertype: DefaultMotechDataService getDetachedField ^^^^^^^^^^^^^^^^ .. java:method:: @Override @Transactional public Object getDetachedField(T instance, String fieldName) :outertype: DefaultMotechDataService getId ^^^^^ .. java:method:: protected Object getId(T instance) :outertype: DefaultMotechDataService getRepository ^^^^^^^^^^^^^ .. java:method:: protected MotechDataRepository getRepository() :outertype: DefaultMotechDataService initializeSecurityState ^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: @PostConstruct public void initializeSecurityState() :outertype: DefaultMotechDataService retrieve ^^^^^^^^ .. java:method:: @Override @Transactional public T retrieve(String primaryKeyName, Object value) :outertype: DefaultMotechDataService retrieveAll ^^^^^^^^^^^ .. java:method:: @Override @Transactional public List retrieveAll() :outertype: DefaultMotechDataService retrieveAll ^^^^^^^^^^^ .. java:method:: @Override @Transactional public List retrieveAll(QueryParams queryParams) :outertype: DefaultMotechDataService retrieveAll ^^^^^^^^^^^ .. java:method:: protected List retrieveAll(List properties) :outertype: DefaultMotechDataService retrieveAll ^^^^^^^^^^^ .. java:method:: protected List retrieveAll(List properties, QueryParams queryParams) :outertype: DefaultMotechDataService revertFromTrash ^^^^^^^^^^^^^^^ .. java:method:: @Override @Transactional public void revertFromTrash(Object newInstance, Object trash) :outertype: DefaultMotechDataService setAllEntities ^^^^^^^^^^^^^^ .. java:method:: @Autowired public void setAllEntities(AllEntities allEntities) :outertype: DefaultMotechDataService setEntityService ^^^^^^^^^^^^^^^^ .. java:method:: @Autowired public void setEntityService(EntityService entityService) :outertype: DefaultMotechDataService setHistoryService ^^^^^^^^^^^^^^^^^ .. java:method:: @Autowired public void setHistoryService(HistoryService historyService) :outertype: DefaultMotechDataService setRepository ^^^^^^^^^^^^^ .. java:method:: @Autowired public void setRepository(MotechDataRepository repository) :outertype: DefaultMotechDataService setTransactionManager ^^^^^^^^^^^^^^^^^^^^^ .. java:method:: @Autowired @Qualifier public void setTransactionManager(JdoTransactionManager transactionManager) :outertype: DefaultMotechDataService setTrashService ^^^^^^^^^^^^^^^ .. java:method:: @Autowired public void setTrashService(TrashService trashService) :outertype: DefaultMotechDataService update ^^^^^^ .. java:method:: @Override @Transactional public T update(T object) :outertype: DefaultMotechDataService validateCredentials ^^^^^^^^^^^^^^^^^^^ .. java:method:: protected InstanceSecurityRestriction validateCredentials() :outertype: DefaultMotechDataService validateCredentials ^^^^^^^^^^^^^^^^^^^ .. java:method:: protected InstanceSecurityRestriction validateCredentials(T instance) :outertype: DefaultMotechDataService