Package org.jboss.shrinkwrap.descriptor.api.spec.jpa.persistence

Examples of org.jboss.shrinkwrap.descriptor.api.spec.jpa.persistence.PersistenceDescriptor


      return descriptor;
   }
  
   private void createDefaultConfig(FileResource<?> descriptor)
   {
      PersistenceDescriptor descriptorContents = Descriptors.create(PersistenceDescriptor.class)
               .version("2.0");
      descriptor.setContents(descriptorContents.exportAsString());
   }
View Full Code Here


      return lookupProvider().getAptDependency();
   }

   private MetaModelProvider lookupProvider()
   {
      PersistenceDescriptor config = project.getFacet(PersistenceFacet.class).getConfig();
      String providerName = config.listUnits().size() > 0 ? config.listUnits().get(0).getProvider() : null;
      for (JPAProvider jpaProvider : JPAProvider.values())
      {
         PersistenceProvider candidate = jpaProvider.getProvider(manager);
         if (candidate.getProvider().equals(providerName))
         {
View Full Code Here

   public void show(final PipeOut out, @Option(name = "all", shortName = "a") final boolean showAll)
   {
      if (project.hasFacet(PersistenceFacet.class))
      {
         PersistenceFacet jpa = project.getFacet(PersistenceFacet.class);
         PersistenceDescriptor config = jpa.getConfig();

         ShellMessages.info(out, "Displaying current JPA configuration:");

         if (!config.listUnits().isEmpty())
            out.println();

         for (PersistenceUnitDef unit : config.listUnits())
         {
            out.println(out.renderColor(ShellColor.BOLD, "Unit: ") + unit.getName() + "\t"
                     + out.renderColor(ShellColor.BOLD, "transaction-type: ") + unit.getTransactionType());
            out.println("description:\t" + unit.getDescription());
            out.println("provider:\t" + unit.getProvider());
View Full Code Here

            @Option(name = "named", defaultValue = DEFAULT_UNIT_NAME) final String unitName,
            final PipeOut out)
   {
      installPersistence();
      PersistenceFacet jpa = project.getFacet(PersistenceFacet.class);
      PersistenceDescriptor config = jpa.getConfig();

      PersistenceUnitDef unit = config.persistenceUnit(unitName);

      unit.name(unitName).description(DEFAULT_UNIT_DESC);

      PersistenceContainer container = jpac.getContainer(manager);
      PersistenceProvider provider = jpap.getProvider(manager);
View Full Code Here

TOP

Related Classes of org.jboss.shrinkwrap.descriptor.api.spec.jpa.persistence.PersistenceDescriptor

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.