private ExternalCompany getClientExternalCompanySaved(String name, String nif) { ExternalCompany externalCompany = ExternalCompany.create(name, nif); externalCompany.setClient(true); externalCompanyDAO.save(externalCompany); externalCompanyDAO.flush(); sessionFactory.getCurrentSession().evict(externalCompany); externalCompany.dontPoseAsTransientObjectAnymore(); return externalCompany; }
private ExternalCompany createValidExternalCompany() { ExternalCompany externalCompany = ExternalCompany.create(UUID.randomUUID().toString(), UUID.randomUUID().toString()); externalCompanyDAO.save(externalCompany); return externalCompany; }