Package beans.directory.vidal.entities

Examples of beans.directory.vidal.entities.Vidal


    private void loadVidal() {
        mapVidal = new HashMap<String, Integer>();
        List vidalEntityList = findEntityList(Vidal.class);
        for (int i = 0; i < vidalEntityList.size(); i++) {
            Vidal vidal = (Vidal) vidalEntityList.get(i);
            mapVidal.put(vidal.getTitle().toUpperCase().trim(), vidal.getId());
        }
        //сохранение в базу новых объектов
        Collection<String> newVidalTitles = cc.vidalMap.values();
        for (Iterator<String> it = newVidalTitles.iterator(); it.hasNext();) {
            String vidalTitle = it.next().toUpperCase().trim();
            if (!mapVidal.containsKey(vidalTitle)) {
                //Сохранение в базу и запоминание в мап
                Vidal vidal = new Vidal();
                vidal.setTitle(vidalTitle);
                manager.persist(vidal);
                manager.flush();
                manager.refresh(vidal);
                mapVidal.put(vidalTitle, vidal.getId());
                //System.out.println(vidal.getId() + " - " + vidalTitle);
            }
        }
    }
View Full Code Here

TOP

Related Classes of beans.directory.vidal.entities.Vidal

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.