// Path: spi/src/main/java/org/jipijapa/plugin/spi/ManagementAdaptor.java
// public interface ManagementAdaptor {
// 
// 
//     /**
//      * Get the short identification string that represents the management adaptor (e.g Hibernate)
//      *
//      * @return id label
//      */
//     String getIdentificationLabel();
// 
//     /**
//      * Version that uniquely identifies the management adapter (can be used to tell the difference between
//      * Hibernate 4.1 vs 4.3).
//      *
//      * @return version string
//      */
//     String getVersion();
// 
//     Statistics getStatistics();
// }
// 
// Path: spi/src/main/java/org/jipijapa/plugin/spi/PersistenceProviderAdaptor.java
// public interface PersistenceProviderAdaptor {
// 
//     /**
//      * pass the JtaManager in for internal use by PersistenceProviderAdaptor implementer
//      *
//      * @param jtaManager
//      */
//     void injectJtaManager(JtaManager jtaManager);
// 
//     /**
//      * pass the platform in use
//      * @param platform
//      */
//     void injectPlatform(Platform platform);
// 
//     /**
//      * Adds any provider specific properties (e.g. hibernate.transaction.manager_lookup_class)
//      *
//      * @param properties
//      * @param pu
//      */
//     void addProviderProperties(Map properties, PersistenceUnitMetadata pu);
// 
//     /**
//      * Persistence provider integration code might need dependencies that must be started
//      * for the deployment.  Note that these dependency classes are expected to be already available to the provider.
//      *
//      * @param pu
//      * @return
//      */
//     void addProviderDependencies(PersistenceUnitMetadata pu);
// 
//     /**
//      * Called right before persistence provider is invoked to create container entity manager factory.
//      * afterCreateContainerEntityManagerFactory() will always be called after the container entity manager factory
//      * is created.
//      *
//      * @param pu
//      */
//     void beforeCreateContainerEntityManagerFactory(PersistenceUnitMetadata pu);
// 
//     /**
//      * Called right after persistence provider is invoked to create container entity manager factory.
//      */
//     void afterCreateContainerEntityManagerFactory(PersistenceUnitMetadata pu);
// 
//     /**
//      * Get the management adaptor
//      *
//      * @return ManagementAdaptor or null
//      */
//     ManagementAdaptor getManagementAdaptor();
// 
//     /**
//      * for adapters that support getManagementAdaptor(), does the scoped persistence unit name
//      * correctly identify cache entities.  This is intended for Hibernate, other adapters can return true.
//      *
//      * @return the Hibernate adapter will return false if
//      * the persistence unit has specified a custom "hibernate.cache.region_prefix" property.  True otherwise.
//      *
//      */
//     boolean doesScopedPersistenceUnitNameIdentifyCacheRegionName(PersistenceUnitMetadata pu);
// 
//     /**
//      * Called when we are done with the persistence unit metadata
//      */
//     void cleanup(PersistenceUnitMetadata pu);
// }
// 
// Path: spi/src/main/java/org/jipijapa/plugin/spi/Platform.java
// public interface Platform {
// 
//     /**
//      * obtain the default second level cache classification
//      * @return default 2lc type
//      */
//     Classification defaultCacheClassification();
// 
//     /**
//      * get the second level cache classifications
//      * @return Set<Classification>
//      */
//     Set<Classification> cacheClassifications();
// }


import java.lang.reflect.Method;
import java.util.Map;
import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.Environment;
import org.jipijapa.plugin.spi.JtaManager;
import org.jipijapa.plugin.spi.ManagementAdaptor;
import org.jipijapa.plugin.spi.PersistenceProviderAdaptor;
import org.jipijapa.plugin.spi.PersistenceUnitMetadata;
import org.jipijapa.plugin.spi.Platform;
/*
 * JBoss, Home of Professional Open Source
 * Copyright 2013, Red Hat Middleware LLC, and individual contributors
 * by the @authors tag. See the copyright.txt in the distribution for a
 * full listing of individual contributors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * http://www.apache.org/licenses/LICENSE-2.0
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.jboss.as.jpa.hibernate3;



/**
 * Implements the PersistenceProviderAdaptor for Hibernate 3.3.x or higher 3.x
 *
 * @author Scott Marlow
 */
public class HibernatePersistenceProviderAdaptor implements PersistenceProviderAdaptor {

    public static final String SCANNER = "hibernate.ejb.resource_scanner";
    private static final String HIBERNATE_ANNOTATION_SCANNER_CLASS = "org.jboss.as.jpa.hibernate3.HibernateAnnotationScanner";

    @Override
    public void injectJtaManager(JtaManager jtaManager) {
        JBossAppServerJtaPlatform.initJBossAppServerJtaPlatform(jtaManager);
    }

