Package fr.soleil.salsa.entity

Examples of fr.soleil.salsa.entity.IConfig


        IDirectory root = dao.getRootDirectory();
        IConfig1D dummy = createDummyConfig1D(3, 2, 4);
        dummy.setDirectory(root);

        try {
            IConfig result = dao.saveConfig(dummy);
            if (result != null && result.getId() != null
                    && result.getDirectory().getId() == root.getId()) {
                return true;
            }
        } catch (PersistenceException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
View Full Code Here


        ConfigDAOJdbcImpl dao = new ConfigDAOJdbcImpl();
        Configuration c = dao.getConfigById(id);

        if (c != null) {
            IConfig result = (IConfig) ConfigAsXmlHelper.fromXml(c.getData());
            // result.setName(c.getName());

            result.setLoaded(true);
            result.setId(id);
            result.setTimestamp(c.getTimestamp());
            if (c.getDirectoryId() != null) {
                IDirectory parent = new DirectoryImpl();
                parent.setId(c.getDirectoryId());
                result.setDirectory(parent);
            }
            if (c.getType().equals("Config1DImpl")) {
                result.setType(IConfig.ScanType.SCAN_1D);
            }
            else if (c.getType().equals("Config2DImpl")) {
                result.setType(IConfig.ScanType.SCAN_2D);
            }
            else if (c.getType().equals("ConfigHCS")) {
                result.setType(IConfig.ScanType.SCAN_HCS);
            }
            else if (c.getType().equals("ConfigK")) {
                result.setType(IConfig.ScanType.SCAN_K);
            }
            else if (c.getType().equals("ConfigEnergy")) {
                result.setType(IConfig.ScanType.SCAN_ENERGY);
            }

            return result;
        }
        return null;
View Full Code Here

            // update
            dao.updateConfig(c);
        }

        if (c.getId() != null) {
            IConfig result = getConfigById(c.getId());
            // The timestamp is not defined by the getConfigById,
            // so we need to set his value explicitly with
            // the one provided by the save operation.
            if (result.getDirectory() != null && c.getDirectory() != null) {
                result.getDirectory().setTimestamp(c.getDirectory().getTimestamp());
            }
            return result;
        }

        return null;
View Full Code Here

TOP

Related Classes of fr.soleil.salsa.entity.IConfig

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.