Example usage for java.lang Long equals

List of usage examples for java.lang Long equals

Introduction

In this page you can find the example usage for java.lang Long equals.

Prototype

public boolean equals(Object obj) 

Source Link

Document

Compares this object to the specified object.

Usage

From source file:com.gettec.fsnip.fsn.dao.product.impl.ProductDAOImpl.java

/**
 * ????(?)// www . j a va 2  s  .c  o m
 * @author ZhangHui 2015/4/14
 */
@SuppressWarnings("unchecked")
@Override
public List<ProductManageViewVO> getAllLightProductVOsByPage(int page, int pageSize, String condition,
        String condition_barnd, Long organization, Long fromBusId, boolean isDel) throws DaoException {
    try {
        if (organization == null) {
            return null;
        }

        int begin = (page - 1) * pageSize;

        if (condition == null || "".equals(condition)) {
            condition += " WHERE ";
        } else {
            condition += " AND ";
        }

        String sql = "SELECT pro.id,pro.proname,businessBrand.name,pro.format,pro.barcode,pro.cstm,pro.ingredient,pro.package_flag,"
                + "(SELECT GROUP_CONCAT(NAME) " + "FROM business_unit " + "WHERE id IN"
                + "(SELECT ftb.to_bus_id FROM t_meta_from_to_business ftb "
                + "WHERE ftb.from_bus_id = ?2 AND ftb.del = 0 AND ftb.pro_id = pro.id)" + ")AS customernames, "
                + "pro.local,pro.organization,pro.is_special_product " + "FROM "
                + "(SELECT DISTINCT product.id,product.NAME AS proname,product.FORMAT,product.barcode,product.cstm,product.ingredient,product.organization,product.business_brand_id,product.package_flag,ip.local,is_special_product "
                + "FROM product " + "LEFT JOIN t_meta_initialize_product ip "
                + "ON ip.product_id = product.id AND ip.organization = ?1 AND ip.del = 0 " + condition
                + " ip.local IS NOT NULL ORDER BY last_modify_time DESC LIMIT " + begin + "," + pageSize
                + ")AS pro " + "LEFT JOIN business_brand businessBrand "
                + "ON pro.business_brand_id = businessBrand.id " + condition_barnd;
        sql = sql + " ORDER BY pro.id desc ";
        Query query = entityManager.createNativeQuery(sql);
        query.setParameter(1, organization);
        query.setParameter(2, fromBusId);
        //         query.setParameter(3, fromBusId);
        /* ?? */
        List<Object[]> result = query.getResultList();
        List<ProductManageViewVO> vos = new ArrayList<ProductManageViewVO>();
        if (result != null) {
            for (Object[] obj : result) {
                ProductManageViewVO vo = new ProductManageViewVO(((BigInteger) obj[0]).longValue(),
                        obj[1] == null ? "" : obj[1].toString(), obj[2] == null ? "" : obj[2].toString(),
                        obj[3] == null ? "" : obj[3].toString(), obj[4] == null ? "" : obj[4].toString(),
                        obj[5] == null ? "" : obj[5].toString(), obj[6] == null ? "" : obj[6].toString(),
                        obj[7] == null ? "" : obj[7].toString(), obj[8] == null ? "" : obj[8].toString(),
                        obj[9] == null ? "" : obj[9].toString(),
                        obj[11].toString().equals("true") ? true : false);
                Long org = obj[10] == null ? null : ((BigInteger) obj[10]).longValue();
                if ("false".equals(vo.getLocal()) && org != null && org.equals(organization)) {
                    vo.setLocal("true");
                }
                vo.setNutriStatus('0');
                vos.add(vo);
            }
        }
        return vos;
    } catch (Exception e) {
        throw new DaoException("ProductDAOImpl.getAllLightProductVOsByPage() ?", e);
    }
}

From source file:es.caib.seycon.ng.servei.PuntEntradaServiceImpl.java

