Package org.evolizer.core.hibernate.session.api

Examples of org.evolizer.core.hibernate.session.api.IEvolizerSession


        LOGGER.info("Starting import of project ");

        EvolizerSessionHandler handler = EvolizerSessionHandler.getHandler();
        try {
            handler.updateSchema(fProject);
            IEvolizerSession persistenceProvider = handler.getCurrentSession(fProject);
            EvolizerGitImporter importer =
                    new EvolizerGitImporter(
                            fProject.getLocation().toString(),
                            persistenceProvider,
                            fFileExtensionRegEx,
                            monitor);
            importer.importProject();
            persistenceProvider.close();
        } catch (EvolizerException e) {
            LOGGER.error("Error while importing versioning history for project " + fProject.getName(), e);
            return Status.CANCEL_STATUS;
        } catch (GitImporterException e) {
            LOGGER.error("Error while importing versioning history for project " + fProject.getName(), e);
View Full Code Here


    rev5.setCreationTime("1980/10/03 12:05:00");
    rev5.addNicknameToAuthor("mwuersch");
    rev5.setCommitMessage("mimimi");
   
    try {
      IEvolizerSession s = fSessionHandler.getCurrentSession(fDBUrl);
      s.startTransaction();
      s.saveObject(rev1);
      s.saveObject(rev2);
      s.saveObject(rev3);
      s.saveObject(rev4);
      s.saveObject(rev5);
      s.endTransaction();
   
      s.close();
    } catch (EvolizerException e) {
      fail(e.getMessage());
    }
  }
View Full Code Here

  }
 
  @Test
  public void testTransactionReconstruction1(){
    try {
      IEvolizerSession s = fSessionHandler.getCurrentSession(fDBUrl);
      TransactionReconstructor.calculateCouplings(s, 0, 0, null);
     
      List<Transaction> transactions = s.query("from Transaction as ta order by ta.started", Transaction.class);
     
      assertEquals(5, transactions.size());
     
      Transaction ta1 = transactions.get(0);
      Set<Revision> revisions = ta1.getInvolvedRevisions();
View Full Code Here

  }
 
  @Test
  public void testTransactionReconstruction2(){
    try {
      IEvolizerSession s = fSessionHandler.getCurrentSession(fDBUrl);
      TransactionReconstructor.calculateCouplings(s, 120000, 120000, null);
     
      List<Transaction> transactions = s.query("from Transaction as ta order by ta.started", Transaction.class);
     
      assertEquals(3, transactions.size());
     
      Transaction ta1 = transactions.get(0);
      Set<Revision> revisions = ta1.getInvolvedRevisions();
View Full Code Here

  }
 
  @Test
  public void testTransactionReconstruction3(){
    try {
      IEvolizerSession s = fSessionHandler.getCurrentSession(fDBUrl);
      TransactionReconstructor.calculateCouplings(s, 121000, 120000, null);
     
      List<Transaction> transactions = s.query("from Transaction as ta order by ta.started", Transaction.class);
      assertEquals(2, transactions.size());
     
      Transaction ta1 = transactions.get(0);
      Set<Revision> revisions = ta1.getInvolvedRevisions();
      assertTrue(revisions.contains(rev1));
View Full Code Here

        try {
            // initialize db connection
            IJavaProject selectedProject = selectionHandler.getSelectedProject();
            String dbUrl = initDatabaseConfiguration(selectedProject.getProject());

            IEvolizerSession session = EvolizerSessionHandler.getHandler().getCurrentSession(dbUrl);
            SnapshotAnalyzer snapshotAnalyzer = new SnapshotAnalyzer(session);
            fGraphPanel = new DAForJavaGraphPanel(new GraphLoader(snapshotAnalyzer));
            fGraphPanel.initGraphPanel();

//            site.getWorkbenchWindow().getActivePage().addPartListener(fPartListener);
View Full Code Here

    fSessionHandler = null;
  }

  private <T>T loadUniqueFromDB(String reloadQuery, Class<T> resultType) {
    try {
      IEvolizerSession s = fSessionHandler.getCurrentSession(fDBUrl);
      T result = s.uniqueResult(reloadQuery, resultType);
     
      return result;
    } catch (EvolizerException e) {
      fail(e.getMessage());
      return null;
View Full Code Here

    }
  }

  private <T>T saveAndReloadUniqueFromDB(Object object, String reloadQuery, Class<T> resultType) {
    try {
      IEvolizerSession s = fSessionHandler.getCurrentSession(fDBUrl);
      s.startTransaction();
      s.saveObject(object);
      s.endTransaction();

      s.close();

      s = fSessionHandler.getCurrentSession(fDBUrl);

      T result = s.uniqueResult(reloadQuery, resultType);
      return result;
    } catch (EvolizerException e) {
      fail(e.getMessage());
      return null;
    }
View Full Code Here

        SubMonitor progress = SubMonitor.convert(monitor, "Storing entities and associations", 100);

        try {
            // Always perform a schema update before storing the model
            progress.setTaskName("Checking database schema ...");
            IEvolizerSession session = EvolizerSessionHandler.getHandler().getCurrentSession(fDBUrl);
            if (session.isOpen()) {
                session.close();
                Properties properties = EvolizerSessionHandler.getHandler().getProperties(fDBUrl);
                EvolizerSessionHandler.getHandler().updateSchema(properties);
            }
            progress.worked(20);
            progress.setTaskName("Deleting existing models of this project ...");
View Full Code Here

    @Test
    public void addGalaxyClass() throws EvolizerException {
        showClassPlanet();

        IEvolizerSession session = EvolizerSessionHandler.getHandler().getCurrentSession(project.getProject());
        List<AbstractFamixEntity> queryResult = session.query("from FamixClass as c where c.uniqueName = 'thebigvoid.Galaxy'", AbstractFamixEntity.class, 1);

        AbstractGraphEditCommand command = new AddEntitiesCommand(
                queryResult,
                fGraphPanel.getGraphLoader(),
                fGraphPanel.getEdgeGrouper());
View Full Code Here

TOP

Related Classes of org.evolizer.core.hibernate.session.api.IEvolizerSession

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.