if (topiaId == null || "".equals(topiaId)) { if (dao.findByCode(code) != null) { throw new LogicException("error.service.transporteur.already.exists"); transporteur2 = dao.createByNaturalId(code); if (log.isDebugEnabled()) { log.debug("has created transporteur " + transporteur2.getTopiaId()); transporteur2 = dao.findByTopiaId(topiaId); if (!transporteur2.getCode().equals(code) && dao.findByCode(code) != null) { throw new LogicException("error.service.transporteur.already.exists"); dao.update(transporteur2); return transporteur2;
public void inject(ManagerInjector manager, IbuCamion camion) throws TopiaException { TransporteurDAO transporteurDAO = SandraDAOHelper.getTransporteurDAO(manager.getTransaction()); // Recherche transporteur = transporteurDAO.findByNaturalId(camion.getTransporteur()); // Création if (transporteur == null) { transporteur = transporteurDAO.createByNaturalId(camion.getTransporteur()); } } }
public void inject(ManagerInjector manager, IbuTransporteur ibuTransporteur) throws TopiaException { TransporteurDAO transporteurDAO = SandraDAOHelper.getTransporteurDAO(manager.getTransaction()); // Recherche transporteur = transporteurDAO.findByNaturalId(ibuTransporteur.getCode()); // dont create transporteur any more : #352 // Création // if (transporteur == null) { // transporteur = transporteurDAO.createByNaturalId(ibuTransporteur.getCode(), manager.getSociete()); // } if (transporteur != null) { // Mise à jour transporteur.setName(ibuTransporteur.getName()); } }
transporteur = transporteurDAO.findByTopiaId(topiaIdTransporteur);
@Override public <U extends TopiaEntity> List<U> findUsages(Class<U> type, E entity) throws TopiaException { List<?> result = new ArrayList(); List tmp; if (type == Chauffeur.class) { ChauffeurDAO dao = (ChauffeurDAO) getContext().getDAO(Chauffeur.class); tmp = dao.findAllBySociete(entity); result.addAll(tmp); } if (type == Transporteur.class) { TransporteurDAO dao = (TransporteurDAO) getContext().getDAO(Transporteur.class); tmp = dao.findAllBySociete(entity); result.addAll(tmp); } if (type == Eleveur.class) { EleveurDAO dao = (EleveurDAO) getContext().getDAO(Eleveur.class); tmp = dao.findAllBySociete(entity); result.addAll(tmp); } if (type == Camion.class) { CamionDAO dao = (CamionDAO) getContext().getDAO(Camion.class); tmp = dao.findAllBySociete(entity); result.addAll(tmp); } return (List<U>) result; }
public void inject(ManagerInjector manager, IbuTransporteur ibuTransporteur) throws TopiaException { TransporteurDAO transporteurDAO = SandraDAOHelper.getTransporteurDAO(manager.getTransaction()); // Recherche transporteur = transporteurDAO.findByNaturalId(ibuTransporteur.getCode(), manager.getSociete()); // dont create transporteur any more : #352 // Création // if (transporteur == null) { // transporteur = transporteurDAO.createByNaturalId(ibuTransporteur.getCode(), manager.getSociete()); // } if (transporteur != null) { // Mise à jour transporteur.setName(ibuTransporteur.getName()); } }
transporteur = transporteurDAO.findByTopiaId(topiaIdTransporteur);
if (topiaId == null || "".equals(topiaId)) { if (dao.findByCode(code) != null) { throw new LogicException("error.service.transporteur.already.exists"); transporteur2 = dao.createByNaturalId(code, transporteur.getSociete()); if (log.isDebugEnabled()) { log.debug("has created transporteur " + transporteur2.getTopiaId()); transporteur2 = dao.findByTopiaId(topiaId); if (!transporteur2.getCode().equals(code) && dao.findByCode(code) != null) { throw new LogicException("error.service.transporteur.already.exists"); dao.update(transporteur2); return transporteur2;
public void inject(ManagerInjector manager, IbuCamion camion) throws TopiaException { TransporteurDAO transporteurDAO = SandraDAOHelper.getTransporteurDAO(manager.getTransaction()); // Recherche transporteur = transporteurDAO.findByNaturalId(camion.getTransporteur(), manager.getSociete()); // Création if (transporteur == null) { transporteur = transporteurDAO.createByNaturalId(camion.getTransporteur(), manager.getSociete()); } } }