private boolean isOrigenAncestorDesti(Long origenId, Long destiId) {

    if (origenId.equals(destiId))
        return true;
    List<ArbrePuntEntradaEntity> paresDesti = getArbrePuntEntradaEntityDao().findByFill(destiId);

    if (paresDesti != null) {
        for (Iterator<ArbrePuntEntradaEntity> it = paresDesti.iterator(); it.hasNext();) {
            ArbrePuntEntradaEntity arbreDesti = it.next();
            Long p = arbreDesti.getPare().getId();
            return isOrigenAncestorDesti(origenId, p);
        }/* w w  w .j  a  v a2s .co  m*/
    } else
        return false; // Ok, no tiene padre

    return false; // no deberamos llegar aqu
}

From source file:org.alfresco.repo.domain.permissions.AclDAOImpl.java

private Long getCopy(Long toCopy, Long toInheritFrom, ACLCopyMode mode) {
    AclUpdateEntity aclToCopy;//from w ww .  j  a v  a2  s  .  com
    Long inheritedId;
    Acl aclToInheritFrom;
    switch (mode) {
    case INHERIT:
        if (toCopy.equals(toInheritFrom)) {
            return getInheritedAccessControlList(toCopy);
        } else {
            throw new UnsupportedOperationException();
        }
    case COW:
        aclToCopy = aclCrudDAO.getAclForUpdate(toCopy);
        aclToCopy.setRequiresVersion(true);
        aclToCopy.setAclChangeSetId(getCurrentChangeSetId());
        aclCrudDAO.updateAcl(aclToCopy);
        inheritedId = getInheritedAccessControlList(toCopy);
        if ((inheritedId != null) && (!inheritedId.equals(toCopy))) {
            AclUpdateEntity inheritedAcl = aclCrudDAO.getAclForUpdate(inheritedId);
            inheritedAcl.setRequiresVersion(true);
            inheritedAcl.setAclChangeSetId(getCurrentChangeSetId());
            aclCrudDAO.updateAcl(inheritedAcl);
        }
        return toCopy;
    case REDIRECT:
        if ((toInheritFrom != null) && (toInheritFrom.equals(toCopy))) {
            return getInheritedAccessControlList(toInheritFrom);
        }
        aclToCopy = aclCrudDAO.getAclForUpdate(toCopy);
        aclToInheritFrom = null;
        if (toInheritFrom != null) {
            aclToInheritFrom = aclCrudDAO.getAcl(toInheritFrom);
        }

        switch (aclToCopy.getAclType()) {
        case DEFINING:
            // This is not called on the redirecting node as only LAYERED change permissions when redirected
            // So this needs to make a copy in the same way layered does
        case LAYERED:
            if (toInheritFrom == null) {
                return toCopy;
            }
            // manages cache clearing beneath
            List<AclChange> changes = mergeInheritedAccessControlList(toInheritFrom, toCopy);
            for (AclChange change : changes) {
                if (change.getBefore().equals(toCopy)) {
                    return change.getAfter();
                }
            }
            throw new UnsupportedOperationException();
        case SHARED:
            if (aclToInheritFrom != null) {
                return getInheritedAccessControlList(toInheritFrom);
            } else {
                throw new UnsupportedOperationException();
            }
        case FIXED:
        case GLOBAL:
        case OLD:
            return toCopy;
        default:
            throw new UnsupportedOperationException();
        }
    case COPY:
        aclToCopy = aclCrudDAO.getAclForUpdate(toCopy);
        aclToInheritFrom = null;
        if (toInheritFrom != null) {
            aclToInheritFrom = aclCrudDAO.getAcl(toInheritFrom);
        }

        switch (aclToCopy.getAclType()) {
        case DEFINING:
            SimpleAccessControlListProperties properties = new SimpleAccessControlListProperties();
            properties.setAclType(ACLType.DEFINING);
            properties.setInherits(aclToCopy.getInherits());
            properties.setVersioned(true);

            Long id = createAccessControlList(properties).getId();

            AccessControlList indirectAcl = getAccessControlList(toCopy);
            for (AccessControlEntry entry : indirectAcl.getEntries()) {
                if (entry.getPosition() == 0) {
                    setAccessControlEntry(id, entry);
                }
            }
            if (aclToInheritFrom != null) {
                mergeInheritedAccessControlList(toInheritFrom, id);
            }
            return id;
        case SHARED:
            if (aclToInheritFrom != null) {
                return getInheritedAccessControlList(toInheritFrom);
            } else {
                return null;
            }
        case FIXED:
        case GLOBAL:
        case LAYERED:
        case OLD:
            return toCopy;
        default:
            throw new UnsupportedOperationException();
        }
    default:
        throw new UnsupportedOperationException();
    }
}

