"Fossies" - the Fresh Open Source Software Archive

Member "grails-core-5.2.4/grails-docs/src/test/resources/docs/ref/Command Line/generate-all.html" (14 Sep 2022, 60071 Bytes) of package /linux/www/grails-core-5.2.4.tar.gz:


Caution: In this restricted "Fossies" environment the current HTML page may not be correctly presentated and may have some non-functional links. You can here alternatively try to browse the pure source code or just view or download the uninterpreted raw source code. If the rendering is insufficient you may try to find and view the page on the grails-core-5.2.4.tar.gz project site itself.

(Quick Reference)

generate-all

Purpose

Generates a controller, views, and a controller unit test for the given domain class

Examples

grails generate-all
grails generate-all org.bookstore.Book
grails generate-all "*"

Description

Grails supports a feature known as static scaffolding which involves the generation of a CRUD (Create/Read/Update/Delete) interface for a given domain class. Once generated, the controller and its views can be modified by you but they won’t automatically update when you change the domain class.

The generate-all command generates an implementation of CRUD including a controller and views for the given domain class. The argument is optional, but if you don’t include it the command will ask you for the name of the domain class to scaffold. So for a domain class org.bookstore.Book, this command will generate the controller grails-app/controllers/org/bookstore/BookController.groovy and its associated views in grails-app/views/book.

Usage:

grails generate-all <<name>>

Arguments:

  • name - Either a domain class name (case-sensitive) or a wildcard (\*). If you specify the wildcard then controllers and views will be generated for all domain classes.

Flags:

  • force - Whether to overwrite existing files