use of com.autentia.tnt.dao.hibernate.DepartmentDAO in project TNTConcept by autentia.
the class DuplicateOfferTest method insertInitialData.
/**
* Metodo encargado de insertar datos muy generales pero que son necesarios
* para generar facturas en base a ofertas
*/
private void insertInitialData() {
final OfferDAO offerDAO = (OfferDAO) SpringUtilsForTesting.getSpringBean("daoOffer");
final ProjectDAO projectDAO = (ProjectDAO) SpringUtilsForTesting.getSpringBean("daoProject");
final OrganizationDAO organizationDAO = (OrganizationDAO) SpringUtilsForTesting.getSpringBean("daoOrganization");
final ContactDAO contactDAO = (ContactDAO) SpringUtilsForTesting.getSpringBean("daoContact");
final UserDAO userDAO = (UserDAO) SpringUtilsForTesting.getSpringBean("daoUser");
final RoleDAO roleDAO = (RoleDAO) SpringUtilsForTesting.getSpringBean("daoRole");
final UserCategoryDAO categoryDAO = (UserCategoryDAO) SpringUtilsForTesting.getSpringBean("daoUserCategory");
final DepartmentDAO departmentDAO = (DepartmentDAO) SpringUtilsForTesting.getSpringBean("daoDepartment");
final WorkingAgreementDAO workingAgreementDAO = (WorkingAgreementDAO) SpringUtilsForTesting.getSpringBean("daoWorkingAgreement");
final Role role = new Role();
roleDAO.insert(role);
final Department department = new Department();
department.setName("departamento");
departmentDAO.insert(department);
final UserCategory category = new UserCategory();
categoryDAO.insert(category);
final WorkingAgreement workingAgreement = new WorkingAgreement();
workingAgreementDAO.insert(workingAgreement);
contact.setName("Sergio Hermida");
contactDAO.insert(contact);
projectDAO.insert(project);
organizationDAO.insert(organization);
user.setRole(role);
user.setCategory(category);
user.setDepartment(department);
user.setAgreement(workingAgreement);
userDAO.insert(user);
offer.setNumber(OFFER_NUMBER);
offer.setOrganization(organization);
offer.setContact(contact);
offer.setTitle(OFFER_TITLE);
offer.setDescription(OFFER_DESCRIPTION);
offer.setOfferPotential(OfferPotential.MEDIUM);
offer.setOfferState(OfferState.OPEN);
offer.setCreationDate(new Date());
offer.setMaturityDate(new Date());
offerDAO.insert(offer);
}
use of com.autentia.tnt.dao.hibernate.DepartmentDAO in project TNTConcept by autentia.
the class SpringUtilsForTesting method createDepartmentInContext.
private static Department createDepartmentInContext() {
final Department department = new Department();
final DepartmentDAO departmentDao = (DepartmentDAO) appCtx.getBean("daoDepartment");
departmentDao.insert(department);
return department;
}
use of com.autentia.tnt.dao.hibernate.DepartmentDAO in project TNTConcept by autentia.
the class SpringUtilsForTesting method deleteUserInContext.
public static void deleteUserInContext(User userInContext) {
final UserDAO userDao = (UserDAO) appCtx.getBean("daoUser");
userDao.delete(userInContext);
final UserCategoryDAO userCategoryDAO = (UserCategoryDAO) appCtx.getBean("daoUserCategory");
userCategoryDAO.delete(userInContext.getCategory());
final WorkingAgreementDAO workingAgreementDAO = (WorkingAgreementDAO) appCtx.getBean("daoWorkingAgreement");
workingAgreementDAO.delete(userInContext.getAgreement());
final RoleDAO roleDao = (RoleDAO) appCtx.getBean("daoRole");
roleDao.delete(userInContext.getRole());
final DepartmentDAO departmentDao = (DepartmentDAO) appCtx.getBean("daoDepartment");
departmentDao.delete(userInContext.getDepartment());
}
use of com.autentia.tnt.dao.hibernate.DepartmentDAO 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.DepartmentDAO in project TNTConcept by autentia.
the class OfferTest method insertInitialData.
/**
* Metodo encargado de insertar datos muy generales pero que son necesarios
* para generar facturas en base a ofertas
*/
private void insertInitialData() {
final OfferDAO offerDAO = (OfferDAO) SpringUtilsForTesting.getSpringBean("daoOffer");
final ProjectDAO projectDAO = (ProjectDAO) SpringUtilsForTesting.getSpringBean("daoProject");
final OrganizationDAO organizationDAO = (OrganizationDAO) SpringUtilsForTesting.getSpringBean("daoOrganization");
final ContactDAO contactDAO = (ContactDAO) SpringUtilsForTesting.getSpringBean("daoContact");
final UserDAO userDAO = (UserDAO) SpringUtilsForTesting.getSpringBean("daoUser");
final RoleDAO roleDAO = (RoleDAO) SpringUtilsForTesting.getSpringBean("daoRole");
final UserCategoryDAO categoryDAO = (UserCategoryDAO) SpringUtilsForTesting.getSpringBean("daoUserCategory");
final DepartmentDAO departmentDAO = (DepartmentDAO) SpringUtilsForTesting.getSpringBean("daoDepartment");
final WorkingAgreementDAO workingAgreementDAO = (WorkingAgreementDAO) SpringUtilsForTesting.getSpringBean("daoWorkingAgreement");
final Role role = new Role();
roleDAO.insert(role);
final Department department = new Department();
department.setName("departamento");
departmentDAO.insert(department);
final UserCategory category = new UserCategory();
categoryDAO.insert(category);
final WorkingAgreement workingAgreement = new WorkingAgreement();
workingAgreementDAO.insert(workingAgreement);
contact.setName("Sergio Hermida");
contactDAO.insert(contact);
projectDAO.insert(project);
organizationDAO.insert(organization);
user.setRole(role);
user.setCategory(category);
user.setDepartment(department);
user.setAgreement(workingAgreement);
userDAO.insert(user);
offer.setNumber(OFFER_NUMBER);
offer.setOrganization(organization);
offer.setContact(contact);
offer.setTitle(OFFER_TITLE);
offer.setDescription(OFFER_DESCRIPTION);
offer.setOfferPotential(OfferPotential.MEDIUM);
offer.setOfferState(OfferState.OPEN);
offer.setCreationDate(new Date());
offer.setMaturityDate(new Date());
offerDAO.insert(offer);
}
Aggregations