From source file:data.services.ParseBaseService.java

private void updateFeatures() throws SQLException, ClassNotFoundException {
    List<Feature> featuresForSaveList = new ArrayList();
    List<Feature> featuresForUpdateList = new ArrayList();
    List<Feature> featureList = featureDao.getAllAsc();
    List<Long> actualQutoIdList = new ArrayList();
    HashMap<Long, Feature> ourOldIdFeatureMap = new HashMap();
    for (Feature m : featureList) {
        ourOldIdFeatureMap.put(m.getOldId(), m);
    }//from w  w  w.j a v  a  2 s .c o m
    ResultSet resSet = getFromQutoBase(getSelectAll(QUTO_FEATURE_TABLE));

    while (resSet.next()) {
        Long qutoId = resSet.getLong("id");
        actualQutoIdList.add(qutoId);

        String desc = StringAdapter.getString(resSet.getString("description")).trim();
        String title = StringAdapter.getString(resSet.getString("title")).trim();
        Long mediaId = resSet.getLong("media_id");
        Long cmgId = resSet.getLong("car_model_generation_id");
        Long ccoId = resSet.getLong("car_completion_option_id");

        if (!ourOldIdFeatureMap.keySet().contains(qutoId)) {
            Feature f = new Feature();
            f.setOldId(qutoId);
            f.setDescription(desc);
            f.setTitle(title);
            f.setCcoId(ccoId);
            f.setCmgId(cmgId);
            f.setMediaId(mediaId);

            if (validate(f, "TroubleQutoId=" + f.getOldId() + "; ")) {
                featuresForSaveList.add(f);
            }
        } else {
            Feature f = ourOldIdFeatureMap.get(qutoId);
            if (!title.equals(f.getTitle()) || !cmgId.equals(f.getCmgId()) || !ccoId.equals(f.getCcoId())
                    || !mediaId.equals(f.getMediaId()) || !desc.equals(f.getDescription())) {
                f.setOldId(qutoId);
                f.setDescription(desc);
                f.setTitle(title);
                f.setCcoId(ccoId);
                f.setCmgId(cmgId);
                f.setMediaId(mediaId);
                if (validate(f, "TroubleQutoId=" + f.getOldId() + "; ")) {
                    featuresForUpdateList.add(f);
                }
            }
        }
    }
    int s = 0;
    int u = 0;
    int d = 0;
    for (Feature f : featuresForSaveList) {
        featureDao.save(f);
        s++;
    }
    for (Feature f : featuresForUpdateList) {
        featureDao.update(f);
        u++;
    }
    for (Long qutoId : ourOldIdFeatureMap.keySet()) {
        if (!actualQutoIdList.contains(qutoId)) {
            d++;
            featureDao.delete(ourOldIdFeatureMap.get(qutoId));
        }
    }

    addError("??: " + s + " ? ?, " + u
            + " , " + d + " .");
}

From source file:controllers.core.PortfolioEntryDeliveryController.java

/**
 * Process the form to follow a deliverable from another portfolio entry.
 *///from   w ww .j a v  a  2s.  c o m
