Package beans.directory.vidal.entities.matter

Examples of beans.directory.vidal.entities.matter.Matter


    private void loadMatter() {
        //загрузка в мап уже находящихся в базе объектов
        mapMatter = new HashMap<String, Integer>();
        List matterEntityList = findEntityList(Matter.class);
        for (int i = 0; i < matterEntityList.size(); i++) {
            Matter matter = (Matter) matterEntityList.get(i);
            mapMatter.put(matter.getTitle().toUpperCase().trim(), matter.getId());
        }
        //сохранение в базу новых объектов
        Collection<String> newMatterTitles = cc.matterMap.values();
        for (Iterator<String> it = newMatterTitles.iterator(); it.hasNext();) {
            String matterTitle = it.next().toUpperCase().trim();
            //if (mapMatter.get(matterTitle) == null) {
            if (!mapMatter.containsKey(matterTitle)) {
                //Сохранение в базу и запоминание в мап
                Matter matter = new Matter();
                matter.setTitle(matterTitle);
                manager.persist(matter);
                manager.flush();
                manager.refresh(matter);
                mapMatter.put(matterTitle, matter.getId());
                //System.out.println(matter.getId() + " - " + matterTitle);
            }
        }
       
    }
View Full Code Here

TOP

Related Classes of beans.directory.vidal.entities.matter.Matter

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.