Package org.jboss.forge.addon.javaee.jpa

Examples of org.jboss.forge.addon.javaee.jpa.JPADataSource


      });
   }

   private JPADataSource getDataSource(UIContext context)
   {
      JPADataSource dataSource = new JPADataSource();
      dataSource.setDatabase(dbType.getValue());
      dataSource.setJndiDataSource(dataSourceName.getValue());
      dataSource.setDatabaseURL(databaseURL.getValue());
      dataSource.setUsername(username.getValue());
      dataSource.setPassword(password.getValue());
      Map<Object, Object> attributeMap = context.getAttributeMap();
      dataSource.setProvider((PersistenceProvider) attributeMap.get(PersistenceProvider.class));
      dataSource.setContainer((PersistenceContainer) attributeMap.get(PersistenceContainer.class));
      return dataSource;
   }
View Full Code Here


   @Override
   public void validate(UIValidationContext validator)
   {
      UIContext uiContext = validator.getUIContext();
      JPADataSource ds = getDataSource(uiContext);
      try
      {
         ds.validate();
      }
      catch (Exception e)
      {
         validator.addValidationError(null, e.getMessage());
      }
View Full Code Here

   @Override
   public Result execute(UIExecutionContext context) throws Exception
   {
      UIContext uiContext = context.getUIContext();
      Project project = getSelectedProject(uiContext);
      JPADataSource dataSource = getDataSource(uiContext);
      Boolean configureMetadata = (Boolean) uiContext.getAttributeMap().get("ConfigureMetadata");
      String puName = persistenceUnitName.getValue();
      persistenceOperations.setup(puName, project, dataSource, configureMetadata);
      return Results.success("Persistence (JPA) is installed.");
View Full Code Here

      });
   }

   private JPADataSource getDataSource(UIContext context)
   {
      JPADataSource dataSource = new JPADataSource();
      dataSource.setDatabase(dbType.getValue());
      dataSource.setJndiDataSource(dataSourceName.getValue());
      dataSource.setDatabaseURL(databaseURL.getValue());
      dataSource.setUsername(username.getValue());
      dataSource.setPassword(password.getValue());
      Map<Object, Object> attributeMap = context.getAttributeMap();
      dataSource.setProvider((PersistenceProvider) attributeMap.get(PersistenceProvider.class));
      dataSource.setContainer((PersistenceContainer) attributeMap.get(PersistenceContainer.class));
      return dataSource;
   }
View Full Code Here

   @Override
   public void validate(UIValidationContext validator)
   {
      UIContext uiContext = validator.getUIContext();
      JPADataSource ds = getDataSource(uiContext);
      try
      {
         ds.validate();
      }
      catch (Exception e)
      {
         validator.addValidationError(null, e.getMessage());
      }
View Full Code Here

   @Override
   public Result execute(UIExecutionContext context) throws Exception
   {
      UIContext uiContext = context.getUIContext();
      Project project = getSelectedProject(uiContext);
      JPADataSource dataSource = getDataSource(uiContext);
      Boolean configureMetadata = (Boolean) uiContext.getAttributeMap().get("ConfigureMetadata");
      String puName = persistenceUnitName.getValue();
      persistenceOperations.setup(puName, project, dataSource, configureMetadata);
      return Results.success("Persistence (JPA) is installed.");
View Full Code Here

      });
   }

   private JPADataSource getDataSource(UIContext context)
   {
      JPADataSource dataSource = new JPADataSource();
      dataSource.setDatabase(dbType.getValue());
      dataSource.setJndiDataSource(dataSourceName.getValue());
      dataSource.setDatabaseURL(databaseURL.getValue());
      dataSource.setUsername(username.getValue());
      dataSource.setPassword(password.getValue());
      Map<Object, Object> attributeMap = context.getAttributeMap();
      dataSource.setProvider((PersistenceProvider) attributeMap.get(PersistenceProvider.class));
      dataSource.setContainer((PersistenceContainer) attributeMap.get(PersistenceContainer.class));
      return dataSource;
   }
View Full Code Here

   @Override
   public void validate(UIValidationContext validator)
   {
      UIContext uiContext = validator.getUIContext();
      JPADataSource ds = getDataSource(uiContext);
      try
      {
         ds.validate();
      }
      catch (Exception e)
      {
         validator.addValidationError(null, e.getMessage());
      }
View Full Code Here

   @Override
   public Result execute(UIExecutionContext context) throws Exception
   {
      UIContext uiContext = context.getUIContext();
      Project project = getSelectedProject(uiContext);
      JPADataSource dataSource = getDataSource(uiContext);
      Boolean configureMetadata = (Boolean) uiContext.getAttributeMap().get("ConfigureMetadata");
      String puName = persistenceUnitName.getValue();
      persistenceOperations.setup(puName, project, dataSource, configureMetadata);
      return Results.success("Persistence (JPA) is installed.");
   }
View Full Code Here

      });
   }

   private JPADataSource getDataSource(UIContext context)
   {
      JPADataSource dataSource = new JPADataSource();
      dataSource.setDatabase(dbType.getValue());
      dataSource.setJndiDataSource(dataSourceName.getValue());
      dataSource.setDatabaseURL(databaseURL.getValue());
      dataSource.setUsername(username.getValue());
      dataSource.setPassword(password.getValue());
      Map<Object, Object> attributeMap = context.getAttributeMap();
      dataSource.setProvider((PersistenceProvider) attributeMap.get(PersistenceProvider.class));
      dataSource.setContainer((PersistenceContainer) attributeMap.get(PersistenceContainer.class));
      return dataSource;
   }
View Full Code Here

TOP

Related Classes of org.jboss.forge.addon.javaee.jpa.JPADataSource

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.