@With(CheckPortfolioEntryExists.class)
@Dynamic(IMafConstants.PORTFOLIO_ENTRY_EDIT_DYNAMIC_PERMISSION)
public Result processFollowDeliverable() {

    // bind the form
    Form<FollowDeliverableFormData> boundForm = followDeliverableFormTemplate.bindFromRequest();

    // get the portfolioEntry
    Long id = Long.valueOf(boundForm.data().get("id"));
    PortfolioEntry portfolioEntry = PortfolioEntryDao.getPEById(id);

    if (boundForm.hasErrors()) {
        return ok(views.html.core.portfolioentrydelivery.deliverable_follow.render(portfolioEntry, boundForm));
    }

    FollowDeliverableFormData followDeliverableFormData = boundForm.get();

    if (!PortfolioEntryDynamicHelper.isPortfolioEntryViewAllowed(followDeliverableFormData.otherPortfolioEntry,
            this.getSecurityService())) {
        return forbidden(views.html.error.access_forbidden.render(""));
    }

    if (id.equals(followDeliverableFormData.otherPortfolioEntry)) {
        boundForm.reject("otherPortfolioEntry",
                Msg.get("core.portfolio_entry_delivery.deliverable.follow.error.same_portfolio_entry"));
        return ok(views.html.core.portfolioentrydelivery.deliverable_follow.render(portfolioEntry, boundForm));
    }

    if (DeliverableDAO.getPortfolioEntryDeliverableById(id,
            followDeliverableFormData.otherDeliverable) != null) {
        boundForm.reject("otherDeliverable",
                Msg.get("core.portfolio_entry_delivery.deliverable.follow.error.already_assigned"));
        return ok(views.html.core.portfolioentrydelivery.deliverable_follow.render(portfolioEntry, boundForm));
    }

    Deliverable deliverable = DeliverableDAO.getDeliverableById(followDeliverableFormData.otherDeliverable);
    PortfolioEntryDeliverable portfolioEntryDeliverable = new PortfolioEntryDeliverable(portfolioEntry,
            deliverable);
    portfolioEntryDeliverable.type = PortfolioEntryDeliverable.Type.FOLLOWER;
    portfolioEntryDeliverable.save();

    Utilities.sendSuccessFlashMessage(Msg.get("core.portfolio_entry_delivery.deliverable.follow.successful"));

    return redirect(controllers.core.routes.PortfolioEntryDeliveryController.deliverables(portfolioEntry.id));

}

From source file:com.square.adherent.noyau.service.implementations.AdherentServiceImpl.java

@Override
public com.square.adherent.noyau.dto.adherent.PersonneDto getPersonneById(Long idPersonne) {
    final PersonneDto personneSquare = personnePhysiqueService.rechercherPersonneParIdentifiant(idPersonne);

    if (personneSquare != null) {
        final com.square.adherent.noyau.dto.adherent.PersonneDto personneEcm = mapperDozerBean
                .map(personneSquare, com.square.adherent.noyau.dto.adherent.PersonneDto.class);
        // Rcupration des informations supplmentaires ncessaires
        final Long idNatureEmailPersonnel = squareMappingService.getIdNatureEmailPersonnel();
        final Long idTelephoneFixe = squareMappingService.getIdNatureTelephoneFixe();
        // Rcupration des coordonnes
        final CoordonneesDto coordonnees = personneService
                .rechercherCoordonneesParIdPersonne(personneSquare.getIdentifiant());
        if (coordonnees != null) {
            if (coordonnees.getEmails() != null && coordonnees.getEmails().size() > 0) {
                // Email
                for (EmailDto email : coordonnees.getEmails()) {
                    if (email.getNatureEmail() != null
                            && idNatureEmailPersonnel.equals(email.getNatureEmail().getIdentifiant())) {
                        personneEcm.setAdresseEmail(email.getAdresse());
                        break;
                    }/*from   w w  w  .j  a  v  a2  s.  co m*/
                }

                // Tlphone
                for (TelephoneDto telephone : coordonnees.getTelephones()) {
                    if (telephone.getNature() != null
                            && idTelephoneFixe.equals(telephone.getNature().getIdentifiant())) {
                        personneEcm.setNumeroTelephoneFixe(telephone.getNumero());
                        break;
                    }
                }

                // Adresse
                for (AdresseDto adresse : coordonnees.getAdresses()) {
                    if (adresse.getNature() != null
                            && idTelephoneFixe.equals(adresse.getNature().getIdentifiant())) {
                        final com.square.adherent.noyau.dto.adherent.AdresseDto adressePrincipale = mapperDozerBean
                                .map(adresse, com.square.adherent.noyau.dto.adherent.AdresseDto.class);
                        personneEcm.setAdressePrincipale(adressePrincipale);
                        break;
                    }
                }
            }
        }
        return personneEcm;
    }
    return null;
}