    @Override
// Path: spi/src/main/java/org/jipijapa/plugin/spi/ManagementAdaptor.java
// public interface ManagementAdaptor {
// 
// 
//     /**
//      * Get the short identification string that represents the management adaptor (e.g Hibernate)
//      *
//      * @return id label
//      */
//     String getIdentificationLabel();
// 
//     /**
//      * Version that uniquely identifies the management adapter (can be used to tell the difference between
//      * Hibernate 4.1 vs 4.3).
//      *
//      * @return version string
//      */
//     String getVersion();
// 
//     Statistics getStatistics();
// }
// 
// Path: spi/src/main/java/org/jipijapa/plugin/spi/PersistenceProviderAdaptor.java
// public interface PersistenceProviderAdaptor {
// 
//     /**
//      * pass the JtaManager in for internal use by PersistenceProviderAdaptor implementer
//      *
//      * @param jtaManager
//      */
//     void injectJtaManager(JtaManager jtaManager);
// 
//     /**
//      * pass the platform in use
//      * @param platform
//      */
//     void injectPlatform(Platform platform);
// 
//     /**
//      * Adds any provider specific properties (e.g. hibernate.transaction.manager_lookup_class)
//      *
//      * @param properties
//      * @param pu
//      */
//     void addProviderProperties(Map properties, PersistenceUnitMetadata pu);
// 
//     /**
//      * Persistence provider integration code might need dependencies that must be started
//      * for the deployment.  Note that these dependency classes are expected to be already available to the provider.
//      *
//      * @param pu
//      * @return
//      */
//     void addProviderDependencies(PersistenceUnitMetadata pu);
// 
//     /**
//      * Called right before persistence provider is invoked to create container entity manager factory.
//      * afterCreateContainerEntityManagerFactory() will always be called after the container entity manager factory
//      * is created.
//      *
//      * @param pu
//      */
//     void beforeCreateContainerEntityManagerFactory(PersistenceUnitMetadata pu);
// 
//     /**
//      * Called right after persistence provider is invoked to create container entity manager factory.
//      */
//     void afterCreateContainerEntityManagerFactory(PersistenceUnitMetadata pu);
// 
//     /**
//      * Get the management adaptor
//      *
//      * @return ManagementAdaptor or null
//      */
//     ManagementAdaptor getManagementAdaptor();
// 
//     /**
//      * for adapters that support getManagementAdaptor(), does the scoped persistence unit name
//      * correctly identify cache entities.  This is intended for Hibernate, other adapters can return true.
//      *
//      * @return the Hibernate adapter will return false if
//      * the persistence unit has specified a custom "hibernate.cache.region_prefix" property.  True otherwise.
//      *
//      */
//     boolean doesScopedPersistenceUnitNameIdentifyCacheRegionName(PersistenceUnitMetadata pu);
// 
//     /**
//      * Called when we are done with the persistence unit metadata
//      */
//     void cleanup(PersistenceUnitMetadata pu);
// }
// 
// Path: spi/src/main/java/org/jipijapa/plugin/spi/Platform.java
// public interface Platform {
// 
//     /**
//      * obtain the default second level cache classification
//      * @return default 2lc type
//      */
//     Classification defaultCacheClassification();
// 
//     /**
//      * get the second level cache classifications
//      * @return Set<Classification>
//      */
//     Set<Classification> cacheClassifications();
// }


// Path: hibernate3/src/main/java/org/jboss/as/jpa/hibernate3/HibernatePersistenceProviderAdaptor.java
import java.lang.reflect.Method;
import java.util.Map;
import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.Environment;
import org.jipijapa.plugin.spi.JtaManager;
import org.jipijapa.plugin.spi.ManagementAdaptor;
import org.jipijapa.plugin.spi.PersistenceProviderAdaptor;
import org.jipijapa.plugin.spi.PersistenceUnitMetadata;
import org.jipijapa.plugin.spi.Platform;

/*
 * JBoss, Home of Professional Open Source
 * Copyright 2013, Red Hat Middleware LLC, and individual contributors
 * by the @authors tag. See the copyright.txt in the distribution for a
 * full listing of individual contributors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * http://www.apache.org/licenses/LICENSE-2.0
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.jboss.as.jpa.hibernate3;



/**
 * Implements the PersistenceProviderAdaptor for Hibernate 3.3.x or higher 3.x
 *
 * @author Scott Marlow
 */
public class HibernatePersistenceProviderAdaptor implements PersistenceProviderAdaptor {

    public static final String SCANNER = "hibernate.ejb.resource_scanner";
    private static final String HIBERNATE_ANNOTATION_SCANNER_CLASS = "org.jboss.as.jpa.hibernate3.HibernateAnnotationScanner";

    @Override
    public void injectJtaManager(JtaManager jtaManager) {
        JBossAppServerJtaPlatform.initJBossAppServerJtaPlatform(jtaManager);
    }

    @Override
    public void injectPlatform(Platform platform) {