Package javax.persistence.spi

Examples of javax.persistence.spi.PersistenceUnitTransactionType


            for (String urlString: jarFileUrlsUntyped) {
                URL url = configurationBaseURI.resolve(urlString).normalize().toURL();
                jarFileUrls.add(url);
            }
        }
        PersistenceUnitTransactionType persistenceUnitTransactionType = persistenceUnitTransactionTypeString == null? PersistenceUnitTransactionType.JTA: PersistenceUnitTransactionType.valueOf(persistenceUnitTransactionTypeString);

        if (persistenceProviderClassName == null) persistenceProviderClassName = "org.apache.openjpa.persistence.PersistenceProviderImpl";
       
        persistenceUnitInfo = new PersistenceUnitInfoImpl(persistenceUnitName,
                persistenceProviderClassName,
View Full Code Here


        @ManagedOperation
        @Description("change the current transaction type")
        public void setTransactionType(String type) {
            try {
                PersistenceUnitTransactionType tt = PersistenceUnitTransactionType.valueOf(type.toUpperCase());
                reloadableEntityManagerFactory.setTransactionType(tt);
            } catch (Exception iae) {
                // ignored
            }
        }
View Full Code Here

            managedClassNames = NO_STRINGS;
        }
        if (properties == null) {
            properties = new Properties();
        }
        PersistenceUnitTransactionType persistenceUnitTransactionType = persistenceUnitTransactionTypeString == null? PersistenceUnitTransactionType.JTA: PersistenceUnitTransactionType.valueOf(persistenceUnitTransactionTypeString);

        if (persistenceProviderClassName == null) persistenceProviderClassName = "org.apache.openjpa.persistence.PersistenceProviderImpl";
       
        persistenceUnitInfo = new PersistenceUnitInfoImpl(persistenceUnitName,
                persistenceProviderClassName,
View Full Code Here

            TransactionManagerImpl transactionManager,
            ClassLoader classLoader) {
        List<String> mappingFileNames = mappingFileNamesUntyped == null? new ArrayList<String>(): new ArrayList<String>(mappingFileNamesUntyped);
        List<URL> jarFileUrls = jarFileUrlsUntyped == null? new ArrayList<URL>(): new ArrayList<URL>(jarFileUrlsUntyped);
        List<String> managedClassNames = managedClassNamesUntyped == null? new ArrayList<String>(): new ArrayList<String>(managedClassNamesUntyped);
        PersistenceUnitTransactionType persistenceUnitTransactionType = persistenceUnitTransactionTypeString == null? PersistenceUnitTransactionType.JTA: PersistenceUnitTransactionType.valueOf(persistenceUnitTransactionTypeString);

        if (persistenceProviderClassName == null) persistenceProviderClassName = "org.apache.openjpa.persistence.PersistenceProviderImpl";
       
        persistenceUnitInfo = new PersistenceUnitInfoImpl(persistenceUnitName,
                persistenceProviderClassName,
View Full Code Here

       * If explicit type => use it
       * If a JTA DS is used => JTA transaction,
       * if a non JTA DS is used => RESOURCe_LOCAL
       * if none, set to JavaEE default => JTA transaction
       */
      PersistenceUnitTransactionType transactionType = info.getTransactionType();
      if (transactionType == null) {
        if (isJTA == Boolean.TRUE) {
          transactionType = PersistenceUnitTransactionType.JTA;
        }
        else if ( isJTA == Boolean.FALSE ) {
View Full Code Here

       * If explicit type => use it
       * If a JTA DS is used => JTA transaction,
       * if a non JTA DS is used => RESOURCe_LOCAL
       * if none, set to JavaEE default => JTA transaction
       */
      PersistenceUnitTransactionType transactionType = info.getTransactionType();
      if (transactionType == null) {
        if (isJTA == Boolean.TRUE) {
          transactionType = PersistenceUnitTransactionType.JTA;
        }
        else if ( isJTA == Boolean.FALSE ) {
View Full Code Here

    if ( StringHelper.isNotEmpty( name ) ) {
            LOG.tracef( "Persistence unit name from persistence.xml : %s", name );
      persistenceUnit.setName( name );
    }

    final PersistenceUnitTransactionType transactionType = parseTransactionType(
        persistenceUnitElement.getAttribute( "transaction-type" )
    );
    if ( transactionType != null ) {
      persistenceUnit.setTransactionType( transactionType );
    }
View Full Code Here

      }
    }
  }

  private void applyTransactionProperties() {
    PersistenceUnitTransactionType txnType = PersistenceUnitTransactionTypeHelper.interpretTransactionType(
        configurationValues.get( AvailableSettings.TRANSACTION_TYPE )
    );
    if ( txnType == null ) {
      txnType = persistenceUnit.getTransactionType();
    }
View Full Code Here

           * if explicit => use it
           * if JTA DS => JTA transaction
           * if non JTA DA => RESOURCE_LOCAL transaction
           * else default JavaSE => RESOURCE_LOCAL
           */
          PersistenceUnitTransactionType transactionType = metadata.getTransactionType();
          Boolean isJTA = null;
          if ( StringHelper.isNotEmpty( metadata.getJtaDatasource() ) ) {
            isJTA = Boolean.TRUE;
          }
          else if ( StringHelper.isNotEmpty( metadata.getNonJtaDatasource() ) ) {
View Full Code Here

          }

        }
      }
    }
    PersistenceUnitTransactionType transactionType = getTransactionType( top.getAttribute( "transaction-type" ) );
    if (transactionType != null) metadata.setTransactionType( transactionType );

    return metadata;
  }
View Full Code Here

TOP

Related Classes of javax.persistence.spi.PersistenceUnitTransactionType

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.