This chapter describes how to change the basic provider of JEUS.
To use other providers, besides the basic provider supported by JEUS, use the settings provided by the JPA specifications.
Copy the necessary libraries to the JEUS_HOME/lib/application directory or package each application, and set the <provider> property in the persistence. xml file to the class name of the provider. Corresponding persistence units will use the specified provider.
Refer to the corresponding document for configuration, since the provider class name and related properties differ by the provider. For example, to use Hibernate, set as follows:
[Example 3.1] Changing Persistence Provider
<?xml version="1.0" encoding="UTF-8"?> <persistence xmlns="http://java.sun.com/xml/ns/persistence"> <persistence-unit name="em"> <provider>org.hibernate.ejb.HibernatePersistence</provider> <jta-data-source>jdbc/MyDB</jta-data-source> <properties> <!-- add Hibernate properties here --> </properties> </persistence-unit> </persistence>
Provider can be changed by persistence unit as shown in the previous example, or the default provider of JEUS can be used. If the system property jeus.persistence.defaultProvider is set to another provider class name when JEUS starts, all persistence units that do not set their own provider will use the default provider.
To learn how to configure JEUS system properties, refer to "JEUS Server Guide" and "JEUS Reference Guide".
Refer to the following sites for information about other persistence providers:
Hibernate EntityManager
http://www.hibernate.org
OpenJPA
http://openjpa.apache.org
BEA Kodo
http://docs.oracle.com/cd/E13189_01/kodo/docs40/index.html