From source file:com.ylife.shoppingcart.service.impl.ShoppingCartServiceImpl.java

/**
 * ???? list?,?/*from w ww .jav a2  s.  c  om*/
 *
 * @param cartList
 * @return
 * @author jiaodongzhi
 */
@Override
public List<ShoppingCart> getNobaoyouShoppingcarts(List<ShoppingCart> cartList) {
    // ???
    List<ShoppingCart> nobaoyou = new ArrayList<>();
    Marketing marketing = null;
    if (CollectionUtils.isNotEmpty(cartList)) {
        Map<String, Object> map = new HashMap<>();
        // ?,?
        List<ShoppingCart> baoyou = new ArrayList<>();
        for (int i = 0; i < cartList.size(); i++) {
            if (cartList.get(i) != null && cartList.get(i).getGoodsInfoId() != null) {
                // ?id,??,?()?;
                map.put(GOODSID, cartList.get(i).getGoodsInfoId());
                map.put("codeType", "12");
                marketing = marketingMapper.queryMarketingByGoodIdAndtype(map);
                // 
                if (null != marketing) {
                    cartList.get(i).setMarketing(marketing);
                    baoyou.add(cartList.get(i));
                } else {
                    // ?
                    nobaoyou.add(cartList.get(i));
                }

            }
        }
        // id
        Map<Long, String> groups = new HashMap<Long, String>();
        // ? boss?id0
        List<List<ShoppingCart>> shopThirdList = new ArrayList<>();
        Long thirdId = null;
        if (CollectionUtils.isNotEmpty(baoyou)) {
            for (ShoppingCart pd : baoyou) {
                thirdId = pd.getThirdId();
                groups.put(thirdId, "");
            }
            List<ShoppingCart> scart = null;
            if (groups != null && !groups.isEmpty()) {
                for (Long rawTypeId : groups.keySet()) {
                    scart = new ArrayList<>();
                    for (ShoppingCart sc : baoyou) {

                        if (rawTypeId.equals(sc.getThirdId())) {
                            // ?thirdId
                            scart.add(sc);
                        }
                    }
                    shopThirdList.add(scart);
                }
            }
            BigDecimal aftermoney = BigDecimal.valueOf(0);
            Long countgoods = 0L;
            List<ShoppingCart> shop = new ArrayList<>();
            for (int m = 0; m < shopThirdList.size(); m++) {
                // third?
                baoyou = shopThirdList.get(m);
                ShoppingCart sc = new ShoppingCart();
                for (int j = 0; j < baoyou.size(); j++) {
                    GoodsProduct goodsProduct = goodsProductMapper
                            .queryByGoodsInfoDetail(baoyou.get(j).getGoodsInfoId());
                    BigDecimal goodsMoney = goodsProduct.getGoodsInfoPreferPrice();
                    Map<String, Object> mapGoods = new HashMap<String, Object>();
                    // id??,?()?;
                    Marketing mark = marketingMapper.marketingDetail(baoyou.get(j).getMarketingId());
                    // ?
                    if (null != mark) {
                        mapGoods.put(MARKETINGID, mark.getMarketingId());
                        mapGoods.put(GOODSID, baoyou.get(j).getGoodsInfoId());
                    }

                    countgoods = baoyou.get(j).getGoodsNum();
                    // ?
                    aftermoney = aftermoney.add(goodsMoney.multiply(BigDecimal.valueOf(countgoods)));
                    sc.setMarketgoodsPrice(aftermoney);
                    sc.setThirdId(baoyou.get(j).getThirdId());
                    shop.add(sc);
                }
                // ?

                // Map<String, Object> app = new HashMap<>();
                for (int k = 0; k < baoyou.size(); k++) {
                    // ???
                    for (ShoppingCart scra : shop) {
                        if (scra.getThirdId().equals(baoyou.get(k).getThirdId()) && scra.getMarketgoodsPrice()
                                .compareTo(baoyou.get(k).getMarketing().getShippingMoney()) == -1) {

                            // ??
                            nobaoyou.add(baoyou.get(k));
                        }
                    }
                }

            }

        }
    }
    return nobaoyou;

}

