Skip to content

Commit

Permalink
Update Writing-advanced-java-ee-web-app.asciidoc
Browse files Browse the repository at this point in the history
  • Loading branch information
gastaldi committed Aug 31, 2016
1 parent 1496219 commit f8b15bf
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions get_started/Writing-advanced-java-ee-web-app.asciidoc
Expand Up @@ -7,15 +7,15 @@ Now that you know how to write a basic Java EE web application, you might want t
The `project-new` command takes a few parameters so you can customize the package, destination folder or the version of your artifact.

----
$ project-new --named conference --topLevelPackage com.example.project --projectFolder /directory/path --finalName conferenceApp
$ project-new --named conference --top-level-package com.example.project --project-folder /directory/path --final-name conferenceApp
----

=== Setup your JPA Provider

If you do not wish to use the Java EE container default data-source, you can also specify additional connection parameters such as JNDI data-source names, JDBC connection information, and data-source types. Note, however, that this means you will probably need configure your application server to provide this new data-source and/or database connection.

----
$ jpa-setup --provider Eclipse Link --dbType POSTGRES --dataSourceName java:comp/DefaultDataSource
$ jpa-setup --provider Eclipse Link --db-type POSTGRES --data-source-name java:comp/DefaultDataSource
----

=== Create a JPA entity with Bean Validation constraints
Expand All @@ -28,9 +28,9 @@ $ jpa-new-field --named surname
$ jpa-new-field --named bio --length 2000
$ jpa-new-field --named twitter
$ constraint-add --onProperty firstname --constraint NotNull
$ constraint-add --onProperty surname --constraint NotNull
$ constraint-add --onProperty bio --constraint Size --max 2000
$ constraint-add --on-property firstname --constraint NotNull
$ constraint-add --on-property surname --constraint NotNull
$ constraint-add --on-property bio --constraint Size --max 2000
----

=== Create another JPA entity with a One-to-Many relationship
Expand All @@ -41,20 +41,20 @@ $ jpa-new-entity --named Talk
$ jpa-new-field --named title
$ jpa-new-field --named description --length 2000
$ jpa-new-field --named room
$ jpa-new-field --named date --type java.util.Date --temporalType DATE
$ jpa-new-field --named speakers --type com.example.project.model.Speaker --relationshipType One-to-Many
$ jpa-new-field --named date --type java.util.Date --temporal-type DATE
$ jpa-new-field --named speakers --type com.example.project.model.Speaker --relationship-type One-to-Many
$ constraint-add --onProperty title --constraint NotNull
$ constraint-add --onProperty room --constraint NotNull
$ constraint-add --onProperty description --constraint Size --max 2000
$ constraint-add --on-property title --constraint NotNull
$ constraint-add --on-property room --constraint NotNull
$ constraint-add --on-property description --constraint Size --max 2000
----

=== Create a simple Java enum

With Forge you can also quickly create Java classes or enums.

----
$ java-new-enum --named Language --targetPackage com.example.project.model
$ java-new-enum --named Language --target-package com.example.project.model
$ java-new-enum-const ENGLISH
$ java-new-enum-const FRENCH
----
Expand All @@ -71,7 +71,7 @@ $ jpa-new-field --named author
$ jpa-new-field --named description --length 2000
$ jpa-new-field --named price --type java.lang.Float
$ jpa-new-field --named nbOfPages --type java.lang.Integer
$ jpa-new-field --named publicationDate --typeName java.util.Date --temporalType DATE
$ jpa-new-field --named publicationDate --typeName java.util.Date --temporal-type DATE
$ jpa-new-field --named language --type com.example.project.model.Language
----

Expand All @@ -80,7 +80,7 @@ $ jpa-new-field --named language --type com.example.project.model.Language
By default Forge scaffolds a web application with JSF 2.0 but you can change this configuration by executing the `faces-setup` command.

----
$ faces-setup --facesVersion 2.2
$ faces-setup --faces-version 2.2
----

=== Generate scaffolding for all the entities
Expand Down

0 comments on commit f8b15bf

Please sign in to comment.