JBoss Forge
融修平
2023-12-01
java 7 JDK forge 2.12.3
http://forge.jboss.org/document/sample-forge-usage-tasks
$ project-new --named example --topLevelPackage org.mycomp.myapp --type war --finalName myExample
$ jpa-new-entity --named SampleEntity
$ jpa-new-field --named sampleField
$ jpa-new-field --named createdOn --type java.util.Date --temporalType TIMESTAMP
$ jpa-new-entity --named Hurricane
$ jpa-new-entity --named Continent
$ jpa-new-field --named hurricanes --type org.example.model.Hurricane --relationshipType Many-to-Many --inverseFieldName continents
$ jpa-new-entity --named Speaker
$ jpa-new-field --named firstname
$ 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
$ jpa-new-entity --named SampleEntity
$ jpa-new-field --named sampleField
$ rest-generate-endpoints-from-entities --targets org.example.model.SampleEntity
$ jpa-generate-entities-from-tables --jdbcUrl jdbc:postgresql://localhost:5432/mydb --userName user --userPassword pwd --driverLocation /Users/bob/.m2/repository/org/postgresql/postgresql/9.3-1100-jdbc3/postgresql-9.3-1100-jdbc3.jar --hibernateDialect org.hibernate.dialect.PostgreSQLDialect
java-new-enum --named Language
java-new-enum-const ENGLISH
java-new-enum-const FRENCH
java-new-enum-const PORTUGUESE
All works