From source file:jp.co.opentone.bsol.linkbinder.service.correspon.impl.CorresponWorkflowServiceImpl.java

/**
 * workflows????Checker???????true?./*  w w w.  ja v a 2s . co  m*/
 * @param workflows
 *   ??.???????????Service???????.
 * @return Checker??????true
 */
private boolean isCheckerAdded(List<Workflow> workflows) {
    final Long newId = 0L;
    for (Workflow w : workflows) {
        log.debug("  {}.{}-{} {}",
                new Object[] { w.getWorkflowNo(), w.getId(), w.getUser().getEmpNo(), w.getWorkflowType() });
        //  id?Checker?????
        if (WorkflowType.CHECKER == w.getWorkflowType() && (w.getId() == null || newId.equals(w.getId()))) {
            return true;
        }
    }
    return false;
}

From source file:org.geosdi.geoplatform.experimental.connector.core.OAuth2ProjectTest.java

@Test
public void testSecureUpdateAccountsProjectSharingManage() throws Exception {
    // Insert a User to which the Project is shared as viewer
    Long firstUserID = this.createAndInsertUser("first_to_share_oauth2_project", organizationTest, GPRole.USER);
    Long latterUserID = this.createAndInsertUser("latter_to_share_oauth2_project", organizationTest,
            GPRole.VIEWER);//from   w  ww. jav a2  s.  com
    GPUser newUser = oauth2CoreClientConnector.getUserDetail(firstUserID);
    this.createAndInsertAccountProject(newUser, projectTest, BasePermission.READ);

    // Set the Project as share
    projectTest.setShared(true);
    oauth2CoreClientConnector.updateProject(projectTest);

    // Initial test
    GPProject project = oauth2CoreClientConnector.getProjectDetail(idProjectTest);
    Assert.assertTrue(project.isShared());

    List<ShortAccountDTO> accountsToShare = oauth2CoreClientConnector.getAccountsByProjectID(idProjectTest)
            .getAccounts();
    Assert.assertNotNull(accountsToShare);
    Assert.assertEquals(2, accountsToShare.size());
    Assert.assertEquals(2, accountsToShare.size());
    boolean checkFirst = false;
    for (ShortAccountDTO accountDTO : accountsToShare) {
        if (firstUserID.equals(accountDTO.getId())) {
            checkFirst = true;
            break;
        }
    }
    Assert.assertTrue(checkFirst);

    // Test add latter user for sharing
    boolean result = oauth2CoreClientConnector.updateAccountsProjectSharing(
            new PutAccountsProjectRequest(idProjectTest, Arrays.asList(idUserTest, firstUserID, latterUserID)));
    Assert.assertTrue(result);

    project = oauth2CoreClientConnector.getProjectDetail(idProjectTest);
    Assert.assertTrue(project.isShared());

    accountsToShare = oauth2CoreClientConnector.getAccountsByProjectID(idProjectTest).getAccounts();
    Assert.assertNotNull(accountsToShare);
    Assert.assertEquals(3, accountsToShare.size());
    checkFirst = false;
    boolean checkLatter = false;
    for (ShortAccountDTO accountDTO : accountsToShare) {
        if (firstUserID.equals(accountDTO.getId())) {
            checkFirst = true;
        }
        if (latterUserID.equals(accountDTO.getId())) {
            checkLatter = true;
        }
    }
    Assert.assertTrue(checkFirst);
    Assert.assertTrue(checkLatter);

    // Test delete first user for sharing
    result = oauth2CoreClientConnector.updateAccountsProjectSharing(
            new PutAccountsProjectRequest(idProjectTest, Arrays.asList(idUserTest, latterUserID)));
    Assert.assertTrue(result);

    project = oauth2CoreClientConnector.getProjectDetail(idProjectTest);
    Assert.assertTrue(project.isShared());

    accountsToShare = oauth2CoreClientConnector.getAccountsByProjectID(idProjectTest).getAccounts();
    Assert.assertNotNull(accountsToShare);
    Assert.assertEquals(2, accountsToShare.size());
    checkLatter = false;
    for (ShortAccountDTO accountDTO : accountsToShare) {
        if (latterUserID.equals(accountDTO.getId())) {
            checkLatter = true;
            break;
        }
    }
    Assert.assertTrue(checkLatter);
}

