Telosys doc
WebsiteTwitterLinkedInNews
  • Telosys documentation
  • Telosys CLI
    • Installation on Linux
    • Installation on Windows
    • CLI configuration
    • CLI commands
    • Getting started
  • Telosys with VSCode
    • Extension installation
    • VSCode settings
    • Telosys terminal in VSCode
    • Telosys editor configuration
  • Telosys with JetBrains IDE
  • Project configuration
  • Project variables
  • Project databases
  • Models and entities
    • Model structure
    • Entity
    • Attribute / Link
    • Annotations
    • Tags
    • Examples
    • Model creation
    • Model installation
    • Models management
  • Bundles of templates
    • Bundle structure
    • Bundle creation
    • Bundles installation
    • Bundles management
    • Velocity language
    • Velocity directives
    • Velocity object types
    • Telosys directives
    • Telosys variables
    • Telosys objects
    • Code snippets
  • Code generation
    • "gen" command
    • "genb" command
  • Target languages
    • C++
    • C#
    • Golang
    • Java
    • JavaScript
    • Kotlin
    • PHP
    • Python
    • Scala
    • TypeScript
  • Target databases (SQL)
    • Predefined rules
    • Specific rules
    • Type size and precision
  • Telosys with Git
    • GitHub usage
    • Install with Git
    • Publish with Git
  • Support the project
  • How to contribute
  • Sponsors
  • IDE and editors
  • Telosys 3 Eclipse plugin
    • Eclipse plugin installation
    • Eclipse customization
    • Telosys 3 database model
Powered by GitBook
On this page
  • "gen" command syntax
  • "gen" command examples
  1. Code generation

"gen" command

“gen” is the standard command commonly used to generate code in the scope of the current model and the current bundle of templates.

You must have defined the current model and the current bundle before using the gen command. The Telosys prompt must look like this: telosys#(model-name)[bundle-name]>

"gen" command syntax

> gen *|entities *|templates [-r] [-y]
  • entities : a list of entities (part of the name) separated by a comma (,) or "*" for all

  • templates : a list of templates (part of the name) separated by a comma (,) or "*" for all

  • -r (optional) to copy the static resources provided by the bundle (if any)

  • -y (optional) to force "yes" answer (to avoid confirmation)

"gen" command examples

> gen * *

generates the code for all the entities of the current model with all the templates of the current bundle

> gen * * -r

generates the code for all the entities of the current model with all the templates of the current bundle and copy the static resources provided by the bundle (if any)

> gen Driver *

generates the code for only the entities having "Driver" in their name and for all the templates of the current bundle

> gen Car,Dri *

generates the code for only the entities having "Car" or "Dri" in their name and for all the templates of the current bundle

> gen * dao

generates the code for all the entities of the current model with only the templates having "dao" in their name

> gen Car,Dri dao,controller

generates the code for only the entities having "Car" or "Dri" in their name and only the templates having "dao" or "controller" in their name

PreviousCode generationNext"genb" command

Last updated 4 months ago