Search in sources :

Example 1 with OrganizationTypeDAO

use of com.autentia.tnt.dao.hibernate.OrganizationTypeDAO in project TNTConcept by autentia.

the class ContactPositionManagerTest method insertInitialData.

/**
 * Metodo encargado de insertar datos muy generales pero que son necesarios
 * en la gestion de contactos
 */
private void insertInitialData() {
    final ProvinceDAO provinceDAO = (ProvinceDAO) SpringUtilsForTesting.getSpringBean("daoProvince");
    final OrganizationISOCategoryDAO organizationISOCategoryDAO = (OrganizationISOCategoryDAO) SpringUtilsForTesting.getSpringBean("daoOrganizationISOCategory");
    final OrganizationTypeDAO organizationTypeDAO = (OrganizationTypeDAO) SpringUtilsForTesting.getSpringBean("daoOrganizationType");
    final OrganizationDAO organizationDAO = (OrganizationDAO) SpringUtilsForTesting.getSpringBean("daoOrganization");
    final DepartmentDAO departmentDAO = (DepartmentDAO) SpringUtilsForTesting.getSpringBean("daoDepartment");
    // provincia
    province.setName("Madrid");
    provinceDAO.insert(province);
    // categoria de la organizacion
    organizationType.setName("prospecto");
    organizationTypeDAO.insert(organizationType);
    // categoria ISO de la organizacion
    organizationISOCategory.setName("A");
    organizationISOCategoryDAO.insert(organizationISOCategory);
    // organizacion
    organization.setName("Tecnologías de España");
    organization.setProvince(province);
    organization.setType(organizationType);
    organization.setCategory(organizationISOCategory);
    organizationDAO.insert(organization);
    // departamento
    department.setName("comercial");
    department.setDescription("comercial");
    departmentDAO.insert(department);
}
Also used : OrganizationTypeDAO(com.autentia.tnt.dao.hibernate.OrganizationTypeDAO) OrganizationISOCategoryDAO(com.autentia.tnt.dao.hibernate.OrganizationISOCategoryDAO) ProvinceDAO(com.autentia.tnt.dao.hibernate.ProvinceDAO) DepartmentDAO(com.autentia.tnt.dao.hibernate.DepartmentDAO) OrganizationDAO(com.autentia.tnt.dao.hibernate.OrganizationDAO)

Example 2 with OrganizationTypeDAO

use of com.autentia.tnt.dao.hibernate.OrganizationTypeDAO in project TNTConcept by autentia.

the class OrganizationManager method getProvidersAndClients.

public List<Organization> getProvidersAndClients() {
    OrganizationTypeDAO orgTypeDao = OrganizationTypeDAO.getDefault();
    OrganizationType provider = orgTypeDao.loadById(ConfigurationUtil.getDefault().getOrganizationTypeProvider());
    OrganizationType providerCient = orgTypeDao.loadById(ConfigurationUtil.getDefault().getOrganizationTypeProviderAndClient());
    List<Organization> lista = new ArrayList<Organization>();
    List<Organization> orgs = organizationDAO.searchByOrganizationTypes(new SortCriteria("name"), provider, providerCient);
    for (Organization org : orgs) {
        lista.add(org);
    }
    return lista;
}
Also used : OrganizationTypeDAO(com.autentia.tnt.dao.hibernate.OrganizationTypeDAO) SortCriteria(com.autentia.tnt.dao.SortCriteria) Organization(com.autentia.tnt.businessobject.Organization) ArrayList(java.util.ArrayList) OrganizationType(com.autentia.tnt.businessobject.OrganizationType)

Aggregations

OrganizationTypeDAO (com.autentia.tnt.dao.hibernate.OrganizationTypeDAO)2 Organization (com.autentia.tnt.businessobject.Organization)1 OrganizationType (com.autentia.tnt.businessobject.OrganizationType)1 SortCriteria (com.autentia.tnt.dao.SortCriteria)1 DepartmentDAO (com.autentia.tnt.dao.hibernate.DepartmentDAO)1 OrganizationDAO (com.autentia.tnt.dao.hibernate.OrganizationDAO)1 OrganizationISOCategoryDAO (com.autentia.tnt.dao.hibernate.OrganizationISOCategoryDAO)1 ProvinceDAO (com.autentia.tnt.dao.hibernate.ProvinceDAO)1 ArrayList (java.util.ArrayList)1