Java Reference
In-Depth Information
When you have learned how to get help using Forge, let's get back to our application.
In the first step, we need to specify what Java and Java EE version we want to use:
[forge-demo]$ project-set-compiler-version --sourceVersion
1.8 --targetVersion 1.8
[forge-demo]$ javaee-setup --javaEEVersion 7
***SUCCESS*** JavaEE 7 has been installed.
At this point, our project already contains Java EE 7 API dependency. Now, since we will
need to reverse-engineer our database table into Java entities, the next step will be to con-
figure the Java Persistence API ( JPA ) layer for your application. This application will be
based on WildFly JPA implementation, which is based on the Hibernate provider, referen-
cing a database named Forge. This database is reachable at the Java Naming and Direct-
ory Interface ( JNDI ) named java:jboss/datasources/PostgreSqlDS . This is
shown in the following command line:
[forge-demo]$ jpa-setup --jpaVersion 2.1 --provider
--dataSourceName java:jboss/datasources/PostgreSqlDS
The persistence.xml file was generated, and currently the console indicates that we
are editing it. We can check its content by using the cat command:
[persistence.xml]$ cat .
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<persistence xmlns="
persistence" xmlns:xsi="http://w" version="2.1"
<persistence-unit name="forge-demo-persistence-unit"
<description>Forge Persistence Unit</description>
Search WWH ::

Custom Search