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;
  }
Пример #2
0
 private ExternalCompany createValidExternalCompany() {
   ExternalCompany externalCompany =
       ExternalCompany.create(UUID.randomUUID().toString(), UUID.randomUUID().toString());
   externalCompanyDAO.save(externalCompany);
   return externalCompany;
 }