From source file:es.caib.seycon.ng.servei.PuntEntradaServiceImpl.java

protected boolean handleCopiaPuntEntrada(PuntEntrada puntEntradaCopiar, PuntEntrada puntEntradaMenuDesti)
        throws Exception {
    // 1) Verifiquem que el dest siga de tipus men
    if (!"S".equals(puntEntradaMenuDesti.getMenu())) //$NON-NLS-1$
        throw new SeyconException(Messages.getString("PuntEntradaServiceImpl.EntryPointTypeError")); //$NON-NLS-1$

    // 2) Verifiquem autoritzacions: origen, desti i pare del dest
    Long idParePuntEntradaClonar = puntEntradaCopiar.getIdPare();
    Long idPueOrigen = puntEntradaCopiar.getId();
    Long idPueDesti = puntEntradaMenuDesti.getId();
    Long idParePuntEntradaDesti = (!idPueDesti.equals(ROOT_ID)) ? puntEntradaMenuDesti.getIdPare() : ROOT_ID;
    if (idPueOrigen == null || idParePuntEntradaClonar == null || idPueDesti == null
            || idParePuntEntradaDesti == null)
        throw new SeyconException(Messages.getString("PuntEntradaServiceImpl.CopyEntryPointConfirmChanges")); //$NON-NLS-1$

    // Analitzem l'arbre dels pares del node dest per verificar que no es
    // mou//from ww  w  . j  a v a2s.c  om
    // un node origen dintre de la seua branca
    if (isOrigenAncestorDesti(idPueOrigen, idPueDesti))
        throw new SeyconException(Messages.getString("PuntEntradaServiceImpl.NodeCopyError")); //$NON-NLS-1$

    // Obtenim l'entitat a clonar
    PuntEntradaEntity pueClonar = getPuntEntradaEntityDao().puntEntradaToEntity(puntEntradaCopiar);
    // Fem una cpia (iconas, autoritzacions, execucions, fills)
    PuntEntradaEntity nouPUEClonat = clonaPuntEntrada(pueClonar);

    // Hem d'afegir el nou fill clonat al pue dest
    String ordre = "0"; //$NON-NLS-1$
    Collection fillsDesti = getArbrePuntEntradaEntityDao().findByPare(idPueDesti);
    if (fillsDesti != null) {// Ens quedem en el fill de major ordre
        if (fillsDesti.size() == 0) // Para nodes men sense fills
            ordre = "0"; //$NON-NLS-1$
        else { // Obtenim el seu fill "major" (de tipus List i estan
               // ordenats per query en ordre ascendent)
            ArbrePuntEntradaEntity fill = (ArbrePuntEntradaEntity) ((List) fillsDesti)
                    .get(fillsDesti.size() - 1);
            int ordreFillMajor = fill.getOrdre(); //Integer.parseInt(fill.getOrdre());
            ordre = "" + (ordreFillMajor + 1); //$NON-NLS-1$
        }
    }
    // Obtenim el pare
    PuntEntradaEntity pueDesti = getPuntEntradaEntityDao().findById(idPueDesti);
    Collection<ArbrePuntEntradaEntity> fillsNouPare = pueDesti.getArbrePuntEntradaSocPare();

    ArbrePuntEntradaEntity nouArbre = getArbrePuntEntradaEntityDao().newArbrePuntEntradaEntity();
    nouArbre.setFill(nouPUEClonat);
    nouArbre.setOrdre(Integer.parseInt(ordre)); //nouArbre.setOrdre(ordre);
    nouArbre.setPare(pueDesti);
    getArbrePuntEntradaEntityDao().create(nouArbre);
    fillsNouPare.add(nouArbre);
    pueDesti.setArbrePuntEntradaSocPare(fillsNouPare);
    // Actualitzem el pare (hem modificat el seu arbre)
    getPuntEntradaEntityDao().update(pueDesti);

    return true;
}