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);
}
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;
}
Aggregations