Java Reference
In-Depth Information
referencing a database named MySQL . This database is reachable at the JNDI
named java:jboss/datasources/MySqlDS .
persistence setup --provider HIBERNATE
--container JBOSS_AS7 --database MYSQL
--jndiDataSource java:jboss/datasources/MySqlDS
You will be asked to select which Java EE 6 POM you want to use for your applica-
tion; you are advised to always use the latest stable version.
You can check the persistence.xml file generated by Forge by using the cat
command:
[forge-demo] forge-demo $ cat
C:\forge-distribution-1.1.3.Final\bin\forge-demo\src\main\resources\META-INF\persistence.xml
<?xml version="1.0" encoding="UTF-8"
standalone="no"?>
<persistence xmlns="http://java.sun.com/xml/ns/
persistence" xmlns:xsi="http://www.w3.org/2001/
XMLSchema-instance" version="2.0"
xsi:schemaLocation="http://java.sun.com/xml/ns/
persistence http://java.sun.com/xml/ns/
persistence/persistence_2_0.xsd">
<persistence-unit name="forge-default"
transaction-type="JTA">
<description>Forge Persistence
Unit</description>
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:jboss/datasources/
MySqlDS</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property name="hibernate.hbm2ddl.auto"
value="create-drop"/>
Search WWH ::




Custom Search