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
  • Entity file
  • Entity name
  • Comments
  • Entity structure
  1. Models and entities

Entity

Entity file

Each entity is defined in a text file editable with any editor. The file name is composed of the name of the entity followed by the extension ".entity".

Examples :

Car.entity
Driver.entity

Entity name

The entity name can be composed of : letters, numbers and "_" (underscore). Other characters are not allowed. By convention the name usually starts with an upper case character. The entity name must be the same as the file name, for example if the file is "Car.entity" then the entity name must be "Car".

Examples of valid entity names :

  • Car

  • Car123

  • CarOwner

  • Car_owner

Examples of invalid entity names :

  • Car#12 ( "#" not allowed )

  • Car+Owner ( "+" not allowed )

Comments

Comments can be placed anywhere in the file. A comment starts with "//". All the end of line located after "//" is the comment. Comments are only "single line" (no multi lines comments).

Example :

xxx  // the comment

Entity structure

The entity structure is made up of the name of the entity followed by a block containing all of its attributes and links. The block containing the attributes and the links starts with '{' and ends with '}'. "End Of Line" characters are not significant. They are used only for readability. Potentially all the entity can be described in a single line.

Example :

EntityName {
   // attributes 
   id   : int { @Id } ; // attribute 'id'
   name : string  ; // attribute 'name'
   // links
   town : Town ; // link to the 'Town' entity
}

PreviousModel structureNextAttribute / Link

Last updated 5 months ago