Examples of VersionDao


Examples of com.darkhonor.rage.libs.dataaccess.VersionDAO

            if (emf.isOpen())
            {
                // Verify the Application version is compatible with the database
                EntityManager em = emf.createEntityManager();
                LOGGER.debug("Comparing the version of the database to the App");
                VersionDAO versionDAO = new VersionDAO(em);
                if (versionDAO.checkDbVersion(version))
                {
                    try
                    {
                        LOGGER.debug("Creating EntifyManagerFactory");
                        LOGGER.debug("EntityManagerFactory created.  Starting threads");
View Full Code Here

Examples of com.darkhonor.rage.libs.dataaccess.VersionDAO

    private void checkVersion(boolean createSchema)
    {
        try
        {
            LOGGER.debug("(checkVersion) Creating VersionDAO object");
            VersionDAO versionDAO = new VersionDAO(emf.createEntityManager());
            LOGGER.debug("(checkVersion) VersionDAO object created");
            // If this is a new install and the option to create the database
            // schema is set, do so here
            if (createSchema)
            {
                // Insert the version number in the database
                LOGGER.debug("We created schema...Version stored on connect");
                versionDAO.create(version);
//                    EntityTransaction tx = em.getTransaction();
//                    tx.begin();
//                    em.persist(version);
//                    tx.commit();
            } else
            {
                LOGGER.debug("Schema not created.");
            }
            if (versionDAO.checkDbVersion(version))
            {
                LOGGER.debug("(checkVersion) Database version matches "
                        + "application version.");
            } else
            {
                LOGGER.error("(checkVersion) Database version does not match. "
                        + "Exiting program.");
                JOptionPane.showMessageDialog(this, "ERROR: This version of "
                        + "JTestGen is not compatible with the RAGE database. "
                        + "Exiting program.",
                        "ERROR", JOptionPane.ERROR_MESSAGE);
                exitMenuItemActionPerformed(null);
            }
            LOGGER.debug("(checkVersion) Closing VersionDAO connection");
            versionDAO.closeConnection();
        } catch (IllegalStateException ex)
        {
            LOGGER.warn("(checkVersion) Problem connecting to the database "
                    + "with the VersionDAO object");
        }
View Full Code Here

Examples of com.darkhonor.rage.libs.dataaccess.VersionDAO

            if (emf.isOpen())
            {
                // Verify the Application version is compatible with the database
                EntityManager em = emf.createEntityManager();
                LOGGER.debug("Comparing the version of the database to the App");
                VersionDAO versionDAO = new VersionDAO(em);
                if (versionDAO.checkDbVersion(version))
                {
                    try
                    {
                        int i = 1;
                        ServerSocket srv_sock = new ServerSocket(port);
View Full Code Here

Examples of com.darkhonor.rage.libs.dataaccess.VersionDAO

    private void checkVersion()
    {
        try
        {
            LOGGER.debug("(checkVersion) Creating VersionDAO object");
            VersionDAO versionDAO = new VersionDAO(emf.createEntityManager());
            LOGGER.debug("(checkVersion) VersionDAO object created");
            if (versionDAO.checkDbVersion(version))
            {
                LOGGER.debug("(checkVersion) Database version matches "
                        + "application version.");
            } else
            {
                LOGGER.error("(checkVersion) Database version does not match. "
                        + "Exiting program.");
                JOptionPane.showMessageDialog(CourseGraderApp.getApplication()
                        .getMainFrame(),
                        "ERROR: This version of CourseGrader is "
                        + "not compatible with the RAGE database. Exiting program.",
                        "ERROR", JOptionPane.ERROR_MESSAGE);
                this.exitApplication();
            }
            LOGGER.debug("(checkVersion) Closing VersionDAO connection");
            versionDAO.closeConnection();
        } catch (IllegalStateException ex)
        {
            LOGGER.warn("(checkVersion) Problem connecting to the database "
                    + "with the VersionDAO object");
        }
View Full Code Here

Examples of com.darkhonor.rage.libs.dataaccess.VersionDAO

        {
            LOGGER.error("Illegal Argument: EntityManager is null");
            throw new IllegalArgumentException("EntityManager is null");
        } else
        {
            VersionDAO versionDAO = new VersionDAO(em);
            try
            {
                boolean result = versionDAO.checkDbVersion(appVersion);
                versionDAO.closeConnection();
                return result;
            }
            catch (IllegalStateException ex)
            {
                LOGGER.error("Illegal Database State.  EntityManager is closed");
View Full Code Here

Examples of com.darkhonor.rage.libs.dataaccess.VersionDAO

    private void checkVersion(boolean createSchema)
    {
        try
        {
            LOGGER.debug("(checkVersion) Creating VersionDAO object");
            VersionDAO versionDAO = new VersionDAO(emf.createEntityManager());
            LOGGER.debug("(checkVersion) VersionDAO object created");
            // If this is a new install and the option to create the database
            // schema is set, do so here
            if (createSchema)
            {
                // Insert the version number in the database
                LOGGER.debug("(checkVersion) We created schema...Version stored "
                        + "on connect");
                versionDAO.create(version);
            } else
            {
                LOGGER.debug("(checkVersion) Schema not created.");
            }
            if (versionDAO.checkDbVersion(version))
            {
                LOGGER.debug("(checkVersion) Database version matches "
                        + "application version.");
            } else
            {
                LOGGER.error("(checkVersion) Database version does not match. "
                        + "Exiting program.");
                JOptionPane.showMessageDialog(JCourseManagementApp.getApplication()
                        .getMainFrame(), "ERROR: This version of "
                        + "JCourseManagements is not compatible with the RAGE "
                        + "database. Exiting program.",
                        "ERROR", JOptionPane.ERROR_MESSAGE);
                exitApplication();
            }
            LOGGER.debug("(checkVersion) Closing VersionDAO connection");
            versionDAO.closeConnection();
        } catch (IllegalStateException ex)
        {
            LOGGER.warn("(checkVersion) Problem connecting to the database "
                    + "with the VersionDAO object");
        }
View Full Code Here

Examples of org.criticalfailure.torchlight.core.model.dao.VersionDao

                    }
                    logger.debug("version: " + version);

                    // save version
                    if(version != null) {
                        VersionDao versionDao = (VersionDao)ServiceUtils.getService(bundleContext, VersionDao.class.getName());
                        logger.trace("versionDao: " + versionDao);

                        versionDao.saveVersion(version);
                    }
                }
                catch(Exception e) {
                    MessageDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), Messages.getString("campaign.error.create_version.title"), Messages.getString("campaign.error.create_version.message") + "\n\n" + e.getLocalizedMessage());
                }
View Full Code Here

Examples of org.criticalfailure.torchlight.core.model.dao.VersionDao

            label.setText(Messages.getString("campaign.editor.version.label"));
            label.setLayoutData(new GridData(SWT.END, SWT.CENTER, false, false));

            version = new Combo(generalGroup, SWT.DROP_DOWN | SWT.READ_ONLY);
            version.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
            VersionDao versionDao = (VersionDao)ServiceUtils.getService(bundleContext, VersionDao.class.getName());
            try {
              int i = 0;
             
                for(Version v : versionDao.getVersions()) {
                    version.add(v.getLabel());
                    version.setData(v.getLabel(), v);
                    version.setData("version" + i, v);
                   
                    if(campaign.getVersion() == v) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.