Package com.evasion

Examples of com.evasion.EntityJPA


        super(file);
    }

    @Override
    protected EntityJPA traiterLigne(String[] ligne) {
        EntityJPA result = null;
        if ("A".equalsIgnoreCase(ligne[GISFormat.FC]) && DesignationCode.ADM1.equals(ligne[GISFormat.DSG]) && (ligne[GISFormat.NT].isEmpty() || "N".equalsIgnoreCase(ligne[GISFormat.NT]))) {
            result = createRegionAdm(ligne);
        } else if ("P".equalsIgnoreCase(ligne[GISFormat.FC]) && DesignationCode.PPL.startsWith(ligne[GISFormat.DSG]) && (ligne[GISFormat.NT].isEmpty() || "N".equalsIgnoreCase(ligne[GISFormat.NT]))) {
            result = createCity(ligne);
        }
View Full Code Here


   
    public abstract String separateurColumn();

    public EntityJPA next() throws EvasionException {
        try {
            EntityJPA entity = null;
            if (hasMoreElement()) {
                String[] tabLigne = nextLine.split(separateurColumn());
                if (tabLigne.length != getNbrColomnRef()) {
                    LOGGER.warn("Format de la ligne {} non valide dans le fichier ", lineNumber);
                    //return null;
View Full Code Here

                if (utx.getStatus()==Status.STATUS_MARKED_ROLLBACK) {
                    LOGGER.error("Import marqué comme rollback");
                    break;
                }
                EntityJPA entity = parser.next();
                if (entity != null) {
                    LOGGER.debug("Entity parsed: {}", entity.toString());
                    completeLocation(entity);
                   
                    if (mode== Mode.DELTE_INSERT) {
                        defaultDAO.persist(entity);
                    } else {
                        // recuperation de l'entity en base
                        Query query = defaultDAO.getEntityManager().createQuery("select l.id from "+entity.ENTITY_NAME+" where l.name=?1 and l.country=?2");
                        Long entityId =(Long) query.getSingleResult();
                       
                        entity.setId(entityId);
                        defaultDAO.merge(entity);
                    }
                    count++;
                    if (count % BATCH_SIZE == 0) {
                        em.flush();
View Full Code Here

        super(file);
    }

    @Override
    protected EntityJPA traiterLigne(String[] ligne) {
        EntityJPA result = null;
        if (DesignationCode.ADM1.equals(ligne[GeonameFormat.FEATURE_CODE])) {
            result = createRegionAdm(ligne);
        } else if (DesignationCode.PPL.startsWith(ligne[GeonameFormat.FEATURE_CODE])) {
            result = createCity(ligne);
        }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    @SuppressWarnings("unchecked")
    public EntityJPA findById(Class<? extends EntityJPA> clazz, final Object id) {
        final EntityJPA result = clazz.cast(this.em.find(clazz,id));
        LOGGER.debug("La recherche de l'entite de type {} avec l'id {} a retourne {}",
                new Object[]{clazz, id, result});
        return result;
    }
View Full Code Here

                if (utx.getStatus()==Status.STATUS_MARKED_ROLLBACK) {
                    LOGGER.error("Import marqué comme rollback");
                    break;
                }
                EntityJPA entity = parser.next();
                if (entity != null) {
                    LOGGER.debug("Entity parsed: {}", entity.toString());
                    completeLocation(entity);
                   
                    if (mode== Mode.DELETE_INSERT) {
                        defaultDAO.persist(entity);
                    } else {
                        // recuperation de l'entity en base
                        Query query = defaultDAO.getEntityManager().createQuery("select l.id from "+entity.ENTITY_NAME+" where l.name=?1 and l.country=?2");
                        Long entityId =(Long) query.getSingleResult();
                       
                        entity.setId(entityId);
                        defaultDAO.merge(entity);
                    }
                    count++;
                    if (count % BATCH_SIZE == 0) {
                        em.flush();
View Full Code Here

        super(file);
    }

    @Override
    protected EntityJPA traiterLigne(String[] ligne) {
        EntityJPA result = null;
        if (DesignationCode.ADM1.equals(ligne[GeonameFormat.FEATURE_CODE])) {
            result = createRegionAdm(ligne);
        } else if (DesignationCode.PPL.equals(ligne[GeonameFormat.FEATURE_CODE]) || DesignationCode.PPLA.equals(ligne[GeonameFormat.FEATURE_CODE])) {
            result = createCity(ligne);
        }
View Full Code Here

        super(file);
    }

    @Override
    protected EntityJPA traiterLigne(String[] ligne) {
        EntityJPA result = null;
        if ("A".equalsIgnoreCase(ligne[GISFormat.FC]) && DesignationCode.ADM1.equals(ligne[GISFormat.DSG]) && (ligne[GISFormat.NT].isEmpty() || "N".equalsIgnoreCase(ligne[GISFormat.NT]))) {
            result = createRegionAdm(ligne);
        } else if ("P".equalsIgnoreCase(ligne[GISFormat.FC]) && DesignationCode.PPL.startsWith(ligne[GISFormat.DSG]) && (ligne[GISFormat.NT].isEmpty() || "N".equalsIgnoreCase(ligne[GISFormat.NT]))) {
            result = createCity(ligne);
        }
View Full Code Here

    public abstract String separateurColumn();

    public EntityJPA next() throws EvasionException {
        try {
            EntityJPA entity = null;
            if (hasMoreElement()) {
                String[] tabLigne = nextLine.split(separateurColumn());
                if (tabLigne.length != getNbrColomnRef()) {
                    LOGGER.warn("Format de la ligne {} non valide dans le fichier ", lineNumber);
                    //return null;
View Full Code Here

TOP

Related Classes of com.evasion.EntityJPA

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.