Samples
Want to get started using Forge, but now quite sure how to do the things you want? Check out some of these sample scripts for common use-cases.
Forge Quickstart
Want to see a full example, a quick-start using much of the Forge built-in scaffolding and commands? You can find the full tutorial and instructions here.
Create a new JPA @Entity class
- new-project —named example —topLevelPackage com.example
- persistence setup —provider HIBERNATE —container JBOSS_AS7
- entity —named SampleEntity
- field string —named sampleField
- field temporal —named createdOn —type TIMESTAMP
- ls
Add an @N-To-N relationship between two @Entity classes
- new-project —named example —topLevelPackage com.example
- persistence setup —provider HIBERNATE —container JBOSS_AS7
- entity —named Hurricane
- entity —named Continent
- field manyToMany —named hurricanes —fieldType com.example.domain.Hurricane —inverseFieldName continents
- ls
Create a REST endpoint from @Entity
- new-project —named example —topLevelPackage com.example
- persistence setup —provider HIBERNATE —container JBOSS_AS7
- rest setup
- entity —named SampleEntity
- field string —named sampleField
- rest endpoint-from-entity