├── docs ├── .nojekyll ├── getting-started │ ├── _media │ │ └── preview.gif │ └── 00_getting_started.md └── _coverpage.md ├── .gitattributes ├── tests ├── output │ ├── angular │ │ ├── src │ │ │ ├── app │ │ │ │ ├── app.css │ │ │ │ ├── app.routes.ts │ │ │ │ ├── app.ts │ │ │ │ ├── app.config.ts │ │ │ │ └── app.spec.ts │ │ │ ├── styles.css │ │ │ ├── main.ts │ │ │ ├── index.html │ │ │ └── appgenerated │ │ │ │ └── model │ │ │ │ └── restaurant │ │ │ │ ├── commande-resume.ts │ │ │ │ ├── client-item.ts │ │ │ │ ├── client-write.ts │ │ │ │ ├── restaurant-item.ts │ │ │ │ ├── table-write.ts │ │ │ │ ├── client-read.ts │ │ │ │ ├── employe-item.ts │ │ │ │ ├── table-item.ts │ │ │ │ ├── table-read.ts │ │ │ │ ├── ligne-commande-write.ts │ │ │ │ ├── avis-client-write.ts │ │ │ │ └── plat-item.ts │ │ ├── public │ │ │ └── favicon.ico │ │ ├── .editorconfig │ │ ├── tsconfig.app.json │ │ ├── tsconfig.spec.json │ │ └── .gitignore │ ├── jpa │ │ ├── tests.sh │ │ └── src │ │ │ └── main │ │ │ ├── resources │ │ │ ├── jpa-uuid-jdbc │ │ │ │ └── i18n │ │ │ │ │ └── model │ │ │ │ │ └── restaurant.properties │ │ │ ├── jpa-identity-enums │ │ │ │ └── i18n │ │ │ │ │ └── model │ │ │ │ │ └── restaurant.properties │ │ │ ├── jpa-sequence-metamodel │ │ │ │ └── i18n │ │ │ │ │ └── model │ │ │ │ │ └── restaurant.properties │ │ │ └── jpa-identity-associations │ │ │ │ └── i18n │ │ │ │ └── model │ │ │ │ └── restaurant.properties │ │ │ ├── java │ │ │ └── topmodel │ │ │ │ └── test │ │ │ │ └── CustomCrudRepository.java │ │ │ └── javagen │ │ │ └── restaurant │ │ │ ├── jpa_uuid_jdbc │ │ │ ├── daos │ │ │ │ └── restaurant │ │ │ │ │ ├── MenuDAO.java │ │ │ │ │ ├── PlatDAO.java │ │ │ │ │ ├── ClientDAO.java │ │ │ │ │ ├── EmployeDAO.java │ │ │ │ │ ├── CommandeDAO.java │ │ │ │ │ ├── PersonneDAO.java │ │ │ │ │ ├── PromotionDAO.java │ │ │ │ │ ├── AvisClientDAO.java │ │ │ │ │ ├── RestaurantDAO.java │ │ │ │ │ ├── ReservationDAO.java │ │ │ │ │ ├── CategoriePlatDAO.java │ │ │ │ │ ├── CommandeExportDAO.java │ │ │ │ │ ├── LigneCommandeDAO.java │ │ │ │ │ ├── StatutCommandeDAO.java │ │ │ │ │ └── TableRestaurantDAO.java │ │ │ ├── dtos │ │ │ │ └── restaurant │ │ │ │ │ ├── CommandeResume.java │ │ │ │ │ └── RestaurantItem.java │ │ │ └── entities │ │ │ │ └── restaurant │ │ │ │ ├── CategoriePlat_.java │ │ │ │ ├── StatutCommande_.java │ │ │ │ ├── PromotionPlat_.java │ │ │ │ ├── Client_.java │ │ │ │ ├── MenuPlat_.java │ │ │ │ ├── Personne_.java │ │ │ │ └── Client.java │ │ │ ├── jpa_identity_enums │ │ │ ├── daos │ │ │ │ └── restaurant │ │ │ │ │ ├── MenuDAO.java │ │ │ │ │ ├── PlatDAO.java │ │ │ │ │ ├── ClientDAO.java │ │ │ │ │ ├── EmployeDAO.java │ │ │ │ │ ├── CommandeDAO.java │ │ │ │ │ ├── PersonneDAO.java │ │ │ │ │ ├── PromotionDAO.java │ │ │ │ │ ├── AvisClientDAO.java │ │ │ │ │ ├── RestaurantDAO.java │ │ │ │ │ ├── MenuPlatDAO.java │ │ │ │ │ ├── ReservationDAO.java │ │ │ │ │ ├── CommandeExportDAO.java │ │ │ │ │ ├── LigneCommandeDAO.java │ │ │ │ │ ├── TableRestaurantDAO.java │ │ │ │ │ └── PromotionPlatDAO.java │ │ │ ├── dtos │ │ │ │ └── restaurant │ │ │ │ │ ├── CommandeResume.java │ │ │ │ │ └── RestaurantItem.java │ │ │ └── entities │ │ │ │ └── restaurant │ │ │ │ ├── PromotionPlat_.java │ │ │ │ ├── Client_.java │ │ │ │ ├── MenuPlat_.java │ │ │ │ └── Personne_.java │ │ │ ├── jpa_sequence_metamodel │ │ │ ├── daos │ │ │ │ └── restaurant │ │ │ │ │ ├── MenuDAO.java │ │ │ │ │ ├── PlatDAO.java │ │ │ │ │ ├── ClientDAO.java │ │ │ │ │ ├── EmployeDAO.java │ │ │ │ │ ├── CommandeDAO.java │ │ │ │ │ ├── PersonneDAO.java │ │ │ │ │ ├── PromotionDAO.java │ │ │ │ │ ├── AvisClientDAO.java │ │ │ │ │ ├── MenuPlatDAO.java │ │ │ │ │ ├── ReservationDAO.java │ │ │ │ │ ├── RestaurantDAO.java │ │ │ │ │ ├── LigneCommandeDAO.java │ │ │ │ │ ├── CommandeExportDAO.java │ │ │ │ │ ├── TableRestaurantDAO.java │ │ │ │ │ └── PromotionPlatDAO.java │ │ │ ├── enums │ │ │ │ └── restaurant │ │ │ │ │ ├── CategoriePlatCode.java │ │ │ │ │ └── StatutCommandeCode.java │ │ │ ├── dtos │ │ │ │ └── restaurant │ │ │ │ │ ├── CommandeResume.java │ │ │ │ │ └── RestaurantItem.java │ │ │ └── entities │ │ │ │ └── restaurant │ │ │ │ ├── PromotionPlat_.java │ │ │ │ ├── Client_.java │ │ │ │ ├── CategoriePlat_.java │ │ │ │ ├── MenuPlat_.java │ │ │ │ ├── Personne_.java │ │ │ │ └── StatutCommande_.java │ │ │ └── jpa_identity_associations │ │ │ ├── daos │ │ │ └── restaurant │ │ │ │ ├── MenuDAO.java │ │ │ │ ├── PlatDAO.java │ │ │ │ ├── ClientDAO.java │ │ │ │ ├── EmployeDAO.java │ │ │ │ ├── CommandeDAO.java │ │ │ │ ├── PersonneDAO.java │ │ │ │ ├── AvisClientDAO.java │ │ │ │ ├── PromotionDAO.java │ │ │ │ ├── RestaurantDAO.java │ │ │ │ ├── MenuPlatDAO.java │ │ │ │ ├── ReservationDAO.java │ │ │ │ ├── LigneCommandeDAO.java │ │ │ │ ├── CommandeExportDAO.java │ │ │ │ ├── TableRestaurantDAO.java │ │ │ │ └── PromotionPlatDAO.java │ │ │ ├── enums │ │ │ └── restaurant │ │ │ │ ├── CategoriePlatCode.java │ │ │ │ └── StatutCommandeCode.java │ │ │ ├── dtos │ │ │ └── restaurant │ │ │ │ ├── CommandeResume.java │ │ │ │ └── RestaurantItem.java │ │ │ └── entities │ │ │ └── restaurant │ │ │ ├── PromotionPlat_.java │ │ │ ├── Client_.java │ │ │ ├── MenuPlat_.java │ │ │ ├── Personne_.java │ │ │ ├── CategoriePlat_.java │ │ │ └── StatutCommande_.java │ ├── focus │ │ ├── src │ │ │ ├── index.ts │ │ │ ├── model │ │ │ │ └── restaurant │ │ │ │ │ ├── commande-resume.ts │ │ │ │ │ ├── references.ts │ │ │ │ │ ├── client-item.ts │ │ │ │ │ ├── client-write.ts │ │ │ │ │ ├── restaurant-item.ts │ │ │ │ │ ├── table-write.ts │ │ │ │ │ ├── client-read.ts │ │ │ │ │ ├── employe-item.ts │ │ │ │ │ ├── table-item.ts │ │ │ │ │ ├── table-read.ts │ │ │ │ │ ├── ligne-commande-write.ts │ │ │ │ │ ├── avis-client-write.ts │ │ │ │ │ ├── plat-item.ts │ │ │ │ │ └── commande-item.ts │ │ │ └── domains.ts │ │ ├── vite.config.ts │ │ ├── tsconfig.json │ │ └── index.html │ ├── csharp │ │ └── src │ │ │ ├── TopModel.Sample.Api │ │ │ ├── Program.cs │ │ │ └── TopModel.Sample.Api.csproj │ │ │ ├── Models │ │ │ └── TopModel.Sample.Restaurant.Models │ │ │ │ ├── Domains.cs │ │ │ │ ├── TopModel.Sample.Restaurant.Models.csproj │ │ │ │ ├── RestaurantItem.cs │ │ │ │ ├── generated │ │ │ │ └── ICommandeResume.cs │ │ │ │ ├── TableItem.cs │ │ │ │ ├── CommandeItem.cs │ │ │ │ └── PlatItem.cs │ │ │ └── Clients │ │ │ ├── TopModel.Sample.Clients.External │ │ │ ├── TopModel.Sample.Clients.External.csproj │ │ │ └── Restaurant │ │ │ │ ├── MenuClient.partial.cs │ │ │ │ ├── CommandeClient.partial.cs │ │ │ │ ├── PersonneClient.partial.cs │ │ │ │ └── RestaurantClient.partial.cs │ │ │ └── TopModel.Sample.Clients.Db │ │ │ ├── TopModel.Sample.Clients.Db.csproj │ │ │ ├── Models │ │ │ └── Restaurant │ │ │ │ └── generated │ │ │ │ ├── Client.cs │ │ │ │ └── PromotionPlat.cs │ │ │ └── Reference │ │ │ └── generated │ │ │ └── IDbRestaurantReferenceAccessors.cs │ ├── pg │ │ └── src │ │ │ ├── 06_resources.sql │ │ │ └── 03_unique_keys.sql │ └── ssdt │ │ └── src │ │ ├── init │ │ ├── main.sql │ │ ├── CATEGORIE_PLAT.insert.sql │ │ └── STATUT_COMMANDE.insert.sql │ │ └── tables │ │ ├── CATEGORIE_PLAT.sql │ │ └── STATUT_COMMANDE.sql ├── db │ └── init │ │ └── 01_schema.sql ├── modgen.bat ├── tmdgen │ ├── open-api │ │ ├── topmodel.config │ │ ├── tmdgen.lock │ │ ├── tmdgen.config │ │ └── Petstore │ │ │ └── Domains.tmd │ └── database │ │ ├── topmodel.config │ │ └── model │ │ └── tmdgen.lock ├── .gitignore ├── docker-compose.yml └── run.sh ├── TopModel.VSCode ├── .vscode │ ├── settings.json │ └── launch.json ├── .prettierrc.json ├── demo.gif ├── icon.png ├── seti.woff ├── .vscodeignore ├── dotnet.md ├── dotnet_fr.md ├── modgen.md ├── modgen_fr.md ├── src │ ├── types.ts │ ├── utils.ts │ └── const.ts ├── .eslintrc.json ├── CHANGELOG.md └── tsconfig.json ├── .vscode ├── settings.json └── extensions.json ├── TopModel.Utils ├── LoggingScope.cs ├── ModuleLatestVersion.cs ├── WriterLine.cs ├── LegitException.cs ├── IgnoredFile.cs ├── TopModelLockFile.cs ├── GeneratedFileWriterProvider.cs ├── ConfigBase.cs ├── IFileWriterProvider.cs └── IFileWriter.cs ├── TopModel.Core ├── FileModel │ ├── TransformReference.cs │ ├── Keyword.cs │ ├── DataFlowReference.cs │ ├── ClassReference.cs │ ├── EndpointReference.cs │ ├── ParameterReference.cs │ ├── DomainReference.cs │ ├── ModelFileOptions.cs │ ├── AnnotationReference.cs │ ├── DecoratorReference.cs │ ├── Reference.cs │ └── AliasReference.cs ├── Model │ ├── ClassDependency.cs │ ├── DecoratorInstance.cs │ ├── AnnotationInstance.cs │ ├── DataFlowSourceMode.cs │ ├── IVariableContainer.cs │ ├── Implementation │ │ ├── AnnotationImplementation.cs │ │ ├── DecoratorImplementation.cs │ │ ├── ValueTemplate.cs │ │ ├── ConverterImplementation.cs │ │ ├── DomainImplementation.cs │ │ └── AnnotationConstraint.cs │ ├── IAnnotationContainer.cs │ ├── AssociationType.cs │ ├── FlowHook.cs │ ├── TemplateParameter.cs │ ├── Namespace.cs │ ├── FromMapper.cs │ ├── ClassValue.cs │ ├── DataFlowType.cs │ ├── ReverseAssociationDefinition.cs │ ├── Variable.cs │ ├── Target.cs │ └── DataFlow.cs ├── Loaders │ ├── ILoader.cs │ └── YamlUtils │ │ ├── ReferenceTypeConverter.cs │ │ ├── InferTypeFromValueResolver.cs │ │ └── LocatedStringTypeConverter.cs ├── IModelWatcher.cs ├── TranslationStore.cs ├── I18nConfig.cs └── ModelException.cs ├── TopModel.LanguageServer ├── Mermaid.cs ├── MermaidScope.cs ├── References.cs ├── MermaidRequest.cs ├── ModelConfigExtensions.cs └── ModelFileCache.cs ├── TopModel.Generator.Csharp ├── ResxResource.cs └── build │ └── TopModel.Generator.Csharp.props ├── TopModel.ModelGenerator ├── TmdCompositionProperty.cs ├── TmdAliasProperty.cs ├── TmdRegularProperty.cs ├── Database │ ├── config │ │ ├── ModuleConfig.cs │ │ ├── DatabaseSource.cs │ │ └── DbType.cs │ ├── ConstraintKey.cs │ └── DbColumn.cs ├── config │ ├── DomainMapping.cs │ └── ModelGeneratorConfig.cs ├── TmdProperty.cs ├── TmdAssociationProperty.cs ├── OpenApi │ └── config │ │ └── OpenApiConfig.cs ├── TmdFile.cs └── TmdClass.cs ├── .gitignore ├── TopModel.Generator └── ModgenDependency.cs ├── TopModel.Generator.Jpa ├── DataFlowsWriter.cs ├── ResourcesEncoding.cs ├── JavaLanguage │ ├── JavaConstructor.cs │ ├── JavaEnumValue.cs │ └── JavaEnum.cs ├── build │ └── TopModel.Generator.Jpa.props └── EndpointGeneration │ └── ClientApiMode.cs ├── .github ├── release.yml └── workflows │ └── dotnet.yml ├── TopModel.Generator.Sql ├── TargetDBMS.cs ├── Procedural │ ├── Postgres │ │ └── PostgresReferenceListGenerator.cs │ ├── Oracle │ │ └── OracleReferenceListGenerator.cs │ └── SqlServer │ │ ├── SqlServerCrebasGenerator.cs │ │ └── SqlServerReferenceListGenerator.cs └── build │ └── TopModel.Generator.Sql.props ├── TopModel.Generator.Javascript ├── ResourceMode.cs ├── ReferenceMode.cs ├── build │ └── TopModel.Generator.Javascript.props ├── EntityMode.cs └── TargetFramework.cs ├── TopModel.Generator.Core ├── ApiGeneration.cs ├── IdentityMode.cs ├── IdentityConfig.cs └── IGeneratorRegistration.cs ├── TopModel.Generator.Translation ├── build │ └── TopModel.Generator.Translation.props ├── GeneratorRegistration.cs └── TranslationConfig.cs └── LICENSE /docs/.nojekyll: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * -text -------------------------------------------------------------------------------- /tests/output/angular/src/app/app.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/output/jpa/tests.sh: -------------------------------------------------------------------------------- 1 | mvn clean compile --quiet -------------------------------------------------------------------------------- /TopModel.VSCode/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.tabSize": 4, 3 | } -------------------------------------------------------------------------------- /tests/db/init/01_schema.sql: -------------------------------------------------------------------------------- 1 | DROP SCHEMA public; 2 | CREATE SCHEMA demo; 3 | -------------------------------------------------------------------------------- /tests/modgen.bat: -------------------------------------------------------------------------------- 1 | dotnet run --no-launch-profile --project ../TopModel.Generator -------------------------------------------------------------------------------- /TopModel.VSCode/.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "tabWidth": 4, 3 | "printWidth": 120 4 | } -------------------------------------------------------------------------------- /TopModel.VSCode/demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/klee-contrib/topmodel/HEAD/TopModel.VSCode/demo.gif -------------------------------------------------------------------------------- /TopModel.VSCode/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/klee-contrib/topmodel/HEAD/TopModel.VSCode/icon.png -------------------------------------------------------------------------------- /TopModel.VSCode/seti.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/klee-contrib/topmodel/HEAD/TopModel.VSCode/seti.woff -------------------------------------------------------------------------------- /tests/output/focus/src/index.ts: -------------------------------------------------------------------------------- 1 | import { initColorScheme } from "@focus4/core"; 2 | 3 | initColorScheme(); 4 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "dotnet.defaultSolution": "TopModel.sln", 3 | "editor.formatOnSave": true 4 | } 5 | -------------------------------------------------------------------------------- /tests/output/angular/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /TopModel.Utils/LoggingScope.cs: -------------------------------------------------------------------------------- 1 | namespace TopModel.Utils; 2 | 3 | public record LoggingScope(int Number, string Color); 4 | -------------------------------------------------------------------------------- /tests/tmdgen/open-api/topmodel.config: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=./topmodel.config.schema.json 2 | --- 3 | app: Petstore 4 | -------------------------------------------------------------------------------- /docs/getting-started/_media/preview.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/klee-contrib/topmodel/HEAD/docs/getting-started/_media/preview.gif -------------------------------------------------------------------------------- /tests/output/angular/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/klee-contrib/topmodel/HEAD/tests/output/angular/public/favicon.ico -------------------------------------------------------------------------------- /tests/output/angular/src/app/app.routes.ts: -------------------------------------------------------------------------------- 1 | import { Routes } from '@angular/router'; 2 | 3 | export const routes: Routes = []; 4 | -------------------------------------------------------------------------------- /TopModel.VSCode/.vscodeignore: -------------------------------------------------------------------------------- 1 | .vscode/** 2 | src/** 3 | **/tsconfig.json 4 | **/.eslintrc.json 5 | **/*.map 6 | **/*.ts 7 | node_modules 8 | -------------------------------------------------------------------------------- /tests/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | !**/src/main/**/target/ 3 | !**/src/test/**/target/ 4 | 5 | dist/ 6 | 7 | ### VS Code ### 8 | .vscode/ -------------------------------------------------------------------------------- /TopModel.Core/FileModel/TransformReference.cs: -------------------------------------------------------------------------------- 1 | namespace TopModel.Core.FileModel; 2 | 3 | public class TransformReference : Reference { } 4 | -------------------------------------------------------------------------------- /TopModel.Core/Model/ClassDependency.cs: -------------------------------------------------------------------------------- 1 | namespace TopModel.Core.Model; 2 | 3 | public record ClassDependency(Class Classe, object Source); 4 | -------------------------------------------------------------------------------- /TopModel.Utils/ModuleLatestVersion.cs: -------------------------------------------------------------------------------- 1 | namespace TopModel.Utils; 2 | 3 | public record ModuleLatestVersion(string? Version, DateTime CheckDate); 4 | -------------------------------------------------------------------------------- /tests/output/csharp/src/TopModel.Sample.Api/Program.cs: -------------------------------------------------------------------------------- 1 | var app = WebApplication.CreateBuilder(args).Build(); 2 | app.MapControllers(); 3 | await app.RunAsync(); 4 | -------------------------------------------------------------------------------- /TopModel.LanguageServer/Mermaid.cs: -------------------------------------------------------------------------------- 1 | namespace TopModel.LanguageServer; 2 | 3 | public record Mermaid(string Diagram, string Module, string FileName, MermaidScope Scope); 4 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "csharpier.csharpier-vscode", 4 | "ms-dotnettools.csdevkit", 5 | "esbenp.prettier-vscode" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /TopModel.Core/Model/DecoratorInstance.cs: -------------------------------------------------------------------------------- 1 | namespace TopModel.Core.Model; 2 | 3 | public record DecoratorInstance(Decorator Decorator, IDictionary Parameters); 4 | -------------------------------------------------------------------------------- /tests/tmdgen/database/topmodel.config: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=./topmodel.config.schema.json 2 | --- 3 | app: Database 4 | modelRoot: ./model 5 | noWarn: 6 | - TMD0009 -------------------------------------------------------------------------------- /TopModel.Core/Model/AnnotationInstance.cs: -------------------------------------------------------------------------------- 1 | namespace TopModel.Core.Model; 2 | 3 | public record AnnotationInstance(Annotation Annotation, IDictionary Parameters); 4 | -------------------------------------------------------------------------------- /TopModel.Generator.Csharp/ResxResource.cs: -------------------------------------------------------------------------------- 1 | namespace TopModel.Generator.Csharp; 2 | 3 | public enum ResxResource 4 | { 5 | All, 6 | Properties, 7 | References, 8 | } 9 | -------------------------------------------------------------------------------- /TopModel.Core/FileModel/Keyword.cs: -------------------------------------------------------------------------------- 1 | namespace TopModel.Core.FileModel; 2 | 3 | #nullable disable 4 | 5 | public class Keyword 6 | { 7 | public ModelFile ModelFile { get; set; } 8 | } 9 | -------------------------------------------------------------------------------- /TopModel.Utils/WriterLine.cs: -------------------------------------------------------------------------------- 1 | namespace TopModel.Utils; 2 | 3 | public class WriterLine 4 | { 5 | public required string Line { get; set; } 6 | 7 | public required int Indent { get; set; } 8 | } 9 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/resources/jpa-uuid-jdbc/i18n/model/restaurant.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/klee-contrib/topmodel/HEAD/tests/output/jpa/src/main/resources/jpa-uuid-jdbc/i18n/model/restaurant.properties -------------------------------------------------------------------------------- /tests/tmdgen/database/model/tmdgen.lock: -------------------------------------------------------------------------------- 1 | # 2 | # ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | # 4 | 5 | version: 1.9.2 6 | generatedFiles: 7 | - ./03_Join/01_Profil.tmd 8 | - ./04_Autres/01_Couleur.tmd 9 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/resources/jpa-identity-enums/i18n/model/restaurant.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/klee-contrib/topmodel/HEAD/tests/output/jpa/src/main/resources/jpa-identity-enums/i18n/model/restaurant.properties -------------------------------------------------------------------------------- /tests/output/jpa/src/main/resources/jpa-sequence-metamodel/i18n/model/restaurant.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/klee-contrib/topmodel/HEAD/tests/output/jpa/src/main/resources/jpa-sequence-metamodel/i18n/model/restaurant.properties -------------------------------------------------------------------------------- /TopModel.ModelGenerator/TmdCompositionProperty.cs: -------------------------------------------------------------------------------- 1 | namespace TopModel.ModelGenerator; 2 | 3 | public class TmdCompositionProperty : TmdProperty 4 | { 5 | #nullable disable 6 | 7 | public TmdClass Composition { get; set; } 8 | } 9 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/resources/jpa-identity-associations/i18n/model/restaurant.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/klee-contrib/topmodel/HEAD/tests/output/jpa/src/main/resources/jpa-identity-associations/i18n/model/restaurant.properties -------------------------------------------------------------------------------- /TopModel.ModelGenerator/TmdAliasProperty.cs: -------------------------------------------------------------------------------- 1 | namespace TopModel.ModelGenerator; 2 | 3 | public class TmdAliasProperty : TmdProperty 4 | { 5 | public required TmdProperty Alias { get; set; } 6 | 7 | public string? As { get; set; } 8 | } 9 | -------------------------------------------------------------------------------- /docs/_coverpage.md: -------------------------------------------------------------------------------- 1 | ![logo](./media/IconDark.svg) 2 | 3 | # TopModel 3.8.4 4 | 5 | > Modélisez en toute simplicité. 6 | 7 | [GitHub](https://github.com/klee-contrib/topmodel) 8 | [Tutoriel](/getting-started/00_getting_started.md) 9 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/java/topmodel/test/CustomCrudRepository.java: -------------------------------------------------------------------------------- 1 | package topmodel.test; 2 | 3 | import org.springframework.data.repository.CrudRepository; 4 | 5 | public interface CustomCrudRepository extends CrudRepository { 6 | } 7 | -------------------------------------------------------------------------------- /TopModel.ModelGenerator/TmdRegularProperty.cs: -------------------------------------------------------------------------------- 1 | namespace TopModel.ModelGenerator; 2 | 3 | public class TmdRegularProperty : TmdProperty 4 | { 5 | public string SqlName { get; set; } = string.Empty; 6 | 7 | public bool PrimaryKey { get; set; } 8 | } 9 | -------------------------------------------------------------------------------- /TopModel.Core/Loaders/ILoader.cs: -------------------------------------------------------------------------------- 1 | using TopModel.Core.FileModel; 2 | using YamlDotNet.Core; 3 | 4 | namespace TopModel.Core.Loaders; 5 | 6 | internal interface ILoader 7 | { 8 | void Load(Parser parser, ModelFile modelFile, Reference location); 9 | } 10 | -------------------------------------------------------------------------------- /tests/tmdgen/open-api/tmdgen.lock: -------------------------------------------------------------------------------- 1 | # 2 | # ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | # 4 | 5 | version: 1.12.9 6 | generatedFiles: 7 | - ./Petstore/Model.tmd 8 | - ./Petstore/Pet.tmd 9 | - ./Petstore/Store.tmd 10 | - ./Petstore/User.tmd 11 | -------------------------------------------------------------------------------- /TopModel.Core/FileModel/DataFlowReference.cs: -------------------------------------------------------------------------------- 1 | using YamlDotNet.Core.Events; 2 | 3 | namespace TopModel.Core.FileModel; 4 | 5 | public class DataFlowReference : Reference 6 | { 7 | internal DataFlowReference(Scalar scalar) 8 | : base(scalar) { } 9 | } 10 | -------------------------------------------------------------------------------- /TopModel.Utils/LegitException.cs: -------------------------------------------------------------------------------- 1 | namespace TopModel.Utils; 2 | 3 | public class LegitException : Exception 4 | { 5 | public LegitException() 6 | : base() { } 7 | 8 | public LegitException(string message) 9 | : base(message) { } 10 | } 11 | -------------------------------------------------------------------------------- /tests/output/angular/src/main.ts: -------------------------------------------------------------------------------- 1 | import { bootstrapApplication } from '@angular/platform-browser'; 2 | import { appConfig } from './app/app.config'; 3 | import { App } from './app/app'; 4 | 5 | bootstrapApplication(App, appConfig) 6 | .catch((err) => console.error(err)); 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vs 2 | bin 3 | obj 4 | TopModel.VSCode/out 5 | node_modules 6 | language-server 7 | .nupkg 8 | *.user 9 | *.vsix 10 | launchSettings.json 11 | .modgen 12 | 13 | # Intellij Idea 14 | .idea 15 | 16 | # Docker PostgreSQL 17 | postgres-data 18 | .vscode/launch.json 19 | -------------------------------------------------------------------------------- /TopModel.VSCode/dotnet.md: -------------------------------------------------------------------------------- 1 | # Installing .NET 2 | 3 | `TopModel.Generator` is a .NET 8+ application, packaged as a [.NET tool](https://docs.microsoft.com/en-us/dotnet/core/tools/global-tools). 4 | 5 | To use it, you must have the [.NET SDK](https://dotnet.microsoft.com/download) installed on your machine. 6 | -------------------------------------------------------------------------------- /tests/docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | db: 3 | image: postgres:latest 4 | ports: 5 | - 5432:5432 6 | environment: 7 | - POSTGRES_PASSWORD=demo 8 | - POSTGRES_USER=demo 9 | - POSTGRES_DB=demo 10 | volumes: 11 | - ./db/init:/docker-entrypoint-initdb.d -------------------------------------------------------------------------------- /TopModel.Core/FileModel/ClassReference.cs: -------------------------------------------------------------------------------- 1 | using YamlDotNet.Core.Events; 2 | 3 | namespace TopModel.Core.FileModel; 4 | 5 | public class ClassReference : Reference 6 | { 7 | internal ClassReference() { } 8 | 9 | internal ClassReference(Scalar scalar) 10 | : base(scalar) { } 11 | } 12 | -------------------------------------------------------------------------------- /TopModel.Core/FileModel/EndpointReference.cs: -------------------------------------------------------------------------------- 1 | using YamlDotNet.Core.Events; 2 | 3 | namespace TopModel.Core.FileModel; 4 | 5 | public class EndpointReference : Reference 6 | { 7 | internal EndpointReference() { } 8 | 9 | internal EndpointReference(Scalar scalar) 10 | : base(scalar) { } 11 | } 12 | -------------------------------------------------------------------------------- /TopModel.ModelGenerator/Database/config/ModuleConfig.cs: -------------------------------------------------------------------------------- 1 | namespace TopModel.ModelGenerator.Database; 2 | 3 | public class ModuleConfig 4 | { 5 | public required string Name { get; set; } 6 | 7 | public IList Classes { get; set; } = []; 8 | 9 | public IList Tags { get; set; } = []; 10 | } 11 | -------------------------------------------------------------------------------- /TopModel.VSCode/dotnet_fr.md: -------------------------------------------------------------------------------- 1 | # Installation de dotnet 2 | 3 | `TopModel.Generator` est une application .NET 8 ou 9, packagée comme un [outil .NET](https://docs.microsoft.com/en-us/dotnet/core/tools/global-tools). 4 | 5 | Pour l'utiliser, il faut avoir le [SDK .NET](https://dotnet.microsoft.com/download) installé sur votre machine 6 | -------------------------------------------------------------------------------- /tests/output/csharp/src/Models/TopModel.Sample.Restaurant.Models/Domains.cs: -------------------------------------------------------------------------------- 1 | namespace TopModel.Sample.Restaurant.Models; 2 | 3 | public enum Domains 4 | { 5 | Id, 6 | Quantite, 7 | Libelle, 8 | DateHeure, 9 | Booleen, 10 | Code, 11 | Prix, 12 | Liste, 13 | Telephone, 14 | } 15 | -------------------------------------------------------------------------------- /TopModel.LanguageServer/MermaidScope.cs: -------------------------------------------------------------------------------- 1 | namespace TopModel.LanguageServer; 2 | 3 | public enum MermaidScope 4 | { 5 | /** 6 | * A single file 7 | */ 8 | File, 9 | 10 | /** 11 | * Module 12 | */ 13 | Module, 14 | 15 | /** 16 | * Model 17 | */ 18 | Model, 19 | } 20 | -------------------------------------------------------------------------------- /TopModel.Core/FileModel/ParameterReference.cs: -------------------------------------------------------------------------------- 1 | using YamlDotNet.Core.Events; 2 | 3 | namespace TopModel.Core.FileModel; 4 | 5 | public class ParameterReference : Reference 6 | { 7 | internal ParameterReference() 8 | : base() { } 9 | 10 | internal ParameterReference(Scalar scalar) 11 | : base(scalar) { } 12 | } 13 | -------------------------------------------------------------------------------- /TopModel.Generator/ModgenDependency.cs: -------------------------------------------------------------------------------- 1 | using TopModel.Utils; 2 | 3 | namespace TopModel.Generator; 4 | 5 | public record ModgenDependency(string ConfigKey, TopModelLockModule Version) 6 | { 7 | public string FullName => $"TopModel.Generator.{ConfigKey.ToFirstUpper()}"; 8 | 9 | public string? LatestVersion { get; set; } 10 | } 11 | -------------------------------------------------------------------------------- /TopModel.LanguageServer/References.cs: -------------------------------------------------------------------------------- 1 | using TopModel.Core.FileModel; 2 | 3 | namespace TopModel.LanguageServer; 4 | 5 | public class References(object? objet, IEnumerable<(Reference Reference, ModelFile File)> enumerable) 6 | : List<(Reference Reference, ModelFile File)>(enumerable) 7 | { 8 | public object Objet { get; } = objet ?? new(); 9 | } 10 | -------------------------------------------------------------------------------- /TopModel.VSCode/modgen.md: -------------------------------------------------------------------------------- 1 | # Installing TopModel 2 | 3 | Once you have installed .NET, you need to install TopModel.Generator using the following command: 4 | 5 | ```bash 6 | dotnet tool install --global TopModel.Generator 7 | ``` 8 | 9 | Later, to update TopModel, use the command: 10 | 11 | ```bash 12 | dotnet tool update --global TopModel.Generator 13 | ``` 14 | -------------------------------------------------------------------------------- /TopModel.Core/Model/DataFlowSourceMode.cs: -------------------------------------------------------------------------------- 1 | namespace TopModel.Core.Model; 2 | 3 | public enum DataFlowSourceMode 4 | { 5 | /// 6 | /// Implémentation manuelle. 7 | /// 8 | Partial, 9 | 10 | /// 11 | /// Implémentation automatique qui sélectionne tous les éléments. 12 | /// 13 | QueryAll, 14 | } 15 | -------------------------------------------------------------------------------- /TopModel.Generator.Jpa/DataFlowsWriter.cs: -------------------------------------------------------------------------------- 1 | namespace TopModel.Generator.Jpa; 2 | 3 | public enum DataFlowsWriter 4 | { 5 | /// 6 | /// Génération du modèle utilisant spring-batch-bulk 7 | /// 8 | Bulk, 9 | 10 | /// 11 | /// Génération du modèle utilisant jpa-writer 12 | /// 13 | Jpa, 14 | } 15 | -------------------------------------------------------------------------------- /TopModel.Generator.Jpa/ResourcesEncoding.cs: -------------------------------------------------------------------------------- 1 | namespace TopModel.Generator.Jpa; 2 | 3 | public enum ResourcesEncoding 4 | { 5 | /// 6 | /// Génération du modèle utilisant l'api javax 7 | /// 8 | UTF8, 9 | 10 | /// 11 | /// Génération du modèle utilisant l'api jakarta 12 | /// 13 | Latin1, 14 | } 15 | -------------------------------------------------------------------------------- /tests/output/angular/src/app/app.ts: -------------------------------------------------------------------------------- 1 | import { Component, signal } from '@angular/core'; 2 | import { RouterOutlet } from '@angular/router'; 3 | 4 | @Component({ 5 | selector: 'app-root', 6 | imports: [RouterOutlet], 7 | templateUrl: './app.html', 8 | styleUrl: './app.css' 9 | }) 10 | export class App { 11 | protected readonly title = signal('angular'); 12 | } 13 | -------------------------------------------------------------------------------- /.github/release.yml: -------------------------------------------------------------------------------- 1 | changelog: 2 | categories: 3 | - title: Nouvelles fonctionnalités 4 | labels: 5 | - "type: feature" 6 | - title: Corrections de bugs 7 | labels: 8 | - "type: bug" 9 | - title: Amélioration de la documentation 10 | labels: 11 | - "type: documentation" 12 | - title: Autres 13 | labels: 14 | - "*" 15 | -------------------------------------------------------------------------------- /TopModel.Core/Model/IVariableContainer.cs: -------------------------------------------------------------------------------- 1 | using TopModel.Core.FileModel; 2 | 3 | namespace TopModel.Core.Model; 4 | 5 | public interface IVariableContainer 6 | { 7 | IDictionary Variables { get; } 8 | 9 | IEnumerable VariableReferences { get; } 10 | 11 | IEnumerable TransformReferences { get; } 12 | } 13 | -------------------------------------------------------------------------------- /TopModel.LanguageServer/MermaidRequest.cs: -------------------------------------------------------------------------------- 1 | using MediatR; 2 | using OmniSharp.Extensions.JsonRpc; 3 | 4 | namespace TopModel.LanguageServer; 5 | 6 | public class MermaidRequest(string uri, MermaidScope? scope) : IJsonRpcRequest, IRequest 7 | { 8 | public string Uri { get; } = uri; 9 | 10 | public MermaidScope Scope { get; } = scope ?? MermaidScope.File; 11 | } 12 | -------------------------------------------------------------------------------- /tests/output/angular/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Angular 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /TopModel.ModelGenerator/config/DomainMapping.cs: -------------------------------------------------------------------------------- 1 | namespace TopModel.ModelGenerator; 2 | 3 | public class DomainMapping 4 | { 5 | public string? Name { get; set; } 6 | 7 | public string? Type { get; set; } 8 | 9 | public string? Scale { get; set; } 10 | 11 | public string? Precision { get; set; } 12 | 13 | public string Domain { get; set; } = string.Empty; 14 | } 15 | -------------------------------------------------------------------------------- /TopModel.Generator.Sql/TargetDBMS.cs: -------------------------------------------------------------------------------- 1 | namespace TopModel.Generator.Sql; 2 | 3 | public enum TargetDBMS 4 | { 5 | /// 6 | /// SQL Server. 7 | /// 8 | Sqlserver, 9 | 10 | /// 11 | /// PostgreSQL. 12 | /// 13 | Postgre, 14 | 15 | /// 16 | /// Oracle. 17 | /// 18 | Oracle, 19 | } 20 | -------------------------------------------------------------------------------- /TopModel.Utils/IgnoredFile.cs: -------------------------------------------------------------------------------- 1 | namespace TopModel.Utils; 2 | 3 | public class IgnoredFile 4 | { 5 | /// 6 | /// Chemin du fichier à ignorer, relatif au fichier de config. 7 | /// 8 | public required string Path { get; set; } 9 | 10 | /// 11 | /// Motif. 12 | /// 13 | public required string Comment { get; set; } 14 | } 15 | -------------------------------------------------------------------------------- /tests/output/angular/src/app/app.config.ts: -------------------------------------------------------------------------------- 1 | import { ApplicationConfig, provideBrowserGlobalErrorListeners } from '@angular/core'; 2 | import { provideRouter } from '@angular/router'; 3 | 4 | import { routes } from './app.routes'; 5 | 6 | export const appConfig: ApplicationConfig = { 7 | providers: [ 8 | provideBrowserGlobalErrorListeners(), 9 | provideRouter(routes) 10 | ] 11 | }; 12 | -------------------------------------------------------------------------------- /TopModel.VSCode/modgen_fr.md: -------------------------------------------------------------------------------- 1 | # Installation de Topmodel 2 | 3 | Une fois que vous avez installé dotnet, vous devez installer Topmodel.Generator, avec la commande : 4 | 5 | ```bash 6 | dotnet tool install --global TopModel.Generator 7 | ``` 8 | 9 | Par la suite, pour mettre à jour TopModel, utiliser la commande : 10 | 11 | ```bash 12 | dotnet tool update --global TopModel.Generator 13 | ``` 14 | -------------------------------------------------------------------------------- /TopModel.Generator.Javascript/ResourceMode.cs: -------------------------------------------------------------------------------- 1 | namespace TopModel.Generator.Javascript; 2 | 3 | /// 4 | /// Mode de génération du fichier de ressources. 5 | /// 6 | public enum ResourceMode 7 | { 8 | /// 9 | /// Fichier javascript. 10 | /// 11 | JS, 12 | 13 | /// 14 | /// Fichier JSON. 15 | /// 16 | JSON, 17 | } 18 | -------------------------------------------------------------------------------- /TopModel.ModelGenerator/config/ModelGeneratorConfig.cs: -------------------------------------------------------------------------------- 1 | using TopModel.ModelGenerator.Database; 2 | using TopModel.ModelGenerator.OpenApi; 3 | using TopModel.Utils; 4 | 5 | namespace TopModel.ModelGenerator; 6 | 7 | internal class ModelGeneratorConfig : ConfigBase 8 | { 9 | public List OpenApi { get; set; } = []; 10 | 11 | public List Database { get; set; } = []; 12 | } 13 | -------------------------------------------------------------------------------- /TopModel.Core/Model/Implementation/AnnotationImplementation.cs: -------------------------------------------------------------------------------- 1 | using TopModel.Core.FileModel; 2 | 3 | namespace TopModel.Core.Model.Implementation; 4 | 5 | public class AnnotationImplementation 6 | { 7 | public required StringWithVariables Text { get; set; } 8 | 9 | public IList When { get; set; } = []; 10 | 11 | public IList Imports { get; set; } = []; 12 | } 13 | -------------------------------------------------------------------------------- /TopModel.VSCode/src/types.ts: -------------------------------------------------------------------------------- 1 | export type TopModelConfig = { 2 | app: string; 3 | modelRoot?: string; 4 | }; 5 | 6 | export class TopModelException { 7 | constructor(public readonly message: string) { } 8 | } 9 | 10 | export type Mermaid = { 11 | diagram: string; 12 | module: string; 13 | fileName: string; 14 | }; 15 | 16 | export type Status = "LOADING" | "ERROR" | "WARNING" | "READY" | "INSTALLING"; -------------------------------------------------------------------------------- /tests/output/angular/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.ts] 12 | quote_type = single 13 | ij_typescript_use_double_quotes = false 14 | 15 | [*.md] 16 | max_line_length = off 17 | trim_trailing_whitespace = false 18 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_uuid_jdbc/daos/restaurant/MenuDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_uuid_jdbc.daos.restaurant; 6 | 7 | import restaurant.jpa_uuid_jdbc.entities.restaurant.Menu; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface MenuDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_uuid_jdbc/daos/restaurant/PlatDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_uuid_jdbc.daos.restaurant; 6 | 7 | import restaurant.jpa_uuid_jdbc.entities.restaurant.Plat; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface PlatDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /TopModel.Core/Model/Implementation/DecoratorImplementation.cs: -------------------------------------------------------------------------------- 1 | using TopModel.Core.FileModel; 2 | 3 | namespace TopModel.Core.Model.Implementation; 4 | 5 | public class DecoratorImplementation 6 | { 7 | public StringWithVariables? Extends { get; internal set; } 8 | 9 | public IList Implements { get; set; } = []; 10 | 11 | public IList Imports { get; set; } = []; 12 | } 13 | -------------------------------------------------------------------------------- /TopModel.Core/Model/Implementation/ValueTemplate.cs: -------------------------------------------------------------------------------- 1 | using TopModel.Core.FileModel; 2 | 3 | namespace TopModel.Core.Model.Implementation; 4 | 5 | public class ValueTemplate 6 | { 7 | public const string Default = "$$default$$"; 8 | 9 | #nullable disable 10 | public StringWithVariables Value { get; set; } 11 | 12 | #nullable enable 13 | 14 | public IList Imports { get; set; } = []; 15 | } 16 | -------------------------------------------------------------------------------- /TopModel.LanguageServer/ModelConfigExtensions.cs: -------------------------------------------------------------------------------- 1 | using OmniSharp.Extensions.LanguageServer.Protocol.Models; 2 | using TopModel.Core; 3 | 4 | namespace TopModel.LanguageServer; 5 | 6 | public static class ModelConfigExtensions 7 | { 8 | public static TextDocumentSelector GetDocumentSelector(this ModelConfig config) 9 | { 10 | return TextDocumentSelector.ForPattern($"{config.ModelRoot}/**/*.tmd"); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_uuid_jdbc/daos/restaurant/ClientDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_uuid_jdbc.daos.restaurant; 6 | 7 | import restaurant.jpa_uuid_jdbc.entities.restaurant.Client; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface ClientDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /TopModel.Core/FileModel/DomainReference.cs: -------------------------------------------------------------------------------- 1 | using YamlDotNet.Core.Events; 2 | 3 | namespace TopModel.Core.FileModel; 4 | 5 | public class DomainReference : Reference 6 | { 7 | internal DomainReference(Scalar scalar) 8 | : base(scalar) { } 9 | 10 | public IDictionary ParameterReferences { get; set; } = 11 | new Dictionary(); 12 | } 13 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_identity_enums/daos/restaurant/MenuDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_identity_enums.daos.restaurant; 6 | 7 | import restaurant.jpa_identity_enums.entities.restaurant.Menu; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface MenuDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_identity_enums/daos/restaurant/PlatDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_identity_enums.daos.restaurant; 6 | 7 | import restaurant.jpa_identity_enums.entities.restaurant.Plat; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface PlatDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_uuid_jdbc/daos/restaurant/EmployeDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_uuid_jdbc.daos.restaurant; 6 | 7 | import restaurant.jpa_uuid_jdbc.entities.restaurant.Employe; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface EmployeDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /TopModel.Core/FileModel/ModelFileOptions.cs: -------------------------------------------------------------------------------- 1 | #pragma warning disable MA0048 2 | 3 | namespace TopModel.Core.FileModel; 4 | 5 | public class ModelFileOptions 6 | { 7 | public EndpointOptions Endpoints { get; set; } = new(); 8 | } 9 | 10 | public class EndpointOptions 11 | { 12 | #nullable disable 13 | public string FileName { get; set; } 14 | 15 | #nullable enable 16 | 17 | public LocatedString? Prefix { get; set; } 18 | } 19 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_uuid_jdbc/daos/restaurant/CommandeDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_uuid_jdbc.daos.restaurant; 6 | 7 | import restaurant.jpa_uuid_jdbc.entities.restaurant.Commande; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface CommandeDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_uuid_jdbc/daos/restaurant/PersonneDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_uuid_jdbc.daos.restaurant; 6 | 7 | import restaurant.jpa_uuid_jdbc.entities.restaurant.Personne; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface PersonneDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_uuid_jdbc/daos/restaurant/PromotionDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_uuid_jdbc.daos.restaurant; 6 | 7 | import restaurant.jpa_uuid_jdbc.entities.restaurant.Promotion; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface PromotionDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /TopModel.Core/FileModel/AnnotationReference.cs: -------------------------------------------------------------------------------- 1 | using YamlDotNet.Core.Events; 2 | 3 | namespace TopModel.Core.FileModel; 4 | 5 | public class AnnotationReference : Reference 6 | { 7 | internal AnnotationReference(Scalar scalar) 8 | : base(scalar) { } 9 | 10 | public IDictionary ParameterReferences { get; set; } = 11 | new Dictionary(); 12 | } 13 | -------------------------------------------------------------------------------- /TopModel.Core/FileModel/DecoratorReference.cs: -------------------------------------------------------------------------------- 1 | using YamlDotNet.Core.Events; 2 | 3 | namespace TopModel.Core.FileModel; 4 | 5 | public class DecoratorReference : Reference 6 | { 7 | internal DecoratorReference(Scalar scalar) 8 | : base(scalar) { } 9 | 10 | public IDictionary ParameterReferences { get; set; } = 11 | new Dictionary(); 12 | } 13 | -------------------------------------------------------------------------------- /TopModel.Core/Model/IAnnotationContainer.cs: -------------------------------------------------------------------------------- 1 | using TopModel.Core.FileModel; 2 | 3 | namespace TopModel.Core.Model; 4 | 5 | public interface IAnnotationContainer 6 | { 7 | IList Annotations { get; } 8 | 9 | IList AnnotationReferences { get; } 10 | 11 | IList ExcludedAnnotations { get; } 12 | 13 | IList ExcludedAnnotationReferences { get; } 14 | } 15 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_identity_enums/daos/restaurant/ClientDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_identity_enums.daos.restaurant; 6 | 7 | import restaurant.jpa_identity_enums.entities.restaurant.Client; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface ClientDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_uuid_jdbc/daos/restaurant/AvisClientDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_uuid_jdbc.daos.restaurant; 6 | 7 | import restaurant.jpa_uuid_jdbc.entities.restaurant.AvisClient; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface AvisClientDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_uuid_jdbc/daos/restaurant/RestaurantDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_uuid_jdbc.daos.restaurant; 6 | 7 | import restaurant.jpa_uuid_jdbc.entities.restaurant.Restaurant; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface RestaurantDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /TopModel.ModelGenerator/Database/ConstraintKey.cs: -------------------------------------------------------------------------------- 1 | namespace TopModel.ModelGenerator.Database; 2 | 3 | public class ConstraintKey 4 | { 5 | public required string Name { get; set; } 6 | 7 | public required string TableName { get; set; } 8 | 9 | public required string ColumnName { get; set; } 10 | 11 | public required string ForeignTableName { get; set; } 12 | 13 | public required string ForeignColumnName { get; set; } 14 | } 15 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_identity_enums/daos/restaurant/EmployeDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_identity_enums.daos.restaurant; 6 | 7 | import restaurant.jpa_identity_enums.entities.restaurant.Employe; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface EmployeDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_sequence_metamodel/daos/restaurant/MenuDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_sequence_metamodel.daos.restaurant; 6 | 7 | import restaurant.jpa_sequence_metamodel.entities.restaurant.Menu; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface MenuDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_sequence_metamodel/daos/restaurant/PlatDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_sequence_metamodel.daos.restaurant; 6 | 7 | import restaurant.jpa_sequence_metamodel.entities.restaurant.Plat; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface PlatDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_uuid_jdbc/daos/restaurant/ReservationDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_uuid_jdbc.daos.restaurant; 6 | 7 | import restaurant.jpa_uuid_jdbc.entities.restaurant.Reservation; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface ReservationDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /tests/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Génération des fichiers TopModel 4 | dotnet run --project ../TopModel.Generator -- --check --file ./model/topmodel.config 5 | 6 | # Vérification que la génération s'est bien passée 7 | if [ $? -ne 0 ]; then 8 | echo "Erreur lors de la génération TopModel" 9 | exit 1 10 | fi 11 | 12 | cd output/jpa || exit 1 13 | mvn clean compile --quiet 14 | 15 | cd ../angular 16 | npm run build 17 | 18 | cd ../focus 19 | npm run build -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_identity_enums/daos/restaurant/CommandeDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_identity_enums.daos.restaurant; 6 | 7 | import restaurant.jpa_identity_enums.entities.restaurant.Commande; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface CommandeDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_identity_enums/daos/restaurant/PersonneDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_identity_enums.daos.restaurant; 6 | 7 | import restaurant.jpa_identity_enums.entities.restaurant.Personne; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface PersonneDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_identity_enums/daos/restaurant/PromotionDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_identity_enums.daos.restaurant; 6 | 7 | import restaurant.jpa_identity_enums.entities.restaurant.Promotion; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface PromotionDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_sequence_metamodel/daos/restaurant/ClientDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_sequence_metamodel.daos.restaurant; 6 | 7 | import restaurant.jpa_sequence_metamodel.entities.restaurant.Client; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface ClientDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_uuid_jdbc/daos/restaurant/CategoriePlatDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_uuid_jdbc.daos.restaurant; 6 | 7 | import restaurant.jpa_uuid_jdbc.entities.restaurant.CategoriePlat; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface CategoriePlatDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_identity_associations/daos/restaurant/MenuDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_identity_associations.daos.restaurant; 6 | 7 | import restaurant.jpa_identity_associations.entities.restaurant.Menu; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface MenuDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_identity_associations/daos/restaurant/PlatDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_identity_associations.daos.restaurant; 6 | 7 | import restaurant.jpa_identity_associations.entities.restaurant.Plat; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface PlatDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_identity_enums/daos/restaurant/AvisClientDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_identity_enums.daos.restaurant; 6 | 7 | import restaurant.jpa_identity_enums.entities.restaurant.AvisClient; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface AvisClientDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_identity_enums/daos/restaurant/RestaurantDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_identity_enums.daos.restaurant; 6 | 7 | import restaurant.jpa_identity_enums.entities.restaurant.Restaurant; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface RestaurantDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_sequence_metamodel/daos/restaurant/EmployeDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_sequence_metamodel.daos.restaurant; 6 | 7 | import restaurant.jpa_sequence_metamodel.entities.restaurant.Employe; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface EmployeDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_uuid_jdbc/daos/restaurant/CommandeExportDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_uuid_jdbc.daos.restaurant; 6 | 7 | import restaurant.jpa_uuid_jdbc.entities.restaurant.CommandeExport; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface CommandeExportDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_uuid_jdbc/daos/restaurant/LigneCommandeDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_uuid_jdbc.daos.restaurant; 6 | 7 | import restaurant.jpa_uuid_jdbc.entities.restaurant.LigneCommande; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface LigneCommandeDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_uuid_jdbc/daos/restaurant/StatutCommandeDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_uuid_jdbc.daos.restaurant; 6 | 7 | import restaurant.jpa_uuid_jdbc.entities.restaurant.StatutCommande; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface StatutCommandeDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /TopModel.Generator.Jpa/JavaLanguage/JavaConstructor.cs: -------------------------------------------------------------------------------- 1 | namespace TopModel.Generator.Jpa; 2 | 3 | public class JavaConstructor(string returnType) : JavaMethod(returnType, string.Empty) 4 | { 5 | public override string Signature => 6 | $@"{(!string.IsNullOrEmpty(Visibility) ? $"{Visibility} " : string.Empty)}{(GenericTypes.Count > 0 ? $"<{string.Join(", ", GenericTypes)}> " : string.Empty)}{ReturnType}({string.Join(", ", Parameters.Select(p => p.Declaration))})"; 7 | } 8 | -------------------------------------------------------------------------------- /TopModel.Utils/TopModelLockFile.cs: -------------------------------------------------------------------------------- 1 | namespace TopModel.Utils; 2 | 3 | public class TopModelLockFile 4 | { 5 | public required string Version { get; set; } 6 | 7 | public IDictionary Modules { get; set; } = new Dictionary(); 8 | 9 | public IDictionary Custom { get; set; } = new Dictionary(); 10 | 11 | public IList GeneratedFiles { get; set; } = []; 12 | } 13 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_identity_associations/daos/restaurant/ClientDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_identity_associations.daos.restaurant; 6 | 7 | import restaurant.jpa_identity_associations.entities.restaurant.Client; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface ClientDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_identity_enums/daos/restaurant/MenuPlatDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_identity_enums.daos.restaurant; 6 | 7 | import restaurant.jpa_identity_enums.entities.restaurant.MenuPlat; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface MenuPlatDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_identity_enums/daos/restaurant/ReservationDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_identity_enums.daos.restaurant; 6 | 7 | import restaurant.jpa_identity_enums.entities.restaurant.Reservation; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface ReservationDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_sequence_metamodel/daos/restaurant/CommandeDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_sequence_metamodel.daos.restaurant; 6 | 7 | import restaurant.jpa_sequence_metamodel.entities.restaurant.Commande; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface CommandeDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_sequence_metamodel/daos/restaurant/PersonneDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_sequence_metamodel.daos.restaurant; 6 | 7 | import restaurant.jpa_sequence_metamodel.entities.restaurant.Personne; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface PersonneDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_uuid_jdbc/daos/restaurant/TableRestaurantDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_uuid_jdbc.daos.restaurant; 6 | 7 | import restaurant.jpa_uuid_jdbc.entities.restaurant.TableRestaurant; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface TableRestaurantDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /tests/output/pg/src/06_resources.sql: -------------------------------------------------------------------------------- 1 | ---- 2 | ---- ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | ---- 4 | 5 | -- =========================================================================================== 6 | -- Application Name : Restaurant 7 | -- Script Name : 06_resources.sql 8 | -- Description : Script de création des resources (libellés traduits). 9 | -- =========================================================================================== 10 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_identity_associations/daos/restaurant/EmployeDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_identity_associations.daos.restaurant; 6 | 7 | import restaurant.jpa_identity_associations.entities.restaurant.Employe; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface EmployeDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_sequence_metamodel/daos/restaurant/PromotionDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_sequence_metamodel.daos.restaurant; 6 | 7 | import restaurant.jpa_sequence_metamodel.entities.restaurant.Promotion; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface PromotionDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /TopModel.Generator.Core/ApiGeneration.cs: -------------------------------------------------------------------------------- 1 | namespace TopModel.Generator.Core; 2 | 3 | /// 4 | /// Version de Kinetix. 5 | /// 6 | public static class ApiGeneration 7 | { 8 | /// 9 | /// Gébération d'un client. 10 | /// 11 | public const string Client = nameof(Client); 12 | 13 | /// 14 | /// Génération d'un serveur. 15 | /// 16 | public const string Server = nameof(Server); 17 | } 18 | -------------------------------------------------------------------------------- /TopModel.Generator.Javascript/ReferenceMode.cs: -------------------------------------------------------------------------------- 1 | namespace TopModel.Generator.Javascript; 2 | 3 | /// 4 | /// Mode de génération du fichier de ressources. 5 | /// 6 | public enum ReferenceMode 7 | { 8 | /// 9 | /// Générer la définition des listes de référence. 10 | /// 11 | DEFINITION, 12 | 13 | /// 14 | /// Générer les valeurs listes de références. 15 | /// 16 | VALUES, 17 | } 18 | -------------------------------------------------------------------------------- /TopModel.ModelGenerator/Database/DbColumn.cs: -------------------------------------------------------------------------------- 1 | namespace TopModel.ModelGenerator.Database; 2 | 3 | public class DbColumn 4 | { 5 | public required string TableName { get; set; } 6 | 7 | public required string ColumnName { get; set; } 8 | 9 | public required string DataType { get; set; } 10 | 11 | public required string Precision { get; set; } 12 | 13 | public required string Scale { get; set; } 14 | 15 | public bool Nullable { get; set; } 16 | } 17 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_identity_associations/daos/restaurant/CommandeDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_identity_associations.daos.restaurant; 6 | 7 | import restaurant.jpa_identity_associations.entities.restaurant.Commande; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface CommandeDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_identity_associations/daos/restaurant/PersonneDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_identity_associations.daos.restaurant; 6 | 7 | import restaurant.jpa_identity_associations.entities.restaurant.Personne; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface PersonneDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_identity_enums/daos/restaurant/CommandeExportDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_identity_enums.daos.restaurant; 6 | 7 | import restaurant.jpa_identity_enums.entities.restaurant.CommandeExport; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface CommandeExportDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_identity_enums/daos/restaurant/LigneCommandeDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_identity_enums.daos.restaurant; 6 | 7 | import restaurant.jpa_identity_enums.entities.restaurant.LigneCommande; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface LigneCommandeDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_sequence_metamodel/daos/restaurant/AvisClientDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_sequence_metamodel.daos.restaurant; 6 | 7 | import restaurant.jpa_sequence_metamodel.entities.restaurant.AvisClient; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface AvisClientDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_sequence_metamodel/daos/restaurant/MenuPlatDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_sequence_metamodel.daos.restaurant; 6 | 7 | import restaurant.jpa_sequence_metamodel.entities.restaurant.MenuPlat; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface MenuPlatDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_sequence_metamodel/daos/restaurant/ReservationDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_sequence_metamodel.daos.restaurant; 6 | 7 | import restaurant.jpa_sequence_metamodel.entities.restaurant.Reservation; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface ReservationDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_sequence_metamodel/daos/restaurant/RestaurantDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_sequence_metamodel.daos.restaurant; 6 | 7 | import restaurant.jpa_sequence_metamodel.entities.restaurant.Restaurant; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface RestaurantDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_identity_associations/daos/restaurant/AvisClientDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_identity_associations.daos.restaurant; 6 | 7 | import restaurant.jpa_identity_associations.entities.restaurant.AvisClient; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface AvisClientDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_identity_associations/daos/restaurant/PromotionDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_identity_associations.daos.restaurant; 6 | 7 | import restaurant.jpa_identity_associations.entities.restaurant.Promotion; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface PromotionDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_identity_associations/daos/restaurant/RestaurantDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_identity_associations.daos.restaurant; 6 | 7 | import restaurant.jpa_identity_associations.entities.restaurant.Restaurant; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface RestaurantDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_identity_enums/daos/restaurant/TableRestaurantDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_identity_enums.daos.restaurant; 6 | 7 | import restaurant.jpa_identity_enums.entities.restaurant.TableRestaurant; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface TableRestaurantDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_identity_associations/daos/restaurant/MenuPlatDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_identity_associations.daos.restaurant; 6 | 7 | import restaurant.jpa_identity_associations.entities.restaurant.MenuPlat; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface MenuPlatDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_identity_associations/daos/restaurant/ReservationDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_identity_associations.daos.restaurant; 6 | 7 | import restaurant.jpa_identity_associations.entities.restaurant.Reservation; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface ReservationDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_sequence_metamodel/daos/restaurant/LigneCommandeDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_sequence_metamodel.daos.restaurant; 6 | 7 | import restaurant.jpa_sequence_metamodel.entities.restaurant.LigneCommande; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface LigneCommandeDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /TopModel.Generator.Sql/Procedural/Postgres/PostgresReferenceListGenerator.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Logging; 2 | using TopModel.Utils; 3 | 4 | namespace TopModel.Generator.Sql.Procedural.Postgres; 5 | 6 | public class PostgresReferenceListGenerator( 7 | ILogger logger, 8 | IFileWriterProvider writerProvider 9 | ) : AbstractReferenceListGenerator(logger, writerProvider) 10 | { 11 | public override string Name => "PostgresRefListGen"; 12 | } 13 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_sequence_metamodel/daos/restaurant/CommandeExportDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_sequence_metamodel.daos.restaurant; 6 | 7 | import restaurant.jpa_sequence_metamodel.entities.restaurant.CommandeExport; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface CommandeExportDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /TopModel.Generator.Jpa/build/TopModel.Generator.Jpa.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /TopModel.Generator.Sql/build/TopModel.Generator.Sql.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_identity_associations/daos/restaurant/LigneCommandeDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_identity_associations.daos.restaurant; 6 | 7 | import restaurant.jpa_identity_associations.entities.restaurant.LigneCommande; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface LigneCommandeDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_identity_enums/daos/restaurant/PromotionPlatDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_identity_enums.daos.restaurant; 6 | 7 | import restaurant.jpa_identity_enums.entities.restaurant.PromotionPlat; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface PromotionPlatDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_sequence_metamodel/daos/restaurant/TableRestaurantDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_sequence_metamodel.daos.restaurant; 6 | 7 | import restaurant.jpa_sequence_metamodel.entities.restaurant.TableRestaurant; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface TableRestaurantDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_identity_associations/daos/restaurant/CommandeExportDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_identity_associations.daos.restaurant; 6 | 7 | import restaurant.jpa_identity_associations.entities.restaurant.CommandeExport; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface CommandeExportDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_identity_associations/daos/restaurant/TableRestaurantDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_identity_associations.daos.restaurant; 6 | 7 | import restaurant.jpa_identity_associations.entities.restaurant.TableRestaurant; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface TableRestaurantDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /TopModel.Generator.Csharp/build/TopModel.Generator.Csharp.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /tests/output/csharp/src/Models/TopModel.Sample.Restaurant.Models/TopModel.Sample.Restaurant.Models.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net10.0 4 | enable 5 | enable 6 | true 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_sequence_metamodel/daos/restaurant/PromotionPlatDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_sequence_metamodel.daos.restaurant; 6 | 7 | import restaurant.jpa_sequence_metamodel.entities.restaurant.PromotionPlat; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface PromotionPlatDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /TopModel.Core/Model/AssociationType.cs: -------------------------------------------------------------------------------- 1 | namespace TopModel.Core.Model; 2 | 3 | public enum AssociationType 4 | { 5 | /// 6 | /// Many to one. 7 | /// 8 | ManyToOne, 9 | 10 | /// 11 | /// One to one. 12 | /// 13 | OneToOne, 14 | 15 | /// 16 | /// One to many. 17 | /// 18 | OneToMany, 19 | 20 | /// 21 | /// Many to many. 22 | /// 23 | ManyToMany, 24 | } 25 | -------------------------------------------------------------------------------- /TopModel.Generator.Javascript/build/TopModel.Generator.Javascript.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_identity_associations/daos/restaurant/PromotionPlatDAO.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_identity_associations.daos.restaurant; 6 | 7 | import restaurant.jpa_identity_associations.entities.restaurant.PromotionPlat; 8 | 9 | import topmodel.test.CustomCrudRepository; 10 | 11 | public interface PromotionPlatDAO extends CustomCrudRepository { 12 | } 13 | -------------------------------------------------------------------------------- /TopModel.Generator.Translation/build/TopModel.Generator.Translation.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /tests/output/angular/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */ 2 | /* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */ 3 | { 4 | "extends": "./tsconfig.json", 5 | "compilerOptions": { 6 | "outDir": "./out-tsc/app", 7 | "types": [] 8 | }, 9 | "include": [ 10 | "src/**/*.ts" 11 | ], 12 | "exclude": [ 13 | "src/**/*.spec.ts" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /TopModel.VSCode/src/utils.ts: -------------------------------------------------------------------------------- 1 | const exec = require("child_process").exec; 2 | 3 | export async function execute(command: string) { 4 | return new Promise((resolve, reject) => { 5 | exec(command, function (error: string, stdout: string, stderr: string) { 6 | if (error || stderr !== "") { 7 | reject(error || stderr); 8 | } else { 9 | resolve(stdout); 10 | } 11 | }); 12 | }); 13 | } 14 | 15 | export const isWindows = process.platform === "win32"; -------------------------------------------------------------------------------- /tests/output/angular/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */ 2 | /* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */ 3 | { 4 | "extends": "./tsconfig.json", 5 | "compilerOptions": { 6 | "outDir": "./out-tsc/spec", 7 | "types": [ 8 | "vitest/globals" 9 | ] 10 | }, 11 | "include": [ 12 | "src/**/*.d.ts", 13 | "src/**/*.spec.ts" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /TopModel.Generator.Javascript/EntityMode.cs: -------------------------------------------------------------------------------- 1 | namespace TopModel.Generator.Javascript; 2 | 3 | public enum EntityMode 4 | { 5 | /// 6 | /// Ne pas typer les entités. 7 | /// 8 | UNTYPED, 9 | 10 | /// 11 | /// Typer les entités. 12 | /// 13 | TYPED, 14 | 15 | /// 16 | /// DTO sans entité. 17 | /// 18 | NONE, 19 | 20 | /// 21 | /// Définition d'entités @focus4/entities 22 | /// 23 | FOCUS, 24 | } 25 | -------------------------------------------------------------------------------- /TopModel.Generator.Jpa/JavaLanguage/JavaEnumValue.cs: -------------------------------------------------------------------------------- 1 | namespace TopModel.Generator.Jpa; 2 | 3 | public class JavaEnumValue(string name) 4 | { 5 | public string Name { get; } = name; 6 | public string Comment { get; set; } = string.Empty; 7 | 8 | public IList Imports { get; set; } = []; 9 | 10 | public IList Parameters { get; } = []; 11 | 12 | public override string ToString() 13 | { 14 | return $"{Name}{(Parameters.Count > 0 ? $"({string.Join(", ", Parameters)})" : string.Empty)}"; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /tests/output/csharp/src/Clients/TopModel.Sample.Clients.External/TopModel.Sample.Clients.External.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net10.0 4 | enable 5 | enable 6 | true 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /tests/output/focus/src/model/restaurant/commande-resume.ts: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | import {e, entity, EntityToType} from "@focus4/entities"; 6 | import {DO_ID} from "../../domains"; 7 | 8 | export type CommandeResume = EntityToType; 9 | export type CommandeResumeEntityType = typeof CommandeResumeEntity; 10 | 11 | export const CommandeResumeEntity = entity({ 12 | id: e.field(DO_ID, f => f.optional() 13 | .label("restaurant.commande.id") 14 | ) 15 | }); 16 | -------------------------------------------------------------------------------- /tests/output/focus/vite.config.ts: -------------------------------------------------------------------------------- 1 | import react from "@vitejs/plugin-react"; 2 | import {defineConfig} from "vite"; 3 | import checker from "vite-plugin-checker"; 4 | 5 | import {baseConfig, cssAutoModules} from "@focus4/tooling"; 6 | 7 | export default defineConfig({ 8 | ...baseConfig, 9 | base: "", 10 | plugins: [cssAutoModules(/__style__/), react(), checker({typescript: true})], 11 | server: { 12 | port: 1357, 13 | proxy: { 14 | "/api": {target: "http://localhost:2468"} 15 | } 16 | } 17 | }); 18 | -------------------------------------------------------------------------------- /TopModel.Generator.Core/IdentityMode.cs: -------------------------------------------------------------------------------- 1 | namespace TopModel.Generator.Core; 2 | 3 | public enum IdentityMode 4 | { 5 | /// 6 | /// Pas d'identité. 7 | /// 8 | NONE, 9 | 10 | /// 11 | /// Identité sous forme de séquence. 12 | /// 13 | SEQUENCE, 14 | 15 | /// 16 | /// Identité avec identity de la BDD. 17 | /// 18 | IDENTITY, 19 | 20 | /// 21 | /// Identité sous forme d'UUID. 22 | /// 23 | UUID, 24 | } 25 | -------------------------------------------------------------------------------- /TopModel.ModelGenerator/Database/config/DatabaseSource.cs: -------------------------------------------------------------------------------- 1 | namespace TopModel.ModelGenerator.Database; 2 | 3 | public class DatabaseSource 4 | { 5 | public DbType DbType { get; set; } = DbType.POSTGRESQL; 6 | 7 | public string Host { get; set; } = "localhost"; 8 | 9 | public string Port { get; set; } = "5432"; 10 | 11 | public string DbName { get; set; } = "postgres"; 12 | 13 | public string? User { get; set; } 14 | 15 | public string? Password { get; set; } 16 | 17 | public string Schema { get; set; } = "public"; 18 | } 19 | -------------------------------------------------------------------------------- /TopModel.ModelGenerator/Database/config/DbType.cs: -------------------------------------------------------------------------------- 1 | namespace TopModel.ModelGenerator; 2 | 3 | public enum DbType 4 | { 5 | /// 6 | /// Base de données Posgresql 7 | /// 8 | POSTGRESQL, 9 | 10 | /// 11 | /// Base de données Oracle 12 | /// 13 | ORACLE, 14 | 15 | /// 16 | /// Base de données MySql 17 | /// 18 | MYSQL, 19 | 20 | /// 21 | /// Base de données MS SQL Server 22 | /// 23 | MSSQL, 24 | } 25 | -------------------------------------------------------------------------------- /tests/output/angular/src/appgenerated/model/restaurant/commande-resume.ts: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | import {DO_ID} from "@/domains"; 6 | import {e, entity, EntityToType} from "@focus4/entities"; 7 | 8 | export type CommandeResume = EntityToType; 9 | export type CommandeResumeEntityType = typeof CommandeResumeEntity; 10 | 11 | export const CommandeResumeEntity = entity({ 12 | id: e.field(DO_ID, f => f.optional() 13 | .label("restaurant.commande.id") 14 | ) 15 | }); 16 | -------------------------------------------------------------------------------- /tests/output/ssdt/src/init/main.sql: -------------------------------------------------------------------------------- 1 | ---- 2 | ---- ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | ---- 4 | 5 | -- =========================================================================================== 6 | -- Description : Insertion des valeurs de listes statiques. 7 | -- =========================================================================================== 8 | 9 | /* Insertion dans la table CATEGORIE_PLAT. */ 10 | :r .\CATEGORIE_PLAT.insert.sql 11 | 12 | /* Insertion dans la table STATUT_COMMANDE. */ 13 | :r .\STATUT_COMMANDE.insert.sql 14 | 15 | -------------------------------------------------------------------------------- /TopModel.Generator.Translation/GeneratorRegistration.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.DependencyInjection; 2 | using TopModel.Generator.Core; 3 | 4 | namespace TopModel.Generator.Translation; 5 | 6 | public class GeneratorRegistration : IGeneratorRegistration 7 | { 8 | /// 9 | public void Register(IServiceCollection services, TranslationConfig config, int number) 10 | { 11 | services.AddGenerator(config, number); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /TopModel.ModelGenerator/TmdProperty.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | 3 | using Microsoft.OpenApi; 4 | 5 | namespace TopModel.ModelGenerator; 6 | 7 | public class TmdProperty 8 | { 9 | public const string DefaultComment = "Non documenté"; 10 | 11 | public string Name { get; set; } 12 | 13 | public IOpenApiSchema CompositionReference { get; set; } 14 | 15 | public TmdClass Class { get; set; } 16 | 17 | public string Comment { get; set; } = DefaultComment; 18 | 19 | public string Domain { get; set; } 20 | 21 | public bool Required { get; set; } 22 | } 23 | -------------------------------------------------------------------------------- /TopModel.VSCode/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "args": ["--extensionDevelopmentPath=${workspaceFolder}"], 9 | "name": "Launch Extension", 10 | "outFiles": ["${workspaceFolder}/out/**/*"], 11 | "request": "launch", 12 | "type": "extensionHost" 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /tests/output/csharp/src/Clients/TopModel.Sample.Clients.External/Restaurant/MenuClient.partial.cs: -------------------------------------------------------------------------------- 1 | namespace TopModel.Sample.Clients.External.Restaurant; 2 | 3 | /// 4 | /// Client Menu. 5 | /// 6 | public partial class MenuClient 7 | { 8 | private partial Task EnsureAuthentication(CancellationToken ct) 9 | { 10 | return Task.CompletedTask; 11 | } 12 | 13 | private partial Task EnsureSuccess(HttpResponseMessage response, CancellationToken ct) 14 | { 15 | response.EnsureSuccessStatusCode(); 16 | return Task.CompletedTask; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_sequence_metamodel/enums/restaurant/CategoriePlatCode.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_sequence_metamodel.enums.restaurant; 6 | 7 | /** 8 | * Enumération des valeurs possibles de la propriété Code de la classe CategoriePlat. 9 | */ 10 | public enum CategoriePlatCode { 11 | /** 12 | * Boisson. 13 | */ 14 | BOISSON, 15 | /** 16 | * Dessert. 17 | */ 18 | DESSERT, 19 | /** 20 | * Entrée. 21 | */ 22 | ENTREE, 23 | /** 24 | * Plat principal. 25 | */ 26 | PLAT 27 | } 28 | -------------------------------------------------------------------------------- /tests/output/csharp/src/Clients/TopModel.Sample.Clients.External/Restaurant/CommandeClient.partial.cs: -------------------------------------------------------------------------------- 1 | namespace TopModel.Sample.Clients.External.Restaurant; 2 | 3 | /// 4 | /// Client Commande. 5 | /// 6 | public partial class CommandeClient 7 | { 8 | private partial Task EnsureAuthentication(CancellationToken ct) 9 | { 10 | return Task.CompletedTask; 11 | } 12 | 13 | private partial Task EnsureSuccess(HttpResponseMessage response, CancellationToken ct) 14 | { 15 | response.EnsureSuccessStatusCode(); 16 | return Task.CompletedTask; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/output/csharp/src/Clients/TopModel.Sample.Clients.External/Restaurant/PersonneClient.partial.cs: -------------------------------------------------------------------------------- 1 | namespace TopModel.Sample.Clients.External.Restaurant; 2 | 3 | /// 4 | /// Client Personne. 5 | /// 6 | public partial class PersonneClient 7 | { 8 | private partial Task EnsureAuthentication(CancellationToken ct) 9 | { 10 | return Task.CompletedTask; 11 | } 12 | 13 | private partial Task EnsureSuccess(HttpResponseMessage response, CancellationToken ct) 14 | { 15 | response.EnsureSuccessStatusCode(); 16 | return Task.CompletedTask; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/output/csharp/src/Clients/TopModel.Sample.Clients.External/Restaurant/RestaurantClient.partial.cs: -------------------------------------------------------------------------------- 1 | namespace TopModel.Sample.Clients.External.Restaurant; 2 | 3 | /// 4 | /// Client Restaurant. 5 | /// 6 | public partial class RestaurantClient 7 | { 8 | private partial Task EnsureAuthentication(CancellationToken ct) 9 | { 10 | return Task.CompletedTask; 11 | } 12 | 13 | private partial Task EnsureSuccess(HttpResponseMessage response, CancellationToken ct) 14 | { 15 | response.EnsureSuccessStatusCode(); 16 | return Task.CompletedTask; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_identity_associations/enums/restaurant/CategoriePlatCode.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_identity_associations.enums.restaurant; 6 | 7 | /** 8 | * Enumération des valeurs possibles de la propriété Code de la classe CategoriePlat. 9 | */ 10 | public enum CategoriePlatCode { 11 | /** 12 | * Boisson. 13 | */ 14 | BOISSON, 15 | /** 16 | * Dessert. 17 | */ 18 | DESSERT, 19 | /** 20 | * Entrée. 21 | */ 22 | ENTREE, 23 | /** 24 | * Plat principal. 25 | */ 26 | PLAT 27 | } 28 | -------------------------------------------------------------------------------- /TopModel.VSCode/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "parser": "@typescript-eslint/parser", 4 | "parserOptions": { 5 | "ecmaVersion": 6, 6 | "sourceType": "module" 7 | }, 8 | "plugins": [ 9 | "@typescript-eslint" 10 | ], 11 | "rules": { 12 | "@typescript-eslint/naming-convention": "warn", 13 | "@typescript-eslint/semi": "warn", 14 | "curly": "warn", 15 | "eqeqeq": "warn", 16 | "no-throw-literal": "warn", 17 | "semi": "off" 18 | }, 19 | "ignorePatterns": [ 20 | "out", 21 | "dist", 22 | "**/*.d.ts" 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /tests/output/csharp/src/TopModel.Sample.Api/TopModel.Sample.Api.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net10.0 4 | enable 5 | enable 6 | true 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /TopModel.Core/Model/FlowHook.cs: -------------------------------------------------------------------------------- 1 | namespace TopModel.Core.Model; 2 | 3 | public enum FlowHook 4 | { 5 | /// 6 | /// Avant le flow. 7 | /// 8 | BeforeFlow, 9 | 10 | /// 11 | /// Après le chargement de la source. 12 | /// 13 | AfterSource, 14 | 15 | /// 16 | /// Au mapping source => target. 17 | /// 18 | Map, 19 | 20 | /// 21 | /// Avant la target. 22 | /// 23 | BeforeTarget, 24 | 25 | /// 26 | /// Après le flow. 27 | /// 28 | AfterFlow, 29 | } 30 | -------------------------------------------------------------------------------- /TopModel.Core/Model/TemplateParameter.cs: -------------------------------------------------------------------------------- 1 | using TopModel.Core.FileModel; 2 | 3 | namespace TopModel.Core.Model; 4 | 5 | public class TemplateParameter 6 | { 7 | public required LocatedString Name { get; set; } 8 | 9 | public required string Comment { get; set; } 10 | 11 | public bool Required { get; set; } 12 | 13 | public string DefaultValue { get; set; } = string.Empty; 14 | 15 | public Annotation? Annotation { get; set; } 16 | 17 | public Decorator? Decorator { get; set; } 18 | 19 | public Domain? Domain { get; set; } 20 | 21 | public string Description => $"**{Name}** ({Comment})"; 22 | } 23 | -------------------------------------------------------------------------------- /TopModel.Generator.Javascript/TargetFramework.cs: -------------------------------------------------------------------------------- 1 | namespace TopModel.Generator.Javascript; 2 | 3 | public enum TargetFramework 4 | { 5 | /// 6 | /// Fetch. 7 | /// 8 | FETCH, 9 | 10 | /// 11 | /// Angular. 12 | /// 13 | ANGULAR, 14 | 15 | /// 16 | /// Angular that return Promise instead of Observable. 17 | /// 18 | ANGULAR_PROMISE, 19 | 20 | /// 21 | /// Nuxt. 22 | /// 23 | NUXT, 24 | 25 | /// 26 | /// Legacy. 27 | /// 28 | LEGACY, 29 | } 30 | -------------------------------------------------------------------------------- /.github/workflows/dotnet.yml: -------------------------------------------------------------------------------- 1 | name: Publish TopModel.* 2 | 3 | on: 4 | push: 5 | paths: 6 | - "**/*.csproj" 7 | 8 | jobs: 9 | build_and_deploy: 10 | runs-on: ubuntu-latest 11 | if: github.ref == 'refs/heads/develop' 12 | 13 | steps: 14 | - uses: actions/checkout@v2 15 | 16 | - name: Setup .NET 17 | uses: actions/setup-dotnet@v1 18 | with: 19 | dotnet-version: 10.0.x 20 | 21 | - name: Pack 22 | run: dotnet pack 23 | 24 | - name: Publish 25 | run: dotnet nuget push .nupkg/*.nupkg --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json --skip-duplicate 26 | -------------------------------------------------------------------------------- /TopModel.Core/Model/Namespace.cs: -------------------------------------------------------------------------------- 1 | using TopModel.Utils; 2 | 3 | namespace TopModel.Core.Model; 4 | 5 | public struct Namespace 6 | { 7 | public string App { get; set; } 8 | 9 | public string Module { get; set; } 10 | 11 | public string ModuleFlat => Module.Replace(".", string.Empty); 12 | 13 | public string ModuleCamel => string.Join('.', Module.Split('.').Select(m => m.ToCamelCase())); 14 | 15 | public string ModulePath => Module.Replace('.', Path.DirectorySeparatorChar); 16 | 17 | public string ModulePathKebab => 18 | string.Join(Path.DirectorySeparatorChar, Module.Split('.').Select(m => m.ToKebabCase())); 19 | } 20 | -------------------------------------------------------------------------------- /tests/output/focus/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | // Général 4 | "lib": ["es2022", "dom"], 5 | "jsx": "react-jsx", 6 | "module": "esnext", 7 | "moduleResolution": "bundler", 8 | "target": "es2022", 9 | "strict": true, 10 | "sourceMap": true, 11 | 12 | // Options additionnelles 13 | "importHelpers": true, 14 | "noFallthroughCasesInSwitch": true, 15 | "noUnusedLocals": true, 16 | "noUnusedParameters": true, 17 | 18 | "skipDefaultLibCheck": true, 19 | "skipLibCheck": true, 20 | "types": [] 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /TopModel.Core/IModelWatcher.cs: -------------------------------------------------------------------------------- 1 | using TopModel.Core.FileModel; 2 | using TopModel.Utils; 3 | 4 | namespace TopModel.Core; 5 | 6 | public interface IModelWatcher 7 | { 8 | string Name { get; } 9 | 10 | int Number { get; } 11 | 12 | string FullName => $"{Name.PadRight(18, '.')}@{Number}"; 13 | 14 | IEnumerable? GeneratedFiles { get; } 15 | 16 | bool Disabled { get; } 17 | 18 | void OnErrors(IDictionary> errors); 19 | 20 | void OnFilesChanged(IEnumerable files, LoggingScope? storeConfig = null); 21 | 22 | void OnFilesDeleted(IEnumerable fileNames); 23 | } 24 | -------------------------------------------------------------------------------- /TopModel.Core/Model/FromMapper.cs: -------------------------------------------------------------------------------- 1 | using OneOf; 2 | using TopModel.Core.FileModel; 3 | 4 | namespace TopModel.Core.Model; 5 | 6 | public class FromMapper 7 | { 8 | public string? Comment { get; set; } 9 | 10 | public IList> Params { get; } = []; 11 | 12 | public IEnumerable ClassParams => Params.Where(p => p.IsT0).Select(p => p.AsT0); 13 | 14 | public IEnumerable PropertyParams => Params.Where(p => p.IsT1).Select(p => p.AsT1); 15 | 16 | #nullable disable 17 | public Class Class { get; set; } 18 | 19 | internal LocatedString Reference { get; set; } 20 | } 21 | -------------------------------------------------------------------------------- /TopModel.Generator.Core/IdentityConfig.cs: -------------------------------------------------------------------------------- 1 | namespace TopModel.Generator.Core; 2 | 3 | /// 4 | /// Paramètres pour la génération de SQL procédural. 5 | /// 6 | public class IdentityConfig 7 | { 8 | /// 9 | /// Mode de génération des séquences. 10 | /// 11 | public IdentityMode Mode { get; set; } = IdentityMode.IDENTITY; 12 | 13 | /// 14 | /// Incrément de la séquence générée 15 | /// 16 | public int? Increment { get; set; } 17 | 18 | /// 19 | /// Début de la séquence générée 20 | /// 21 | public int? Start { get; set; } 22 | } 23 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_uuid_jdbc/dtos/restaurant/CommandeResume.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_uuid_jdbc.dtos.restaurant; 6 | 7 | import jakarta.annotation.Generated; 8 | 9 | /** 10 | * Résumé d'une commande pour liste. 11 | */ 12 | @Generated("TopModel : https://github.com/klee-contrib/topmodel") 13 | public interface CommandeResume { 14 | 15 | /** 16 | * Identifiant de la commande. 17 | */ 18 | Integer getId(); 19 | 20 | /** 21 | * Hydrate values of instance. 22 | * @param id value to set. 23 | */ 24 | void hydrate(Integer id); 25 | } 26 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_identity_enums/dtos/restaurant/CommandeResume.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_identity_enums.dtos.restaurant; 6 | 7 | import jakarta.annotation.Generated; 8 | 9 | /** 10 | * Résumé d'une commande pour liste. 11 | */ 12 | @Generated("TopModel : https://github.com/klee-contrib/topmodel") 13 | public interface CommandeResume { 14 | 15 | /** 16 | * Identifiant de la commande. 17 | */ 18 | Integer getId(); 19 | 20 | /** 21 | * Hydrate values of instance. 22 | * @param id value to set. 23 | */ 24 | void hydrate(Integer id); 25 | } 26 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_sequence_metamodel/enums/restaurant/StatutCommandeCode.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_sequence_metamodel.enums.restaurant; 6 | 7 | /** 8 | * Enumération des valeurs possibles de la propriété Code de la classe StatutCommande. 9 | */ 10 | public enum StatutCommandeCode { 11 | /** 12 | * Annulée. 13 | */ 14 | ANNULE, 15 | /** 16 | * En attente. 17 | */ 18 | EN_ATT, 19 | /** 20 | * En préparation. 21 | */ 22 | EN_PREP, 23 | /** 24 | * Prête. 25 | */ 26 | PRETE, 27 | /** 28 | * Servie. 29 | */ 30 | SERVIE 31 | } 32 | -------------------------------------------------------------------------------- /TopModel.Core/Model/Implementation/ConverterImplementation.cs: -------------------------------------------------------------------------------- 1 | using TopModel.Core.FileModel; 2 | 3 | namespace TopModel.Core.Model.Implementation; 4 | 5 | public class ConverterImplementation 6 | { 7 | /// 8 | /// Implémentation du convertisseur. Accepte les templates. Utiliser {value} pour la valeur du paramètre d'entrée, et {to.type} ou {from.type} pour les propriétés du domaine source ou cible 9 | /// 10 | public required StringWithVariables Text { get; set; } 11 | 12 | /// 13 | /// Imports à ajouter pour utiliser ce décorateur. 14 | /// 15 | public IList Imports { get; set; } = []; 16 | } 17 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_identity_associations/enums/restaurant/StatutCommandeCode.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_identity_associations.enums.restaurant; 6 | 7 | /** 8 | * Enumération des valeurs possibles de la propriété Code de la classe StatutCommande. 9 | */ 10 | public enum StatutCommandeCode { 11 | /** 12 | * Annulée. 13 | */ 14 | ANNULE, 15 | /** 16 | * En attente. 17 | */ 18 | EN_ATT, 19 | /** 20 | * En préparation. 21 | */ 22 | EN_PREP, 23 | /** 24 | * Prête. 25 | */ 26 | PRETE, 27 | /** 28 | * Servie. 29 | */ 30 | SERVIE 31 | } 32 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_sequence_metamodel/dtos/restaurant/CommandeResume.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_sequence_metamodel.dtos.restaurant; 6 | 7 | import jakarta.annotation.Generated; 8 | 9 | /** 10 | * Résumé d'une commande pour liste. 11 | */ 12 | @Generated("TopModel : https://github.com/klee-contrib/topmodel") 13 | public interface CommandeResume { 14 | 15 | /** 16 | * Identifiant de la commande. 17 | */ 18 | Integer getId(); 19 | 20 | /** 21 | * Hydrate values of instance. 22 | * @param id value to set. 23 | */ 24 | void hydrate(Integer id); 25 | } 26 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_identity_associations/dtos/restaurant/CommandeResume.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_identity_associations.dtos.restaurant; 6 | 7 | import jakarta.annotation.Generated; 8 | 9 | /** 10 | * Résumé d'une commande pour liste. 11 | */ 12 | @Generated("TopModel : https://github.com/klee-contrib/topmodel") 13 | public interface CommandeResume { 14 | 15 | /** 16 | * Identifiant de la commande. 17 | */ 18 | Integer getId(); 19 | 20 | /** 21 | * Hydrate values of instance. 22 | * @param id value to set. 23 | */ 24 | void hydrate(Integer id); 25 | } 26 | -------------------------------------------------------------------------------- /TopModel.Generator.Sql/Procedural/Oracle/OracleReferenceListGenerator.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Logging; 2 | using TopModel.Utils; 3 | 4 | namespace TopModel.Generator.Sql.Procedural.Oracle; 5 | 6 | public class OracleReferenceListGenerator( 7 | ILogger logger, 8 | IFileWriterProvider writerProvider 9 | ) : AbstractReferenceListGenerator(logger, writerProvider) 10 | { 11 | public override string Name => "OracleRefListGen"; 12 | 13 | protected override bool ExplicitSequenceNextVal => true; 14 | 15 | protected override string GetNextValCall(string sequenceName) 16 | { 17 | return $"{sequenceName}.nextval"; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /TopModel.VSCode/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # VSCode 2 | 3 | ## 3.6.7 4 | 5 | - [`311757`](https://github.com/klee-contrib/topmodel/commit/311757821e8b7c11ff0a6cd5b1779e210ff2ae76) - VSCode fix texte status bar en cas d'erreur 6 | 7 | ## 3.6.6 8 | 9 | - MAJ Language Server avec la version 3.6.4 de `TopModel.Core` 10 | 11 | ## 3.6.5 12 | 13 | - [`cc46f55`](https://github.com/klee-contrib/topmodel/commit/cc46f5537f9655bd3c09fbf3fb766d421d7a58d0) - [VSCode] Correction gestion buffer récupération de l'historique des versions 14 | 15 | ## 2.6.5 16 | 17 | - [#465](https://github.com/klee-contrib/topmodel/issues/465)🐛 [VSCode] Add Unix compatibility for tool installation check thanks to @oscarcamilopulidop 18 | -------------------------------------------------------------------------------- /TopModel.Core/Model/ClassValue.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | using TopModel.Core.FileModel; 3 | 4 | namespace TopModel.Core.Model; 5 | 6 | public class ClassValue 7 | { 8 | public string Name { get; set; } 9 | 10 | public Class Class { get; set; } 11 | 12 | public Reference Reference { get; set; } 13 | 14 | public IDictionary Value { get; } = new Dictionary(); 15 | 16 | public string ResourceKey => $"{Class.Namespace.ModuleCamel}.{Class.NameCamel}.values.{Name}"; 17 | 18 | public string GetLabel(Class classe) 19 | { 20 | return classe.DefaultProperty != null ? Value[classe.DefaultProperty] : Name; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tests/tmdgen/open-api/tmdgen.config: -------------------------------------------------------------------------------- 1 | openApi: 2 | - module: Petstore 3 | domains: 4 | - type: int64 5 | domain: DO_ID 6 | - type: int32 7 | domain: DO_ENTIER 8 | - type: int32-map 9 | domain: DO_ENTIER_MAP 10 | - type: String 11 | domain: DO_LIBELLE 12 | - type: date-time 13 | domain: DO_DATE_TIME 14 | - type: Boolean 15 | domain: DO_BOOLEAN 16 | - type: String-array 17 | domain: DO_LIBELLE 18 | - type: binary 19 | domain: DO_FILE 20 | - type: list 21 | domain: DO_LIST 22 | source: ./petstore.json 23 | modelTags: 24 | - petstore 25 | endpointTags: 26 | - petstore 27 | -------------------------------------------------------------------------------- /TopModel.ModelGenerator/TmdAssociationProperty.cs: -------------------------------------------------------------------------------- 1 | using TopModel.Utils; 2 | 3 | namespace TopModel.ModelGenerator; 4 | 5 | public class TmdAssociationProperty : TmdRegularProperty 6 | { 7 | #nullable disable 8 | 9 | public TmdClass Association { get; set; } 10 | 11 | #nullable enable 12 | public TmdRegularProperty? ForeignProperty { get; set; } 13 | 14 | public string Role => 15 | Association != Class 16 | ? Name.Replace(Association!.Trigram.ToPascalCase() + ForeignProperty!.Name, string.Empty) 17 | : Name.Replace( 18 | Association.Properties.OfType().First(p => p.PrimaryKey).Name, 19 | string.Empty 20 | ); 21 | } 22 | -------------------------------------------------------------------------------- /tests/output/focus/src/model/restaurant/references.ts: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | export type CategoriePlatCode = "BOISSON" | "DESSERT" | "ENTREE" | "PLAT"; 6 | export interface CategoriePlat { 7 | code: CategoriePlatCode; 8 | libelle: string; 9 | } 10 | export const categoriePlat = {type: {} as CategoriePlat, valueKey: "code", labelKey: "libelle"} as const; 11 | 12 | export type StatutCommandeCode = "ANNULE" | "EN_ATT" | "EN_PREP" | "PRETE" | "SERVIE"; 13 | export interface StatutCommande { 14 | code: StatutCommandeCode; 15 | libelle: string; 16 | } 17 | export const statutCommande = {type: {} as StatutCommande, valueKey: "code", labelKey: "libelle"} as const; 18 | -------------------------------------------------------------------------------- /TopModel.Generator.Core/IGeneratorRegistration.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.DependencyInjection; 2 | 3 | namespace TopModel.Generator.Core; 4 | 5 | /// 6 | /// Interface d'enregistrement d'un générateur. 7 | /// 8 | /// Type de la config du générateur. 9 | public interface IGeneratorRegistration 10 | where T : GeneratorConfigBase 11 | { 12 | /// 13 | /// Enregistre le générateur. 14 | /// 15 | /// ServiceCollection. 16 | /// Config. 17 | /// Numéro de la config. 18 | void Register(IServiceCollection services, T config, int number); 19 | } 20 | -------------------------------------------------------------------------------- /TopModel.VSCode/src/const.ts: -------------------------------------------------------------------------------- 1 | export const SERVER_EXE = "dotnet"; 2 | 3 | export const COMMANDS = { 4 | modgen: "topmodel.modgen", 5 | modgenWatch: "topmodel.modgen.watch", 6 | preview: "topmodel.preview", 7 | findRef: "topmodel.findRef", 8 | releaseNote: "topmodel.releaseNote", 9 | chooseCommand: "topmodel.chooseCommand", 10 | }; 11 | 12 | // Stockage de l'ensemble des commandes disponibles. 13 | // Pour affichage dans une liste déroulante au clic sur la barre de status 14 | export const COMMANDS_OPTIONS: { 15 | [key: string]: { 16 | title: string; 17 | description: string; 18 | detail?: string; 19 | command: (typeof COMMANDS)[keyof typeof COMMANDS]; 20 | }; 21 | } = {}; 22 | -------------------------------------------------------------------------------- /tests/output/ssdt/src/init/CATEGORIE_PLAT.insert.sql: -------------------------------------------------------------------------------- 1 | ---- 2 | ---- ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | ---- 4 | 5 | -- =========================================================================================== 6 | -- Description : Insertion des valeurs de la table CATEGORIE_PLAT. 7 | -- =========================================================================================== 8 | 9 | INSERT INTO CATEGORIE_PLAT(CAT_CODE, CAT_LIBELLE) VALUES(N'ENTREE', N'Entrée'); 10 | INSERT INTO CATEGORIE_PLAT(CAT_CODE, CAT_LIBELLE) VALUES(N'PLAT', N'Plat principal'); 11 | INSERT INTO CATEGORIE_PLAT(CAT_CODE, CAT_LIBELLE) VALUES(N'DESSERT', N'Dessert'); 12 | INSERT INTO CATEGORIE_PLAT(CAT_CODE, CAT_LIBELLE) VALUES(N'BOISSON', N'Boisson'); 13 | GO 14 | -------------------------------------------------------------------------------- /tests/output/csharp/src/Models/TopModel.Sample.Restaurant.Models/RestaurantItem.cs: -------------------------------------------------------------------------------- 1 | namespace TopModel.Sample.Restaurant.Models; 2 | 3 | public class RestaurantItem : IRestaurantItem 4 | { 5 | public int? Id => throw new NotImplementedException(); 6 | 7 | public string? Nom => throw new NotImplementedException(); 8 | 9 | public string? Adresse => throw new NotImplementedException(); 10 | 11 | public string? Telephone => throw new NotImplementedException(); 12 | 13 | public static IRestaurantItem Create( 14 | int? id = null, 15 | string? nom = null, 16 | string? adresse = null, 17 | string? telephone = null 18 | ) 19 | { 20 | throw new NotImplementedException(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tests/output/csharp/src/Models/TopModel.Sample.Restaurant.Models/generated/ICommandeResume.cs: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | namespace TopModel.Sample.Restaurant.Models; 6 | 7 | /// 8 | /// Résumé d'une commande pour liste. 9 | /// 10 | public interface ICommandeResume 11 | { 12 | /// 13 | /// Identifiant de la commande. 14 | /// 15 | int? Id { get; } 16 | 17 | /// 18 | /// Factory pour instancier la classe. 19 | /// 20 | /// Identifiant de la commande. 21 | /// Instance de la classe. 22 | static abstract ICommandeResume Create(int? id = null); 23 | } 24 | -------------------------------------------------------------------------------- /tests/output/csharp/src/Clients/TopModel.Sample.Clients.Db/TopModel.Sample.Clients.Db.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net10.0 4 | enable 5 | enable 6 | true 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /TopModel.VSCode/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "ES2022", 5 | "outDir": "out", 6 | "lib": ["esnext", "DOM"], 7 | "sourceMap": true, 8 | "rootDir": "src", 9 | "strict": true /* enable all strict type-checking options */, 10 | "useDefineForClassFields": true 11 | /* Additional Checks */ 12 | // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ 13 | // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ 14 | // "noUnusedParameters": true, /* Report errors on unused parameters. */ 15 | }, 16 | "exclude": ["node_modules", ".vscode-test"] 17 | } 18 | -------------------------------------------------------------------------------- /TopModel.Core/Model/Implementation/DomainImplementation.cs: -------------------------------------------------------------------------------- 1 | using TopModel.Core.FileModel; 2 | 3 | namespace TopModel.Core.Model.Implementation; 4 | 5 | public class DomainImplementation 6 | { 7 | public StringWithVariables? Type { get; set; } 8 | 9 | public StringWithVariables? GenericType { get; set; } 10 | 11 | public IList Imports { get; set; } = []; 12 | 13 | public IDictionary ValueTemplates { get; set; } = new Dictionary(); 14 | 15 | public ValueTemplate? GetValueTemplate(string value) 16 | { 17 | return ValueTemplates.TryGetValue(value, out var v) ? v 18 | : ValueTemplates.TryGetValue(ValueTemplate.Default, out var v2) ? v2 19 | : null; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /TopModel.Core/Model/DataFlowType.cs: -------------------------------------------------------------------------------- 1 | namespace TopModel.Core.Model; 2 | 3 | public enum DataFlowType 4 | { 5 | /// 6 | /// Insertion simple (bulk insert). 7 | /// 8 | Insert, 9 | 10 | /// 11 | /// Remplacement des données (truncate puis bulk insert). 12 | /// 13 | Replace, 14 | 15 | /// 16 | /// Remplacement des données (truncate cascade puis bulk insert). 17 | /// 18 | HardReplace, 19 | 20 | /// 21 | /// Fusion des données (bulk merge). 22 | /// 23 | Merge, 24 | 25 | /// 26 | /// Fusion des données et désactivation des données non matchées (bulk merge + bulk update) 27 | /// 28 | MergeDisable, 29 | } 30 | -------------------------------------------------------------------------------- /tests/output/focus/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Starter Kit .NET - Focus - Topmodel - Azure 4 | 5 | 6 | 10 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /TopModel.Core/FileModel/Reference.cs: -------------------------------------------------------------------------------- 1 | using YamlDotNet.Core; 2 | using YamlDotNet.Core.Events; 3 | 4 | namespace TopModel.Core.FileModel; 5 | 6 | public class Reference 7 | { 8 | internal Reference() 9 | { 10 | ReferenceName = string.Empty; 11 | Scalar = new Scalar(string.Empty); 12 | } 13 | 14 | internal Reference(Scalar scalar) 15 | { 16 | Start = scalar.Start; 17 | End = scalar.End; 18 | ReferenceName = scalar.Value; 19 | Scalar = scalar; 20 | } 21 | 22 | public Mark Start { get; set; } 23 | 24 | public Mark End { get; set; } 25 | 26 | public string ReferenceName { get; set; } 27 | 28 | public string Position => $"[{Start.Line},{Start.Column}]"; 29 | 30 | internal Scalar Scalar { get; } 31 | } 32 | -------------------------------------------------------------------------------- /tests/output/angular/src/app/app.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | import { App } from './app'; 3 | 4 | describe('App', () => { 5 | beforeEach(async () => { 6 | await TestBed.configureTestingModule({ 7 | imports: [App], 8 | }).compileComponents(); 9 | }); 10 | 11 | it('should create the app', () => { 12 | const fixture = TestBed.createComponent(App); 13 | const app = fixture.componentInstance; 14 | expect(app).toBeTruthy(); 15 | }); 16 | 17 | it('should render title', async () => { 18 | const fixture = TestBed.createComponent(App); 19 | await fixture.whenStable(); 20 | const compiled = fixture.nativeElement as HTMLElement; 21 | expect(compiled.querySelector('h1')?.textContent).toContain('Hello, angular'); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /tests/output/focus/src/domains.ts: -------------------------------------------------------------------------------- 1 | import z from "zod"; 2 | import { domain } from "@focus4/form-toolbox"; 3 | export const DO_BOOLEEN = domain(z.boolean()); 4 | export const DO_CODE = domain(z.string().max(3)); 5 | export const DO_ENTIER = domain(z.number()); 6 | export const DO_CODE_LISTE = domain(z.array(z.string().max(10))); 7 | export const DO_DATE = domain(z.string()); 8 | export const DO_DATE_HEURE = domain(z.string()); 9 | export const DO_EMAIL = domain(z.email()); 10 | export const DO_ID = domain(z.number().positive()); 11 | export const DO_LIBELLE = domain(z.string()); 12 | 13 | export const DO_LISTE = domain(z.array(z.any())); 14 | 15 | export const DO_QUANTITE = domain(z.number()); 16 | 17 | export const DO_PRIX = domain(z.number()); 18 | 19 | export const DO_TELEPHONE = domain(z.string()); 20 | -------------------------------------------------------------------------------- /TopModel.Generator.Jpa/EndpointGeneration/ClientApiMode.cs: -------------------------------------------------------------------------------- 1 | namespace TopModel.Generator.Core; 2 | 3 | /// 4 | /// Version de Kinetix. 5 | /// 6 | public static class ClientApiMode 7 | { 8 | /// 9 | /// Génération d'un client en mode Feign (interface spring controller avec l'annotation Feign). 10 | /// 11 | public const string FeignClient = nameof(FeignClient); 12 | 13 | /// 14 | /// Génération d'un client en mode RestClient (interface Exchange). 15 | /// 16 | public const string RestClient = nameof(RestClient); 17 | 18 | /// 19 | /// Gébération d'un client en mode template (abstract class à initialiser). 20 | /// 21 | public const string RestTemplate = nameof(RestTemplate); 22 | } 23 | -------------------------------------------------------------------------------- /TopModel.Generator.Jpa/JavaLanguage/JavaEnum.cs: -------------------------------------------------------------------------------- 1 | using NuGet.Packaging; 2 | 3 | namespace TopModel.Generator.Jpa; 4 | 5 | public class JavaEnum : JavaClass 6 | { 7 | public JavaEnum(string name) 8 | : base(name) 9 | { 10 | ClassType = "enum"; 11 | } 12 | 13 | public IList Values { get; } = []; 14 | 15 | public JavaEnum Add(JavaEnumValue javaEnumValue) 16 | { 17 | Values.Add(javaEnumValue); 18 | Imports.AddRange(javaEnumValue.Imports); 19 | return this; 20 | } 21 | 22 | public JavaEnum AddRange(IEnumerable javaEnumValues) 23 | { 24 | foreach (var javaEnumValue in javaEnumValues) 25 | { 26 | Add(javaEnumValue); 27 | } 28 | 29 | return this; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_uuid_jdbc/entities/restaurant/CategoriePlat_.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_uuid_jdbc.entities.restaurant; 6 | 7 | import jakarta.annotation.Generated; 8 | import jakarta.persistence.metamodel.SingularAttribute; 9 | import jakarta.persistence.metamodel.StaticMetamodel; 10 | 11 | @StaticMetamodel(CategoriePlat.class) 12 | @Generated("TopModel : https://github.com/klee-contrib/topmodel") 13 | public class CategoriePlat_ { 14 | 15 | public static volatile SingularAttribute code; 16 | 17 | public static volatile SingularAttribute libelle; 18 | 19 | public static final String CODE = "code"; 20 | 21 | public static final String LIBELLE = "libelle"; 22 | } 23 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_uuid_jdbc/entities/restaurant/StatutCommande_.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_uuid_jdbc.entities.restaurant; 6 | 7 | import jakarta.annotation.Generated; 8 | import jakarta.persistence.metamodel.SingularAttribute; 9 | import jakarta.persistence.metamodel.StaticMetamodel; 10 | 11 | @StaticMetamodel(StatutCommande.class) 12 | @Generated("TopModel : https://github.com/klee-contrib/topmodel") 13 | public class StatutCommande_ { 14 | 15 | public static volatile SingularAttribute code; 16 | 17 | public static volatile SingularAttribute libelle; 18 | 19 | public static final String CODE = "code"; 20 | 21 | public static final String LIBELLE = "libelle"; 22 | } 23 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_uuid_jdbc/entities/restaurant/PromotionPlat_.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_uuid_jdbc.entities.restaurant; 6 | 7 | import jakarta.annotation.Generated; 8 | import jakarta.persistence.metamodel.SingularAttribute; 9 | import jakarta.persistence.metamodel.StaticMetamodel; 10 | 11 | @StaticMetamodel(PromotionPlat.class) 12 | @Generated("TopModel : https://github.com/klee-contrib/topmodel") 13 | public class PromotionPlat_ { 14 | 15 | public static volatile SingularAttribute promotion; 16 | 17 | public static volatile SingularAttribute plat; 18 | 19 | public static final String PROMOTION = "promotion"; 20 | 21 | public static final String PLAT = "plat"; 22 | } 23 | -------------------------------------------------------------------------------- /tests/output/ssdt/src/init/STATUT_COMMANDE.insert.sql: -------------------------------------------------------------------------------- 1 | ---- 2 | ---- ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | ---- 4 | 5 | -- =========================================================================================== 6 | -- Description : Insertion des valeurs de la table STATUT_COMMANDE. 7 | -- =========================================================================================== 8 | 9 | INSERT INTO STATUT_COMMANDE(STC_CODE, STC_LIBELLE) VALUES(N'EN_ATT', N'En attente'); 10 | INSERT INTO STATUT_COMMANDE(STC_CODE, STC_LIBELLE) VALUES(N'EN_PREP', N'En préparation'); 11 | INSERT INTO STATUT_COMMANDE(STC_CODE, STC_LIBELLE) VALUES(N'PRETE', N'Prête'); 12 | INSERT INTO STATUT_COMMANDE(STC_CODE, STC_LIBELLE) VALUES(N'SERVIE', N'Servie'); 13 | INSERT INTO STATUT_COMMANDE(STC_CODE, STC_LIBELLE) VALUES(N'ANNULE', N'Annulée'); 14 | GO 15 | -------------------------------------------------------------------------------- /docs/getting-started/00_getting_started.md: -------------------------------------------------------------------------------- 1 | # Tutoriel 2 | 3 | Bienvenue dans ce tutoriel de prise en main de TopModel. Ici vous allez découvrir comment **représenter** un modèle de données basique. A la fin de ce module vous serez capable de : 4 | 5 | - Créer des classes persistées avec des propriétés 6 | - Définir des domaines 7 | - Définir des listes de références 8 | - Associer des classes persistées 9 | - Créer des classes non persistées à l'aide d'alias 10 | - Définir des mappers entre classes non persistées et classes persistées 11 | - Créer des endpoints 12 | - Générer du code 13 | - Utiliser l'extension VSCode 14 | 15 | > Tout au long de ce tutoriel, n'hésitez pas à vous inspirer du [projet d'exemple](https://github.com/klee-contrib/topmodel/tree/develop/docs/exemple). 16 | 17 | [Démarrer tout de suite !](/getting-started/01_intro.md) 18 | -------------------------------------------------------------------------------- /tests/output/angular/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://docs.github.com/get-started/getting-started-with-git/ignoring-files for more about ignoring files. 2 | 3 | # Compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | /bazel-out 8 | 9 | # Node 10 | /node_modules 11 | npm-debug.log 12 | yarn-error.log 13 | 14 | # IDEs and editors 15 | .idea/ 16 | .project 17 | .classpath 18 | .c9/ 19 | *.launch 20 | .settings/ 21 | *.sublime-workspace 22 | 23 | # Visual Studio Code 24 | .vscode/* 25 | !.vscode/settings.json 26 | !.vscode/tasks.json 27 | !.vscode/launch.json 28 | !.vscode/extensions.json 29 | .history/* 30 | 31 | # Miscellaneous 32 | /.angular/cache 33 | .sass-cache/ 34 | /connect.lock 35 | /coverage 36 | /libpeerconnection.log 37 | testem.log 38 | /typings 39 | __screenshots__/ 40 | 41 | # System files 42 | .DS_Store 43 | Thumbs.db 44 | -------------------------------------------------------------------------------- /tests/output/csharp/src/Models/TopModel.Sample.Restaurant.Models/TableItem.cs: -------------------------------------------------------------------------------- 1 | namespace TopModel.Sample.Restaurant.Models; 2 | 3 | public class TableItem : ITableItem 4 | { 5 | public int? Id => throw new NotImplementedException(); 6 | 7 | public string? Numero => throw new NotImplementedException(); 8 | 9 | public int? Capacite => throw new NotImplementedException(); 10 | 11 | public bool? Disponible => throw new NotImplementedException(); 12 | 13 | public int? RestaurantId => throw new NotImplementedException(); 14 | 15 | public static ITableItem Create( 16 | int? id = null, 17 | string? numero = null, 18 | int? capacite = null, 19 | bool? disponible = null, 20 | int? restaurantId = null 21 | ) 22 | { 23 | throw new NotImplementedException(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_identity_enums/entities/restaurant/PromotionPlat_.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_identity_enums.entities.restaurant; 6 | 7 | import jakarta.annotation.Generated; 8 | import jakarta.persistence.metamodel.SingularAttribute; 9 | import jakarta.persistence.metamodel.StaticMetamodel; 10 | 11 | @StaticMetamodel(PromotionPlat.class) 12 | @Generated("TopModel : https://github.com/klee-contrib/topmodel") 13 | public class PromotionPlat_ { 14 | 15 | public static volatile SingularAttribute promotion; 16 | 17 | public static volatile SingularAttribute plat; 18 | 19 | public static final String PROMOTION = "promotion"; 20 | 21 | public static final String PLAT = "plat"; 22 | } 23 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_sequence_metamodel/entities/restaurant/PromotionPlat_.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_sequence_metamodel.entities.restaurant; 6 | 7 | import jakarta.annotation.Generated; 8 | import jakarta.persistence.metamodel.SingularAttribute; 9 | import jakarta.persistence.metamodel.StaticMetamodel; 10 | 11 | @StaticMetamodel(PromotionPlat.class) 12 | @Generated("TopModel : https://github.com/klee-contrib/topmodel") 13 | public class PromotionPlat_ { 14 | 15 | public static volatile SingularAttribute promotion; 16 | 17 | public static volatile SingularAttribute plat; 18 | 19 | public static final String PROMOTION = "promotion"; 20 | 21 | public static final String PLAT = "plat"; 22 | } 23 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_identity_associations/entities/restaurant/PromotionPlat_.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_identity_associations.entities.restaurant; 6 | 7 | import jakarta.annotation.Generated; 8 | import jakarta.persistence.metamodel.SingularAttribute; 9 | import jakarta.persistence.metamodel.StaticMetamodel; 10 | 11 | @StaticMetamodel(PromotionPlat.class) 12 | @Generated("TopModel : https://github.com/klee-contrib/topmodel") 13 | public class PromotionPlat_ { 14 | 15 | public static volatile SingularAttribute promotion; 16 | 17 | public static volatile SingularAttribute plat; 18 | 19 | public static final String PROMOTION = "promotion"; 20 | 21 | public static final String PLAT = "plat"; 22 | } 23 | -------------------------------------------------------------------------------- /TopModel.Generator.Sql/Procedural/SqlServer/SqlServerCrebasGenerator.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Logging; 2 | using TopModel.Utils; 3 | 4 | namespace TopModel.Generator.Sql.Procedural.SqlServer; 5 | 6 | public class SqlServerCrebasGenerator(ILogger logger, IFileWriterProvider writerProvider) 7 | : AbstractCrebasGenerator(logger, writerProvider) 8 | { 9 | public override string Name => "SqlServerCrebasGen"; 10 | 11 | protected override bool SupportsClusteredKey => true; 12 | 13 | /// 14 | /// Gère l'auto-incrémentation des clés primaires en ajoutant identity à la colonne. 15 | /// 16 | /// Flux d'écriture création bases. 17 | protected override void WriteIdentityColumn(IFileWriter writer) 18 | { 19 | writer.Write(" identity(1, 1)"); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /tests/output/focus/src/model/restaurant/client-item.ts: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | import {e, entity, EntityToType} from "@focus4/entities"; 6 | import {DO_ID, DO_LIBELLE} from "../../domains"; 7 | 8 | export type ClientItem = EntityToType; 9 | export type ClientItemEntityType = typeof ClientItemEntity; 10 | 11 | export const ClientItemEntity = entity({ 12 | id: e.field(DO_ID, f => f.optional() 13 | .label("restaurant.clientItem.id") 14 | ), 15 | nom: e.field(DO_LIBELLE, f => f 16 | .label("restaurant.clientItem.nom") 17 | ), 18 | prenom: e.field(DO_LIBELLE, f => f 19 | .label("restaurant.clientItem.prenom") 20 | ), 21 | nomComplet: e.field(DO_LIBELLE, f => f.optional() 22 | .label("restaurant.clientItem.nomComplet") 23 | ) 24 | }); 25 | -------------------------------------------------------------------------------- /tests/output/angular/src/appgenerated/model/restaurant/client-item.ts: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | import {DO_ID, DO_LIBELLE} from "@/domains"; 6 | import {e, entity, EntityToType} from "@focus4/entities"; 7 | 8 | export type ClientItem = EntityToType; 9 | export type ClientItemEntityType = typeof ClientItemEntity; 10 | 11 | export const ClientItemEntity = entity({ 12 | id: e.field(DO_ID, f => f.optional() 13 | .label("restaurant.clientItem.id") 14 | ), 15 | nom: e.field(DO_LIBELLE, f => f 16 | .label("restaurant.clientItem.nom") 17 | ), 18 | prenom: e.field(DO_LIBELLE, f => f 19 | .label("restaurant.clientItem.prenom") 20 | ), 21 | nomComplet: e.field(DO_LIBELLE, f => f.optional() 22 | .label("restaurant.clientItem.nomComplet") 23 | ) 24 | }); 25 | -------------------------------------------------------------------------------- /TopModel.Generator.Sql/Procedural/SqlServer/SqlServerReferenceListGenerator.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Logging; 2 | using TopModel.Utils; 3 | 4 | namespace TopModel.Generator.Sql.Procedural.SqlServer; 5 | 6 | public class SqlServerReferenceListGenerator( 7 | ILogger logger, 8 | IFileWriterProvider writerProvider 9 | ) : AbstractReferenceListGenerator(logger, writerProvider) 10 | { 11 | public override string Name => "SqlServerRefListGen"; 12 | 13 | protected override void WriteInsertEnd(IFileWriter writerInsert) 14 | { 15 | writerInsert.WriteLine("set nocount off;"); 16 | writerInsert.WriteLine(); 17 | } 18 | 19 | protected override void WriteInsertStart(IFileWriter writerInsert) 20 | { 21 | writerInsert.WriteLine("set nocount on;"); 22 | writerInsert.WriteLine(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /tests/output/focus/src/model/restaurant/client-write.ts: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | import {e, entity, EntityToType} from "@focus4/entities"; 6 | import {DO_LIBELLE, DO_LISTE} from "../../domains"; 7 | 8 | export type ClientWrite = EntityToType; 9 | export type ClientWriteEntityType = typeof ClientWriteEntity; 10 | 11 | export const ClientWriteEntity = entity({ 12 | nom: e.field(DO_LIBELLE, f => f 13 | .label("restaurant.personne.nom") 14 | ), 15 | prenom: e.field(DO_LIBELLE, f => f 16 | .label("restaurant.personne.prenom") 17 | ), 18 | email: e.field(DO_LIBELLE, f => f.optional() 19 | .label("restaurant.client.email") 20 | ), 21 | avisClients: e.field(DO_LISTE, f => f.type() 22 | .label("restaurant.client.avisClients") 23 | ) 24 | }); 25 | -------------------------------------------------------------------------------- /tests/output/angular/src/appgenerated/model/restaurant/client-write.ts: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | import {DO_LIBELLE, DO_LISTE} from "@/domains"; 6 | import {e, entity, EntityToType} from "@focus4/entities"; 7 | 8 | export type ClientWrite = EntityToType; 9 | export type ClientWriteEntityType = typeof ClientWriteEntity; 10 | 11 | export const ClientWriteEntity = entity({ 12 | nom: e.field(DO_LIBELLE, f => f 13 | .label("restaurant.personne.nom") 14 | ), 15 | prenom: e.field(DO_LIBELLE, f => f 16 | .label("restaurant.personne.prenom") 17 | ), 18 | email: e.field(DO_LIBELLE, f => f.optional() 19 | .label("restaurant.client.email") 20 | ), 21 | avisClients: e.field(DO_LISTE, f => f.type() 22 | .label("restaurant.client.avisClients") 23 | ) 24 | }); 25 | -------------------------------------------------------------------------------- /TopModel.Generator.Translation/TranslationConfig.cs: -------------------------------------------------------------------------------- 1 | using TopModel.Generator.Core; 2 | 3 | namespace TopModel.Generator.Translation; 4 | 5 | public class TranslationConfig : GeneratorConfigBase 6 | { 7 | /// 8 | /// liste des langues de l'application 9 | /// 10 | public virtual IList Langs { get; set; } = []; 11 | 12 | /// 13 | /// liste des langues de l'application 14 | /// 15 | public virtual string RootPath { get; set; } = "{lang}"; 16 | 17 | public override string[] PropertiesWithTagVariableSupport => [nameof(RootPath)]; 18 | 19 | public override string[] PropertiesWithLangVariableSupport => [nameof(RootPath)]; 20 | 21 | protected override string GetEnumType(string className, string propName, bool isPrimaryKeyDef = false) 22 | { 23 | throw new NotSupportedException(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /TopModel.Core/FileModel/AliasReference.cs: -------------------------------------------------------------------------------- 1 | using YamlDotNet.Core.Events; 2 | 3 | namespace TopModel.Core.FileModel; 4 | 5 | public class AliasReference 6 | { 7 | public ClassReference? ClassReference { get; set; } 8 | 9 | public EndpointReference? EndpointReference { get; set; } 10 | 11 | public DecoratorReference? DecoratorReference { get; set; } 12 | 13 | public Reference ContainerReference => ClassReference ?? (EndpointReference as Reference) ?? DecoratorReference!; 14 | 15 | public IList IncludeReferences { get; } = []; 16 | 17 | public IList ExcludeReferences { get; } = []; 18 | 19 | public void AddExclude(Scalar scalar) 20 | { 21 | ExcludeReferences.Add(new Reference(scalar)); 22 | } 23 | 24 | public void AddInclude(Scalar scalar) 25 | { 26 | IncludeReferences.Add(new Reference(scalar)); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /tests/output/focus/src/model/restaurant/restaurant-item.ts: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | import {e, entity, EntityToType} from "@focus4/entities"; 6 | import {DO_ID, DO_LIBELLE, DO_TELEPHONE} from "../../domains"; 7 | 8 | export type RestaurantItem = EntityToType; 9 | export type RestaurantItemEntityType = typeof RestaurantItemEntity; 10 | 11 | export const RestaurantItemEntity = entity({ 12 | id: e.field(DO_ID, f => f.optional() 13 | .label("restaurant.restaurant.id") 14 | ), 15 | nom: e.field(DO_LIBELLE, f => f 16 | .label("restaurant.restaurant.nom") 17 | ), 18 | adresse: e.field(DO_LIBELLE, f => f.optional() 19 | .label("restaurant.restaurant.adresse") 20 | ), 21 | telephone: e.field(DO_TELEPHONE, f => f.optional() 22 | .label("restaurant.restaurant.telephone") 23 | ) 24 | }); 25 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_uuid_jdbc/entities/restaurant/Client_.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_uuid_jdbc.entities.restaurant; 6 | 7 | import java.util.List; 8 | 9 | import jakarta.annotation.Generated; 10 | import jakarta.persistence.metamodel.ListAttribute; 11 | import jakarta.persistence.metamodel.SingularAttribute; 12 | import jakarta.persistence.metamodel.StaticMetamodel; 13 | 14 | @StaticMetamodel(Client.class) 15 | @Generated("TopModel : https://github.com/klee-contrib/topmodel") 16 | public class Client_ extends Personne_ { 17 | 18 | public static volatile SingularAttribute email; 19 | 20 | public static volatile ListAttribute avisClients; 21 | 22 | public static final String EMAIL = "email"; 23 | 24 | public static final String AVIS_CLIENTS = "avisClients"; 25 | } 26 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_uuid_jdbc/entities/restaurant/MenuPlat_.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_uuid_jdbc.entities.restaurant; 6 | 7 | import jakarta.annotation.Generated; 8 | import jakarta.persistence.metamodel.SingularAttribute; 9 | import jakarta.persistence.metamodel.StaticMetamodel; 10 | 11 | @StaticMetamodel(MenuPlat.class) 12 | @Generated("TopModel : https://github.com/klee-contrib/topmodel") 13 | public class MenuPlat_ { 14 | 15 | public static volatile SingularAttribute menu; 16 | 17 | public static volatile SingularAttribute plat; 18 | 19 | public static volatile SingularAttribute ordre; 20 | 21 | public static final String MENU = "menu"; 22 | 23 | public static final String PLAT = "plat"; 24 | 25 | public static final String ORDRE = "ordre"; 26 | } 27 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_uuid_jdbc/entities/restaurant/Personne_.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_uuid_jdbc.entities.restaurant; 6 | 7 | import jakarta.annotation.Generated; 8 | import jakarta.persistence.metamodel.SingularAttribute; 9 | import jakarta.persistence.metamodel.StaticMetamodel; 10 | 11 | @StaticMetamodel(Personne.class) 12 | @Generated("TopModel : https://github.com/klee-contrib/topmodel") 13 | public class Personne_ { 14 | 15 | public static volatile SingularAttribute id; 16 | 17 | public static volatile SingularAttribute nom; 18 | 19 | public static volatile SingularAttribute prenom; 20 | 21 | public static final String ID = "id"; 22 | 23 | public static final String NOM = "nom"; 24 | 25 | public static final String PRENOM = "prenom"; 26 | } 27 | -------------------------------------------------------------------------------- /tests/output/csharp/src/Models/TopModel.Sample.Restaurant.Models/CommandeItem.cs: -------------------------------------------------------------------------------- 1 | namespace TopModel.Sample.Restaurant.Models; 2 | 3 | public class CommandeItem : ICommandeItem 4 | { 5 | public int? Id => throw new NotImplementedException(); 6 | 7 | public DateTime? DateCommande => throw new NotImplementedException(); 8 | 9 | public decimal? MontantTotal => throw new NotImplementedException(); 10 | 11 | public StatutCommande.Codes? StatutCommandeCode => throw new NotImplementedException(); 12 | 13 | public int? ClientId => throw new NotImplementedException(); 14 | 15 | public static ICommandeItem Create( 16 | int? id = null, 17 | DateTime? dateCommande = null, 18 | decimal? montantTotal = null, 19 | StatutCommande.Codes? statutCommandeCode = null, 20 | int? clientId = null 21 | ) 22 | { 23 | throw new NotImplementedException(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_identity_enums/entities/restaurant/Client_.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_identity_enums.entities.restaurant; 6 | 7 | import java.util.List; 8 | 9 | import jakarta.annotation.Generated; 10 | import jakarta.persistence.metamodel.ListAttribute; 11 | import jakarta.persistence.metamodel.SingularAttribute; 12 | import jakarta.persistence.metamodel.StaticMetamodel; 13 | 14 | @StaticMetamodel(Client.class) 15 | @Generated("TopModel : https://github.com/klee-contrib/topmodel") 16 | public class Client_ extends Personne_ { 17 | 18 | public static volatile SingularAttribute email; 19 | 20 | public static volatile ListAttribute avisClients; 21 | 22 | public static final String EMAIL = "email"; 23 | 24 | public static final String AVIS_CLIENTS = "avisClients"; 25 | } 26 | -------------------------------------------------------------------------------- /tests/output/angular/src/appgenerated/model/restaurant/restaurant-item.ts: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | import {DO_ID, DO_LIBELLE, DO_TELEPHONE} from "@/domains"; 6 | import {e, entity, EntityToType} from "@focus4/entities"; 7 | 8 | export type RestaurantItem = EntityToType; 9 | export type RestaurantItemEntityType = typeof RestaurantItemEntity; 10 | 11 | export const RestaurantItemEntity = entity({ 12 | id: e.field(DO_ID, f => f.optional() 13 | .label("restaurant.restaurant.id") 14 | ), 15 | nom: e.field(DO_LIBELLE, f => f 16 | .label("restaurant.restaurant.nom") 17 | ), 18 | adresse: e.field(DO_LIBELLE, f => f.optional() 19 | .label("restaurant.restaurant.adresse") 20 | ), 21 | telephone: e.field(DO_TELEPHONE, f => f.optional() 22 | .label("restaurant.restaurant.telephone") 23 | ) 24 | }); 25 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_identity_enums/entities/restaurant/MenuPlat_.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_identity_enums.entities.restaurant; 6 | 7 | import jakarta.annotation.Generated; 8 | import jakarta.persistence.metamodel.SingularAttribute; 9 | import jakarta.persistence.metamodel.StaticMetamodel; 10 | 11 | @StaticMetamodel(MenuPlat.class) 12 | @Generated("TopModel : https://github.com/klee-contrib/topmodel") 13 | public class MenuPlat_ { 14 | 15 | public static volatile SingularAttribute menu; 16 | 17 | public static volatile SingularAttribute plat; 18 | 19 | public static volatile SingularAttribute ordre; 20 | 21 | public static final String MENU = "menu"; 22 | 23 | public static final String PLAT = "plat"; 24 | 25 | public static final String ORDRE = "ordre"; 26 | } 27 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_identity_enums/entities/restaurant/Personne_.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_identity_enums.entities.restaurant; 6 | 7 | import jakarta.annotation.Generated; 8 | import jakarta.persistence.metamodel.SingularAttribute; 9 | import jakarta.persistence.metamodel.StaticMetamodel; 10 | 11 | @StaticMetamodel(Personne.class) 12 | @Generated("TopModel : https://github.com/klee-contrib/topmodel") 13 | public class Personne_ { 14 | 15 | public static volatile SingularAttribute id; 16 | 17 | public static volatile SingularAttribute nom; 18 | 19 | public static volatile SingularAttribute prenom; 20 | 21 | public static final String ID = "id"; 22 | 23 | public static final String NOM = "nom"; 24 | 25 | public static final String PRENOM = "prenom"; 26 | } 27 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_sequence_metamodel/entities/restaurant/Client_.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_sequence_metamodel.entities.restaurant; 6 | 7 | import java.util.List; 8 | 9 | import jakarta.annotation.Generated; 10 | import jakarta.persistence.metamodel.ListAttribute; 11 | import jakarta.persistence.metamodel.SingularAttribute; 12 | import jakarta.persistence.metamodel.StaticMetamodel; 13 | 14 | @StaticMetamodel(Client.class) 15 | @Generated("TopModel : https://github.com/klee-contrib/topmodel") 16 | public class Client_ extends Personne_ { 17 | 18 | public static volatile SingularAttribute email; 19 | 20 | public static volatile ListAttribute avisClients; 21 | 22 | public static final String EMAIL = "email"; 23 | 24 | public static final String AVIS_CLIENTS = "avisClients"; 25 | } 26 | -------------------------------------------------------------------------------- /tests/output/focus/src/model/restaurant/table-write.ts: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | import {e, entity, EntityToType} from "@focus4/entities"; 6 | import {DO_BOOLEEN, DO_CODE, DO_ID, DO_QUANTITE} from "../../domains"; 7 | 8 | export type TableWrite = EntityToType; 9 | export type TableWriteEntityType = typeof TableWriteEntity; 10 | 11 | export const TableWriteEntity = entity({ 12 | numero: e.field(DO_CODE, f => f 13 | .label("restaurant.tableRestaurant.numero") 14 | ), 15 | capacite: e.field(DO_QUANTITE, f => f 16 | .label("restaurant.tableRestaurant.capacite") 17 | ), 18 | disponible: e.field(DO_BOOLEEN, f => f.defaultValue(true) 19 | .label("restaurant.tableRestaurant.disponible") 20 | ), 21 | restaurantId: e.field(DO_ID, f => f 22 | .label("restaurant.tableRestaurant.restaurantId") 23 | ) 24 | }); 25 | -------------------------------------------------------------------------------- /TopModel.ModelGenerator/OpenApi/config/OpenApiConfig.cs: -------------------------------------------------------------------------------- 1 | namespace TopModel.ModelGenerator.OpenApi; 2 | 3 | public class OpenApiConfig 4 | { 5 | private string? _outputDirectory; 6 | 7 | public string OutputDirectory 8 | { 9 | get => _outputDirectory ?? Module; 10 | set => _outputDirectory = value.Replace("{module}", Module); 11 | } 12 | 13 | public string Module { get; set; } = "OpenApi"; 14 | 15 | public IList Domains { get; set; } = []; 16 | 17 | public required string Source { get; set; } 18 | 19 | public string[]? Include { get; set; } 20 | 21 | public IList EndpointTags { get; set; } = []; 22 | 23 | public IList ModelTags { get; set; } = []; 24 | 25 | public string ModelFileName { get; set; } = "Model"; 26 | 27 | public bool PreservePropertyCasing { get; set; } = true; 28 | 29 | public string? ClassPrefix { get; set; } 30 | } 31 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_identity_associations/entities/restaurant/Client_.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_identity_associations.entities.restaurant; 6 | 7 | import java.util.List; 8 | 9 | import jakarta.annotation.Generated; 10 | import jakarta.persistence.metamodel.ListAttribute; 11 | import jakarta.persistence.metamodel.SingularAttribute; 12 | import jakarta.persistence.metamodel.StaticMetamodel; 13 | 14 | @StaticMetamodel(Client.class) 15 | @Generated("TopModel : https://github.com/klee-contrib/topmodel") 16 | public class Client_ extends Personne_ { 17 | 18 | public static volatile SingularAttribute email; 19 | 20 | public static volatile ListAttribute avisClients; 21 | 22 | public static final String EMAIL = "email"; 23 | 24 | public static final String AVIS_CLIENTS = "avisClients"; 25 | } 26 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_sequence_metamodel/entities/restaurant/CategoriePlat_.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_sequence_metamodel.entities.restaurant; 6 | 7 | import jakarta.annotation.Generated; 8 | import jakarta.persistence.metamodel.SingularAttribute; 9 | import jakarta.persistence.metamodel.StaticMetamodel; 10 | 11 | import restaurant.jpa_sequence_metamodel.enums.restaurant.CategoriePlatCode; 12 | 13 | @StaticMetamodel(CategoriePlat.class) 14 | @Generated("TopModel : https://github.com/klee-contrib/topmodel") 15 | public class CategoriePlat_ { 16 | 17 | public static volatile SingularAttribute code; 18 | 19 | public static volatile SingularAttribute libelle; 20 | 21 | public static final String CODE = "code"; 22 | 23 | public static final String LIBELLE = "libelle"; 24 | } 25 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_sequence_metamodel/entities/restaurant/MenuPlat_.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_sequence_metamodel.entities.restaurant; 6 | 7 | import jakarta.annotation.Generated; 8 | import jakarta.persistence.metamodel.SingularAttribute; 9 | import jakarta.persistence.metamodel.StaticMetamodel; 10 | 11 | @StaticMetamodel(MenuPlat.class) 12 | @Generated("TopModel : https://github.com/klee-contrib/topmodel") 13 | public class MenuPlat_ { 14 | 15 | public static volatile SingularAttribute menu; 16 | 17 | public static volatile SingularAttribute plat; 18 | 19 | public static volatile SingularAttribute ordre; 20 | 21 | public static final String MENU = "menu"; 22 | 23 | public static final String PLAT = "plat"; 24 | 25 | public static final String ORDRE = "ordre"; 26 | } 27 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_sequence_metamodel/entities/restaurant/Personne_.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_sequence_metamodel.entities.restaurant; 6 | 7 | import jakarta.annotation.Generated; 8 | import jakarta.persistence.metamodel.SingularAttribute; 9 | import jakarta.persistence.metamodel.StaticMetamodel; 10 | 11 | @StaticMetamodel(Personne.class) 12 | @Generated("TopModel : https://github.com/klee-contrib/topmodel") 13 | public class Personne_ { 14 | 15 | public static volatile SingularAttribute id; 16 | 17 | public static volatile SingularAttribute nom; 18 | 19 | public static volatile SingularAttribute prenom; 20 | 21 | public static final String ID = "id"; 22 | 23 | public static final String NOM = "nom"; 24 | 25 | public static final String PRENOM = "prenom"; 26 | } 27 | -------------------------------------------------------------------------------- /tests/output/angular/src/appgenerated/model/restaurant/table-write.ts: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | import {DO_BOOLEEN, DO_CODE, DO_ID, DO_QUANTITE} from "@/domains"; 6 | import {e, entity, EntityToType} from "@focus4/entities"; 7 | 8 | export type TableWrite = EntityToType; 9 | export type TableWriteEntityType = typeof TableWriteEntity; 10 | 11 | export const TableWriteEntity = entity({ 12 | numero: e.field(DO_CODE, f => f 13 | .label("restaurant.tableRestaurant.numero") 14 | ), 15 | capacite: e.field(DO_QUANTITE, f => f 16 | .label("restaurant.tableRestaurant.capacite") 17 | ), 18 | disponible: e.field(DO_BOOLEEN, f => f.defaultValue(true) 19 | .label("restaurant.tableRestaurant.disponible") 20 | ), 21 | restaurantId: e.field(DO_ID, f => f 22 | .label("restaurant.tableRestaurant.restaurantId") 23 | ) 24 | }); 25 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_identity_associations/entities/restaurant/MenuPlat_.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_identity_associations.entities.restaurant; 6 | 7 | import jakarta.annotation.Generated; 8 | import jakarta.persistence.metamodel.SingularAttribute; 9 | import jakarta.persistence.metamodel.StaticMetamodel; 10 | 11 | @StaticMetamodel(MenuPlat.class) 12 | @Generated("TopModel : https://github.com/klee-contrib/topmodel") 13 | public class MenuPlat_ { 14 | 15 | public static volatile SingularAttribute menu; 16 | 17 | public static volatile SingularAttribute plat; 18 | 19 | public static volatile SingularAttribute ordre; 20 | 21 | public static final String MENU = "menu"; 22 | 23 | public static final String PLAT = "plat"; 24 | 25 | public static final String ORDRE = "ordre"; 26 | } 27 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_identity_associations/entities/restaurant/Personne_.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_identity_associations.entities.restaurant; 6 | 7 | import jakarta.annotation.Generated; 8 | import jakarta.persistence.metamodel.SingularAttribute; 9 | import jakarta.persistence.metamodel.StaticMetamodel; 10 | 11 | @StaticMetamodel(Personne.class) 12 | @Generated("TopModel : https://github.com/klee-contrib/topmodel") 13 | public class Personne_ { 14 | 15 | public static volatile SingularAttribute id; 16 | 17 | public static volatile SingularAttribute nom; 18 | 19 | public static volatile SingularAttribute prenom; 20 | 21 | public static final String ID = "id"; 22 | 23 | public static final String NOM = "nom"; 24 | 25 | public static final String PRENOM = "prenom"; 26 | } 27 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_sequence_metamodel/entities/restaurant/StatutCommande_.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_sequence_metamodel.entities.restaurant; 6 | 7 | import jakarta.annotation.Generated; 8 | import jakarta.persistence.metamodel.SingularAttribute; 9 | import jakarta.persistence.metamodel.StaticMetamodel; 10 | 11 | import restaurant.jpa_sequence_metamodel.enums.restaurant.StatutCommandeCode; 12 | 13 | @StaticMetamodel(StatutCommande.class) 14 | @Generated("TopModel : https://github.com/klee-contrib/topmodel") 15 | public class StatutCommande_ { 16 | 17 | public static volatile SingularAttribute code; 18 | 19 | public static volatile SingularAttribute libelle; 20 | 21 | public static final String CODE = "code"; 22 | 23 | public static final String LIBELLE = "libelle"; 24 | } 25 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_identity_associations/entities/restaurant/CategoriePlat_.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_identity_associations.entities.restaurant; 6 | 7 | import jakarta.annotation.Generated; 8 | import jakarta.persistence.metamodel.SingularAttribute; 9 | import jakarta.persistence.metamodel.StaticMetamodel; 10 | 11 | import restaurant.jpa_identity_associations.enums.restaurant.CategoriePlatCode; 12 | 13 | @StaticMetamodel(CategoriePlat.class) 14 | @Generated("TopModel : https://github.com/klee-contrib/topmodel") 15 | public class CategoriePlat_ { 16 | 17 | public static volatile SingularAttribute code; 18 | 19 | public static volatile SingularAttribute libelle; 20 | 21 | public static final String CODE = "code"; 22 | 23 | public static final String LIBELLE = "libelle"; 24 | } 25 | -------------------------------------------------------------------------------- /TopModel.Core/Model/Implementation/AnnotationConstraint.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace TopModel.Core.Model.Implementation; 4 | 5 | public enum AnnotationConstraint 6 | { 7 | /// 8 | /// Objet non persisté. 9 | /// 10 | [EnumMember(Value = "non-persisted")] 11 | NonPersisted, 12 | 13 | /// 14 | /// Objet persisté. 15 | /// 16 | [EnumMember(Value = "persisted")] 17 | Persisted, 18 | 19 | /// 20 | /// Propriété de classe. 21 | /// 22 | [EnumMember(Value = "class-property")] 23 | ClassProperty, 24 | 25 | /// 26 | /// Paramètre d'endpoint. 27 | /// 28 | [EnumMember(Value = "endpoint-param")] 29 | EndpointParam, 30 | 31 | /// 32 | /// Clé primaire. 33 | /// 34 | [EnumMember(Value = "primary-key")] 35 | PrimaryKey, 36 | } 37 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_identity_associations/entities/restaurant/StatutCommande_.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_identity_associations.entities.restaurant; 6 | 7 | import jakarta.annotation.Generated; 8 | import jakarta.persistence.metamodel.SingularAttribute; 9 | import jakarta.persistence.metamodel.StaticMetamodel; 10 | 11 | import restaurant.jpa_identity_associations.enums.restaurant.StatutCommandeCode; 12 | 13 | @StaticMetamodel(StatutCommande.class) 14 | @Generated("TopModel : https://github.com/klee-contrib/topmodel") 15 | public class StatutCommande_ { 16 | 17 | public static volatile SingularAttribute code; 18 | 19 | public static volatile SingularAttribute libelle; 20 | 21 | public static final String CODE = "code"; 22 | 23 | public static final String LIBELLE = "libelle"; 24 | } 25 | -------------------------------------------------------------------------------- /TopModel.Utils/GeneratedFileWriterProvider.cs: -------------------------------------------------------------------------------- 1 | using System.Text; 2 | using Microsoft.Extensions.Logging; 3 | 4 | namespace TopModel.Utils; 5 | 6 | /// 7 | /// Implémentation par défaut de IFileWriterProvider. 8 | /// 9 | public class GeneratedFileWriterProvider(ConfigBase config) : IFileWriterProvider 10 | { 11 | /// 12 | public IFileWriter OpenFileWriter(string fileName, ILogger logger, bool encoderShouldEmitUTF8Identifier = true) 13 | { 14 | return new GeneratedFileWriter(config, fileName, logger, encoderShouldEmitUTF8Identifier); 15 | } 16 | 17 | /// 18 | public IFileWriter OpenFileWriter(string fileName, ILogger logger, Encoding encoding) 19 | { 20 | return new GeneratedFileWriter(config, fileName, logger, encoding); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tests/output/csharp/src/Models/TopModel.Sample.Restaurant.Models/PlatItem.cs: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | namespace TopModel.Sample.Restaurant.Models; 6 | 7 | public class PlatItem : IPlatItem 8 | { 9 | public int? Id => throw new NotImplementedException(); 10 | 11 | public string? Nom => throw new NotImplementedException(); 12 | 13 | public decimal? Prix => throw new NotImplementedException(); 14 | 15 | public bool? Disponible => throw new NotImplementedException(); 16 | 17 | public CategoriePlat.Codes? CategoriePlatCode => throw new NotImplementedException(); 18 | 19 | public static IPlatItem Create( 20 | int? id = null, 21 | string? nom = null, 22 | decimal? prix = null, 23 | bool? disponible = null, 24 | CategoriePlat.Codes? categoriePlatCode = null 25 | ) 26 | { 27 | throw new NotImplementedException(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /TopModel.ModelGenerator/TmdFile.cs: -------------------------------------------------------------------------------- 1 | namespace TopModel.ModelGenerator; 2 | 3 | public class TmdFile 4 | { 5 | public required string Name { get; set; } 6 | 7 | public IList Tags { get; set; } = []; 8 | 9 | public IList Classes { get; set; } = []; 10 | 11 | public IList Endpoints { get; set; } = []; 12 | 13 | public string? Module { get; set; } 14 | 15 | public string? Path { get; set; } 16 | 17 | public IList Uses => 18 | Classes 19 | .SelectMany(c => c.Dependencies) 20 | .Where(d => d.File != this) 21 | .Concat(Endpoints.SelectMany(e => e.Dependencies)) 22 | .Where(c => c.File != null) 23 | .Select(f => f!.File!) 24 | .Distinct() 25 | .OrderBy(u => u.Name) 26 | .ToList(); 27 | 28 | public IList ExtendedUses => Uses.Concat(Uses.SelectMany(u => u.ExtendedUses)).Distinct().ToList(); 29 | } 30 | -------------------------------------------------------------------------------- /TopModel.Core/Loaders/YamlUtils/ReferenceTypeConverter.cs: -------------------------------------------------------------------------------- 1 | using TopModel.Core.FileModel; 2 | using YamlDotNet.Core; 3 | using YamlDotNet.Core.Events; 4 | using YamlDotNet.Serialization; 5 | 6 | namespace TopModel.Core.Loaders.YamlUtils; 7 | 8 | internal class ReferenceTypeConverter : IYamlTypeConverter 9 | { 10 | /// 11 | public bool Accepts(Type type) 12 | { 13 | return type == typeof(ParameterReference); 14 | } 15 | 16 | /// 17 | public object? ReadYaml(IParser parser, Type type, ObjectDeserializer rootDeserializer) 18 | { 19 | return new ParameterReference(parser.Consume()); 20 | } 21 | 22 | /// 23 | public void WriteYaml(IEmitter emitter, object? value, Type type, ObjectSerializer serializer) 24 | { 25 | throw new NotSupportedException(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /TopModel.Core/Model/ReverseAssociationDefinition.cs: -------------------------------------------------------------------------------- 1 | using TopModel.Core.FileModel; 2 | 3 | namespace TopModel.Core.Model; 4 | 5 | public class ReverseAssociationDefinition : IAnnotationContainer 6 | { 7 | public required AssociationProperty Property { get; set; } 8 | 9 | public string? ClassName { get; set; } 10 | 11 | public string? Label { get; set; } 12 | 13 | public string? Comment { get; set; } 14 | 15 | public IList Annotations { get; } = []; 16 | 17 | public IList AnnotationReferences { get; } = []; 18 | 19 | public IList ExcludedAnnotations { get; } = []; 20 | 21 | public IList ExcludedAnnotationReferences { get; } = []; 22 | 23 | #nullable disable 24 | internal Reference Location { get; set; } 25 | 26 | #nullable enable 27 | 28 | public override string ToString() 29 | { 30 | return $"Reverse{Property?.Name}"; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /TopModel.LanguageServer/ModelFileCache.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Concurrent; 2 | 3 | namespace TopModel.LanguageServer; 4 | 5 | public class ModelFileCache 6 | { 7 | private readonly ConcurrentDictionary _fileCache = new(); 8 | 9 | public string[] GetFile(string filePath) 10 | { 11 | return _fileCache[filePath]; 12 | } 13 | 14 | public void UpdateFile(string filePath, string content) 15 | { 16 | var lines = SplitToLines(content).ToArray(); 17 | _fileCache.AddOrUpdate(filePath, lines, (_, _) => lines); 18 | } 19 | 20 | private static IEnumerable SplitToLines(string input) 21 | { 22 | if (input == null) 23 | { 24 | yield break; 25 | } 26 | 27 | using var reader = new StringReader(input); 28 | string? line; 29 | while ((line = reader.ReadLine()) != null) 30 | { 31 | yield return line; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /tests/output/focus/src/model/restaurant/client-read.ts: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | import {e, entity, EntityToType} from "@focus4/entities"; 6 | import {DO_ID, DO_LIBELLE, DO_LISTE} from "../../domains"; 7 | 8 | export type ClientRead = EntityToType; 9 | export type ClientReadEntityType = typeof ClientReadEntity; 10 | 11 | export const ClientReadEntity = entity({ 12 | id: e.field(DO_ID, f => f.optional() 13 | .label("restaurant.personne.id") 14 | ), 15 | nom: e.field(DO_LIBELLE, f => f 16 | .label("restaurant.personne.nom") 17 | ), 18 | prenom: e.field(DO_LIBELLE, f => f 19 | .label("restaurant.personne.prenom") 20 | ), 21 | email: e.field(DO_LIBELLE, f => f.optional() 22 | .label("restaurant.client.email") 23 | ), 24 | avisClients: e.field(DO_LISTE, f => f.type() 25 | .label("restaurant.client.avisClients") 26 | ) 27 | }); 28 | -------------------------------------------------------------------------------- /TopModel.Utils/ConfigBase.cs: -------------------------------------------------------------------------------- 1 | namespace TopModel.Utils; 2 | 3 | #nullable disable 4 | 5 | /// 6 | /// Configuration commune aux générateurs. 7 | /// 8 | public class ConfigBase 9 | { 10 | /// 11 | /// Répertoire contenant le fichier de config. 12 | /// 13 | public string ConfigRoot { get; set; } 14 | 15 | /// 16 | /// Racine du modèle. 17 | /// 18 | public string ModelRoot { get; set; } 19 | 20 | /// 21 | /// Nom du lockfile. 22 | /// 23 | public string LockFileName { get; set; } 24 | 25 | /// 26 | /// Liste des fichiers à ignorer après première génération (relatif au fichier de config). 27 | /// 28 | public IList IgnoredFiles { get; set; } = []; 29 | 30 | /// 31 | /// Liste des warnings à ignorer. 32 | /// 33 | public IList NoWarn { get; set; } = []; 34 | } 35 | -------------------------------------------------------------------------------- /tests/output/angular/src/appgenerated/model/restaurant/client-read.ts: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | import {DO_ID, DO_LIBELLE, DO_LISTE} from "@/domains"; 6 | import {e, entity, EntityToType} from "@focus4/entities"; 7 | 8 | export type ClientRead = EntityToType; 9 | export type ClientReadEntityType = typeof ClientReadEntity; 10 | 11 | export const ClientReadEntity = entity({ 12 | id: e.field(DO_ID, f => f.optional() 13 | .label("restaurant.personne.id") 14 | ), 15 | nom: e.field(DO_LIBELLE, f => f 16 | .label("restaurant.personne.nom") 17 | ), 18 | prenom: e.field(DO_LIBELLE, f => f 19 | .label("restaurant.personne.prenom") 20 | ), 21 | email: e.field(DO_LIBELLE, f => f.optional() 22 | .label("restaurant.client.email") 23 | ), 24 | avisClients: e.field(DO_LISTE, f => f.type() 25 | .label("restaurant.client.avisClients") 26 | ) 27 | }); 28 | -------------------------------------------------------------------------------- /tests/output/focus/src/model/restaurant/employe-item.ts: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | import {e, entity, EntityToType} from "@focus4/entities"; 6 | import {DO_CODE, DO_ID, DO_LIBELLE} from "../../domains"; 7 | 8 | export type EmployeItem = EntityToType; 9 | export type EmployeItemEntityType = typeof EmployeItemEntity; 10 | 11 | export const EmployeItemEntity = entity({ 12 | id: e.field(DO_ID, f => f.optional() 13 | .label("restaurant.employeItem.id") 14 | ), 15 | nom: e.field(DO_LIBELLE, f => f.optional() 16 | .label("restaurant.employeItem.nom") 17 | ), 18 | prenom: e.field(DO_LIBELLE, f => f.optional() 19 | .label("restaurant.employeItem.prenom") 20 | ), 21 | matricule: e.field(DO_CODE, f => f 22 | .label("restaurant.employe.matricule") 23 | ), 24 | restaurantId: e.field(DO_ID, f => f 25 | .label("restaurant.employe.restaurantId") 26 | ) 27 | }); 28 | -------------------------------------------------------------------------------- /TopModel.Core/TranslationStore.cs: -------------------------------------------------------------------------------- 1 | using TopModel.Core.Model; 2 | 3 | namespace TopModel.Core; 4 | 5 | public class TranslationStore 6 | { 7 | public IDictionary> Translations { get; } = 8 | new Dictionary>(); 9 | 10 | public string GetTranslation(IProperty property, string lang) 11 | { 12 | return 13 | Translations.TryGetValue(lang, out var dict) 14 | && dict.TryGetValue(property.ResourceKey, out var translatedValue) 15 | ? translatedValue 16 | : property.Label ?? string.Empty; 17 | } 18 | 19 | public string GetTranslation(ClassValue refValue, string lang) 20 | { 21 | return 22 | Translations.TryGetValue(lang, out var dict) 23 | && dict.TryGetValue(refValue.ResourceKey, out var translatedValue) 24 | ? translatedValue 25 | : refValue.Value[refValue.Class.DefaultProperty!]; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /tests/output/angular/src/appgenerated/model/restaurant/employe-item.ts: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | import {DO_CODE, DO_ID, DO_LIBELLE} from "@/domains"; 6 | import {e, entity, EntityToType} from "@focus4/entities"; 7 | 8 | export type EmployeItem = EntityToType; 9 | export type EmployeItemEntityType = typeof EmployeItemEntity; 10 | 11 | export const EmployeItemEntity = entity({ 12 | id: e.field(DO_ID, f => f.optional() 13 | .label("restaurant.employeItem.id") 14 | ), 15 | nom: e.field(DO_LIBELLE, f => f.optional() 16 | .label("restaurant.employeItem.nom") 17 | ), 18 | prenom: e.field(DO_LIBELLE, f => f.optional() 19 | .label("restaurant.employeItem.prenom") 20 | ), 21 | matricule: e.field(DO_CODE, f => f 22 | .label("restaurant.employe.matricule") 23 | ), 24 | restaurantId: e.field(DO_ID, f => f 25 | .label("restaurant.employe.restaurantId") 26 | ) 27 | }); 28 | -------------------------------------------------------------------------------- /tests/output/csharp/src/Clients/TopModel.Sample.Clients.Db/Models/Restaurant/generated/Client.cs: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | using System.ComponentModel.DataAnnotations; 6 | using System.ComponentModel.DataAnnotations.Schema; 7 | using Kinetix.Modeling.Annotations; 8 | using TopModel.Sample.Restaurant.Models; 9 | 10 | namespace TopModel.Sample.Clients.Db.Models.Restaurant; 11 | 12 | /// 13 | /// Client du restaurant. 14 | /// 15 | [Table("client")] 16 | public partial record Client : Personne 17 | { 18 | /// 19 | /// Adresse email du client. 20 | /// 21 | [Column("cli_email")] 22 | [Domain(Domains.Libelle)] 23 | [StringLength(100)] 24 | public string? Email { get; set; } 25 | 26 | /// 27 | /// Association réciproque de AvisClient.ClientId. 28 | /// 29 | [Domain(Domains.Liste)] 30 | [NotMapped] 31 | public ICollection? AvisClients { get; set; } 32 | } 33 | -------------------------------------------------------------------------------- /tests/output/csharp/src/Clients/TopModel.Sample.Clients.Db/Models/Restaurant/generated/PromotionPlat.cs: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | using System.ComponentModel.DataAnnotations; 6 | using System.ComponentModel.DataAnnotations.Schema; 7 | using Kinetix.Modeling.Annotations; 8 | using TopModel.Sample.Restaurant.Models; 9 | 10 | namespace TopModel.Sample.Clients.Db.Models.Restaurant; 11 | 12 | /// 13 | /// Association entre une promotion et un plat. 14 | /// 15 | [Table("promotion_plat")] 16 | public partial record PromotionPlat 17 | { 18 | /// 19 | /// Promotion concernée. 20 | /// 21 | [Column("pro_id")] 22 | [Required] 23 | [Domain(Domains.Id)] 24 | public int? PromotionId { get; set; } 25 | 26 | /// 27 | /// Plat concerné par la promotion. 28 | /// 29 | [Column("pla_id")] 30 | [Required] 31 | [Domain(Domains.Id)] 32 | public int? PlatId { get; set; } 33 | } 34 | -------------------------------------------------------------------------------- /tests/output/csharp/src/Clients/TopModel.Sample.Clients.Db/Reference/generated/IDbRestaurantReferenceAccessors.cs: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | using Kinetix.Services.Annotations; 6 | using TopModel.Sample.Restaurant.Models; 7 | 8 | namespace TopModel.Sample.Clients.Db.Reference; 9 | 10 | /// 11 | /// Accesseurs de listes de référence persistées. 12 | /// 13 | [RegisterContract] 14 | public partial interface IDbRestaurantReferenceAccessors 15 | { 16 | /// 17 | /// Accesseur de référence pour le type CategoriePlat. 18 | /// 19 | /// Liste de CategoriePlat. 20 | [ReferenceAccessor] 21 | ICollection LoadCategoriePlats(); 22 | 23 | /// 24 | /// Accesseur de référence pour le type StatutCommande. 25 | /// 26 | /// Liste de StatutCommande. 27 | [ReferenceAccessor] 28 | ICollection LoadStatutCommandes(); 29 | } 30 | -------------------------------------------------------------------------------- /TopModel.Core/Model/Variable.cs: -------------------------------------------------------------------------------- 1 | namespace TopModel.Core.Model; 2 | 3 | public class Variable 4 | { 5 | private readonly string? _description = null; 6 | 7 | public IList Configs { get; init; } = []; 8 | 9 | public IList Tags { get; init; } = []; 10 | 11 | public IList Languages { get; init; } = []; 12 | 13 | public bool ByTag { get; init; } 14 | 15 | public TemplateParameter? TemplateParameter { get; init; } 16 | 17 | public string Description 18 | { 19 | get 20 | { 21 | if (_description != null) 22 | { 23 | return _description; 24 | } 25 | 26 | if (TemplateParameter != null) 27 | { 28 | return TemplateParameter.Description; 29 | } 30 | 31 | return $"Variable de configuration ({(ByTag ? "par tag" : "globale")}) pour les modules : \n- {string.Join("\n- ", Configs)}"; 32 | } 33 | init => _description = value; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /tests/output/focus/src/model/restaurant/table-item.ts: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | import {e, entity, EntityToType} from "@focus4/entities"; 6 | import {DO_BOOLEEN, DO_CODE, DO_ID, DO_QUANTITE} from "../../domains"; 7 | 8 | export type TableItem = EntityToType; 9 | export type TableItemEntityType = typeof TableItemEntity; 10 | 11 | export const TableItemEntity = entity({ 12 | id: e.field(DO_ID, f => f.optional() 13 | .label("restaurant.tableRestaurant.id") 14 | ), 15 | numero: e.field(DO_CODE, f => f 16 | .label("restaurant.tableRestaurant.numero") 17 | ), 18 | capacite: e.field(DO_QUANTITE, f => f 19 | .label("restaurant.tableRestaurant.capacite") 20 | ), 21 | disponible: e.field(DO_BOOLEEN, f => f.defaultValue(true) 22 | .label("restaurant.tableRestaurant.disponible") 23 | ), 24 | restaurantId: e.field(DO_ID, f => f 25 | .label("restaurant.tableRestaurant.restaurantId") 26 | ) 27 | }); 28 | -------------------------------------------------------------------------------- /tests/output/focus/src/model/restaurant/table-read.ts: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | import {e, entity, EntityToType} from "@focus4/entities"; 6 | import {DO_BOOLEEN, DO_CODE, DO_ID, DO_QUANTITE} from "../../domains"; 7 | 8 | export type TableRead = EntityToType; 9 | export type TableReadEntityType = typeof TableReadEntity; 10 | 11 | export const TableReadEntity = entity({ 12 | id: e.field(DO_ID, f => f.optional() 13 | .label("restaurant.tableRestaurant.id") 14 | ), 15 | numero: e.field(DO_CODE, f => f 16 | .label("restaurant.tableRestaurant.numero") 17 | ), 18 | capacite: e.field(DO_QUANTITE, f => f 19 | .label("restaurant.tableRestaurant.capacite") 20 | ), 21 | disponible: e.field(DO_BOOLEEN, f => f.defaultValue(true) 22 | .label("restaurant.tableRestaurant.disponible") 23 | ), 24 | restaurantId: e.field(DO_ID, f => f 25 | .label("restaurant.tableRestaurant.restaurantId") 26 | ) 27 | }); 28 | -------------------------------------------------------------------------------- /tests/output/angular/src/appgenerated/model/restaurant/table-item.ts: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | import {DO_BOOLEEN, DO_CODE, DO_ID, DO_QUANTITE} from "@/domains"; 6 | import {e, entity, EntityToType} from "@focus4/entities"; 7 | 8 | export type TableItem = EntityToType; 9 | export type TableItemEntityType = typeof TableItemEntity; 10 | 11 | export const TableItemEntity = entity({ 12 | id: e.field(DO_ID, f => f.optional() 13 | .label("restaurant.tableRestaurant.id") 14 | ), 15 | numero: e.field(DO_CODE, f => f 16 | .label("restaurant.tableRestaurant.numero") 17 | ), 18 | capacite: e.field(DO_QUANTITE, f => f 19 | .label("restaurant.tableRestaurant.capacite") 20 | ), 21 | disponible: e.field(DO_BOOLEEN, f => f.defaultValue(true) 22 | .label("restaurant.tableRestaurant.disponible") 23 | ), 24 | restaurantId: e.field(DO_ID, f => f 25 | .label("restaurant.tableRestaurant.restaurantId") 26 | ) 27 | }); 28 | -------------------------------------------------------------------------------- /tests/output/angular/src/appgenerated/model/restaurant/table-read.ts: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | import {DO_BOOLEEN, DO_CODE, DO_ID, DO_QUANTITE} from "@/domains"; 6 | import {e, entity, EntityToType} from "@focus4/entities"; 7 | 8 | export type TableRead = EntityToType; 9 | export type TableReadEntityType = typeof TableReadEntity; 10 | 11 | export const TableReadEntity = entity({ 12 | id: e.field(DO_ID, f => f.optional() 13 | .label("restaurant.tableRestaurant.id") 14 | ), 15 | numero: e.field(DO_CODE, f => f 16 | .label("restaurant.tableRestaurant.numero") 17 | ), 18 | capacite: e.field(DO_QUANTITE, f => f 19 | .label("restaurant.tableRestaurant.capacite") 20 | ), 21 | disponible: e.field(DO_BOOLEEN, f => f.defaultValue(true) 22 | .label("restaurant.tableRestaurant.disponible") 23 | ), 24 | restaurantId: e.field(DO_ID, f => f 25 | .label("restaurant.tableRestaurant.restaurantId") 26 | ) 27 | }); 28 | -------------------------------------------------------------------------------- /TopModel.Core/Model/Target.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace TopModel.Core.Model; 4 | 5 | public enum Target 6 | { 7 | /// 8 | /// Classe. 9 | /// 10 | [EnumMember(Value = "class")] 11 | Class, 12 | 13 | /// 14 | /// Endpoint. 15 | /// 16 | [EnumMember(Value = "endpoint")] 17 | Endpoint, 18 | 19 | /// 20 | /// Propriété. 21 | /// 22 | [EnumMember(Value = "property")] 23 | Property, 24 | 25 | /// 26 | /// Propriété standard. 27 | /// 28 | [EnumMember(Value = "regular-property")] 29 | RegularProperty, 30 | 31 | /// 32 | /// Propriété d'association. 33 | /// 34 | [EnumMember(Value = "association-property")] 35 | AssociationProperty, 36 | 37 | /// 38 | /// Propriété de composition. 39 | /// 40 | [EnumMember(Value = "composition-property")] 41 | CompositionProperty, 42 | } 43 | -------------------------------------------------------------------------------- /tests/output/focus/src/model/restaurant/ligne-commande-write.ts: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | import {e, entity, EntityToType} from "@focus4/entities"; 6 | import {DO_ID, DO_PRIX, DO_QUANTITE} from "../../domains"; 7 | 8 | export type LigneCommandeWrite = EntityToType; 9 | export type LigneCommandeWriteEntityType = typeof LigneCommandeWriteEntity; 10 | 11 | export const LigneCommandeWriteEntity = entity({ 12 | quantite: e.field(DO_QUANTITE, f => f 13 | .label("restaurant.ligneCommande.quantite") 14 | ), 15 | prixUnitaire: e.field(DO_PRIX, f => f 16 | .label("restaurant.ligneCommande.prixUnitaire") 17 | ), 18 | prixTotal: e.field(DO_PRIX, f => f 19 | .label("restaurant.ligneCommande.prixTotal") 20 | ), 21 | commandeId: e.field(DO_ID, f => f 22 | .label("restaurant.ligneCommande.commandeId") 23 | ), 24 | platId: e.field(DO_ID, f => f 25 | .label("restaurant.ligneCommande.platId") 26 | ) 27 | }); 28 | -------------------------------------------------------------------------------- /TopModel.Core/Loaders/YamlUtils/InferTypeFromValueResolver.cs: -------------------------------------------------------------------------------- 1 | using YamlDotNet.Core; 2 | using YamlDotNet.Core.Events; 3 | using YamlDotNet.Serialization; 4 | 5 | namespace TopModel.Core.Loaders.YamlUtils; 6 | 7 | public class InferTypeFromValueResolver : INodeTypeResolver 8 | { 9 | /// 10 | public bool Resolve(NodeEvent? nodeEvent, ref Type currentType) 11 | { 12 | if (nodeEvent is Scalar scalar) 13 | { 14 | if (bool.TryParse(scalar.Value, out var _)) 15 | { 16 | currentType = typeof(bool); 17 | return true; 18 | } 19 | 20 | if ( 21 | int.TryParse(scalar.Value, out var _) 22 | && scalar.Style == ScalarStyle.Plain 23 | && !scalar.Value.StartsWith('0') 24 | ) 25 | { 26 | currentType = typeof(int); 27 | return true; 28 | } 29 | } 30 | 31 | return false; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /tests/output/angular/src/appgenerated/model/restaurant/ligne-commande-write.ts: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | import {DO_ID, DO_PRIX, DO_QUANTITE} from "@/domains"; 6 | import {e, entity, EntityToType} from "@focus4/entities"; 7 | 8 | export type LigneCommandeWrite = EntityToType; 9 | export type LigneCommandeWriteEntityType = typeof LigneCommandeWriteEntity; 10 | 11 | export const LigneCommandeWriteEntity = entity({ 12 | quantite: e.field(DO_QUANTITE, f => f 13 | .label("restaurant.ligneCommande.quantite") 14 | ), 15 | prixUnitaire: e.field(DO_PRIX, f => f 16 | .label("restaurant.ligneCommande.prixUnitaire") 17 | ), 18 | prixTotal: e.field(DO_PRIX, f => f 19 | .label("restaurant.ligneCommande.prixTotal") 20 | ), 21 | commandeId: e.field(DO_ID, f => f 22 | .label("restaurant.ligneCommande.commandeId") 23 | ), 24 | platId: e.field(DO_ID, f => f 25 | .label("restaurant.ligneCommande.platId") 26 | ) 27 | }); 28 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_uuid_jdbc/dtos/restaurant/RestaurantItem.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_uuid_jdbc.dtos.restaurant; 6 | 7 | import jakarta.annotation.Generated; 8 | 9 | /** 10 | * Détail d'un restaurant en liste. 11 | */ 12 | @Generated("TopModel : https://github.com/klee-contrib/topmodel") 13 | public interface RestaurantItem { 14 | 15 | /** 16 | * Identifiant du restaurant. 17 | */ 18 | Integer getId(); 19 | 20 | /** 21 | * Nom du restaurant. 22 | */ 23 | String getNom(); 24 | 25 | /** 26 | * Adresse du restaurant. 27 | */ 28 | String getAdresse(); 29 | 30 | /** 31 | * Numéro de téléphone. 32 | */ 33 | String getTelephone(); 34 | 35 | /** 36 | * Hydrate values of instance. 37 | * @param id value to set. 38 | * @param nom value to set. 39 | * @param adresse value to set. 40 | * @param telephone value to set. 41 | */ 42 | void hydrate(Integer id, String nom, String adresse, String telephone); 43 | } 44 | -------------------------------------------------------------------------------- /tests/output/focus/src/model/restaurant/avis-client-write.ts: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | import {e, entity, EntityToType} from "@focus4/entities"; 6 | import {DO_BOOLEEN, DO_ID, DO_LIBELLE, DO_QUANTITE} from "../../domains"; 7 | 8 | export type AvisClientWrite = EntityToType; 9 | export type AvisClientWriteEntityType = typeof AvisClientWriteEntity; 10 | 11 | export const AvisClientWriteEntity = entity({ 12 | note: e.field(DO_QUANTITE, f => f 13 | .label("restaurant.avisClient.note") 14 | ), 15 | commentaire: e.field(DO_LIBELLE, f => f.optional() 16 | .label("restaurant.avisClient.commentaire") 17 | ), 18 | approuve: e.field(DO_BOOLEEN, f => f.defaultValue(false) 19 | .label("restaurant.avisClient.approuve") 20 | ), 21 | clientId: e.field(DO_ID, f => f 22 | .label("restaurant.avisClient.clientId") 23 | ), 24 | restaurantId: e.field(DO_ID, f => f 25 | .label("restaurant.avisClient.restaurantId") 26 | ) 27 | }); 28 | -------------------------------------------------------------------------------- /tests/output/focus/src/model/restaurant/plat-item.ts: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | import {e, entity, EntityToType} from "@focus4/entities"; 6 | import {DO_BOOLEEN, DO_CODE, DO_ID, DO_LIBELLE, DO_PRIX} from "../../domains"; 7 | 8 | import {CategoriePlatCode} from "./references"; 9 | 10 | export type PlatItem = EntityToType; 11 | export type PlatItemEntityType = typeof PlatItemEntity; 12 | 13 | export const PlatItemEntity = entity({ 14 | id: e.field(DO_ID, f => f.optional() 15 | .label("restaurant.plat.id") 16 | ), 17 | nom: e.field(DO_LIBELLE, f => f 18 | .label("restaurant.plat.nom") 19 | ), 20 | prix: e.field(DO_PRIX, f => f 21 | .label("restaurant.plat.prix") 22 | ), 23 | disponible: e.field(DO_BOOLEEN, f => f.defaultValue(true) 24 | .label("restaurant.plat.disponible") 25 | ), 26 | categoriePlatCode: e.field(DO_CODE, f => f.type() 27 | .label("restaurant.plat.categoriePlatCode") 28 | ) 29 | }); 30 | -------------------------------------------------------------------------------- /tests/output/ssdt/src/tables/CATEGORIE_PLAT.sql: -------------------------------------------------------------------------------- 1 | ---- 2 | ---- ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | ---- 4 | 5 | -- =========================================================================================== 6 | -- Description : Création de la table CATEGORIE_PLAT. 7 | -- =========================================================================================== 8 | 9 | create table [dbo].[CATEGORIE_PLAT] ( 10 | [CAT_CODE] varchar, 11 | [CAT_LIBELLE] varchar not null, 12 | constraint [PK_CATEGORIE_PLAT] primary key clustered ([CAT_CODE] ASC)) 13 | go 14 | 15 | /** 16 | * Commentaires pour la table CATEGORIE_PLAT 17 | **/ 18 | EXECUTE sp_addextendedproperty 'MS_Description', 'Catégorie de plat', 'SCHEMA', 'dbo', 'TABLE', 'CATEGORIE_PLAT' 19 | go 20 | EXECUTE sp_addextendedproperty 'MS_Description', 'Code de la catégorie', 'SCHEMA', 'dbo', 'TABLE', 'CATEGORIE_PLAT', 'COLUMN', 'CAT_CODE' 21 | go 22 | EXECUTE sp_addextendedproperty 'MS_Description', 'Libellé de la catégorie', 'SCHEMA', 'dbo', 'TABLE', 'CATEGORIE_PLAT', 'COLUMN', 'CAT_LIBELLE' 23 | go 24 | -------------------------------------------------------------------------------- /tests/output/ssdt/src/tables/STATUT_COMMANDE.sql: -------------------------------------------------------------------------------- 1 | ---- 2 | ---- ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | ---- 4 | 5 | -- =========================================================================================== 6 | -- Description : Création de la table STATUT_COMMANDE. 7 | -- =========================================================================================== 8 | 9 | create table [dbo].[STATUT_COMMANDE] ( 10 | [STC_CODE] varchar, 11 | [STC_LIBELLE] varchar not null, 12 | constraint [PK_STATUT_COMMANDE] primary key clustered ([STC_CODE] ASC)) 13 | go 14 | 15 | /** 16 | * Commentaires pour la table STATUT_COMMANDE 17 | **/ 18 | EXECUTE sp_addextendedproperty 'MS_Description', 'Statut d''une commande', 'SCHEMA', 'dbo', 'TABLE', 'STATUT_COMMANDE' 19 | go 20 | EXECUTE sp_addextendedproperty 'MS_Description', 'Code du statut', 'SCHEMA', 'dbo', 'TABLE', 'STATUT_COMMANDE', 'COLUMN', 'STC_CODE' 21 | go 22 | EXECUTE sp_addextendedproperty 'MS_Description', 'Libellé du statut', 'SCHEMA', 'dbo', 'TABLE', 'STATUT_COMMANDE', 'COLUMN', 'STC_LIBELLE' 23 | go 24 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_identity_enums/dtos/restaurant/RestaurantItem.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_identity_enums.dtos.restaurant; 6 | 7 | import jakarta.annotation.Generated; 8 | 9 | /** 10 | * Détail d'un restaurant en liste. 11 | */ 12 | @Generated("TopModel : https://github.com/klee-contrib/topmodel") 13 | public interface RestaurantItem { 14 | 15 | /** 16 | * Identifiant du restaurant. 17 | */ 18 | Integer getId(); 19 | 20 | /** 21 | * Nom du restaurant. 22 | */ 23 | String getNom(); 24 | 25 | /** 26 | * Adresse du restaurant. 27 | */ 28 | String getAdresse(); 29 | 30 | /** 31 | * Numéro de téléphone. 32 | */ 33 | String getTelephone(); 34 | 35 | /** 36 | * Hydrate values of instance. 37 | * @param id value to set. 38 | * @param nom value to set. 39 | * @param adresse value to set. 40 | * @param telephone value to set. 41 | */ 42 | void hydrate(Integer id, String nom, String adresse, String telephone); 43 | } 44 | -------------------------------------------------------------------------------- /tests/output/angular/src/appgenerated/model/restaurant/avis-client-write.ts: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | import {DO_BOOLEEN, DO_ID, DO_LIBELLE, DO_QUANTITE} from "@/domains"; 6 | import {e, entity, EntityToType} from "@focus4/entities"; 7 | 8 | export type AvisClientWrite = EntityToType; 9 | export type AvisClientWriteEntityType = typeof AvisClientWriteEntity; 10 | 11 | export const AvisClientWriteEntity = entity({ 12 | note: e.field(DO_QUANTITE, f => f 13 | .label("restaurant.avisClient.note") 14 | ), 15 | commentaire: e.field(DO_LIBELLE, f => f.optional() 16 | .label("restaurant.avisClient.commentaire") 17 | ), 18 | approuve: e.field(DO_BOOLEEN, f => f.defaultValue(false) 19 | .label("restaurant.avisClient.approuve") 20 | ), 21 | clientId: e.field(DO_ID, f => f 22 | .label("restaurant.avisClient.clientId") 23 | ), 24 | restaurantId: e.field(DO_ID, f => f 25 | .label("restaurant.avisClient.restaurantId") 26 | ) 27 | }); 28 | -------------------------------------------------------------------------------- /tests/output/angular/src/appgenerated/model/restaurant/plat-item.ts: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | import {DO_BOOLEEN, DO_CODE, DO_ID, DO_LIBELLE, DO_PRIX} from "@/domains"; 6 | import {e, entity, EntityToType} from "@focus4/entities"; 7 | 8 | import {CategoriePlatCode} from "./references"; 9 | 10 | export type PlatItem = EntityToType; 11 | export type PlatItemEntityType = typeof PlatItemEntity; 12 | 13 | export const PlatItemEntity = entity({ 14 | id: e.field(DO_ID, f => f.optional() 15 | .label("restaurant.plat.id") 16 | ), 17 | nom: e.field(DO_LIBELLE, f => f 18 | .label("restaurant.plat.nom") 19 | ), 20 | prix: e.field(DO_PRIX, f => f 21 | .label("restaurant.plat.prix") 22 | ), 23 | disponible: e.field(DO_BOOLEEN, f => f.defaultValue(true) 24 | .label("restaurant.plat.disponible") 25 | ), 26 | categoriePlatCode: e.field(DO_CODE, f => f.type() 27 | .label("restaurant.plat.categoriePlatCode") 28 | ) 29 | }); 30 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_sequence_metamodel/dtos/restaurant/RestaurantItem.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_sequence_metamodel.dtos.restaurant; 6 | 7 | import jakarta.annotation.Generated; 8 | 9 | /** 10 | * Détail d'un restaurant en liste. 11 | */ 12 | @Generated("TopModel : https://github.com/klee-contrib/topmodel") 13 | public interface RestaurantItem { 14 | 15 | /** 16 | * Identifiant du restaurant. 17 | */ 18 | Integer getId(); 19 | 20 | /** 21 | * Nom du restaurant. 22 | */ 23 | String getNom(); 24 | 25 | /** 26 | * Adresse du restaurant. 27 | */ 28 | String getAdresse(); 29 | 30 | /** 31 | * Numéro de téléphone. 32 | */ 33 | String getTelephone(); 34 | 35 | /** 36 | * Hydrate values of instance. 37 | * @param id value to set. 38 | * @param nom value to set. 39 | * @param adresse value to set. 40 | * @param telephone value to set. 41 | */ 42 | void hydrate(Integer id, String nom, String adresse, String telephone); 43 | } 44 | -------------------------------------------------------------------------------- /TopModel.Core/Model/DataFlow.cs: -------------------------------------------------------------------------------- 1 | using TopModel.Core.FileModel; 2 | 3 | namespace TopModel.Core.Model; 4 | 5 | public class DataFlow 6 | { 7 | #nullable disable 8 | public ModelFile ModelFile { get; set; } 9 | 10 | public Reference Location { get; set; } 11 | 12 | public LocatedString Name { get; set; } 13 | 14 | public string Target { get; set; } 15 | 16 | public Class Class { get; set; } 17 | 18 | public ClassReference ClassReference { get; set; } 19 | 20 | public DataFlowType Type { get; set; } 21 | 22 | #nullable enable 23 | 24 | public IList DependsOn { get; set; } = []; 25 | 26 | public IList DependsOnReference { get; set; } = []; 27 | 28 | public IList Hooks { get; set; } = []; 29 | 30 | public IProperty? ActiveProperty { get; set; } 31 | 32 | public Reference? ActivePropertyReference { get; set; } 33 | 34 | public IList Sources { get; set; } = []; 35 | 36 | public override string ToString() 37 | { 38 | return Name; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_identity_associations/dtos/restaurant/RestaurantItem.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_identity_associations.dtos.restaurant; 6 | 7 | import jakarta.annotation.Generated; 8 | 9 | /** 10 | * Détail d'un restaurant en liste. 11 | */ 12 | @Generated("TopModel : https://github.com/klee-contrib/topmodel") 13 | public interface RestaurantItem { 14 | 15 | /** 16 | * Identifiant du restaurant. 17 | */ 18 | Integer getId(); 19 | 20 | /** 21 | * Nom du restaurant. 22 | */ 23 | String getNom(); 24 | 25 | /** 26 | * Adresse du restaurant. 27 | */ 28 | String getAdresse(); 29 | 30 | /** 31 | * Numéro de téléphone. 32 | */ 33 | String getTelephone(); 34 | 35 | /** 36 | * Hydrate values of instance. 37 | * @param id value to set. 38 | * @param nom value to set. 39 | * @param adresse value to set. 40 | * @param telephone value to set. 41 | */ 42 | void hydrate(Integer id, String nom, String adresse, String telephone); 43 | } 44 | -------------------------------------------------------------------------------- /TopModel.Core/I18nConfig.cs: -------------------------------------------------------------------------------- 1 | namespace TopModel.Core; 2 | 3 | /// 4 | /// Configuration i18n. 5 | /// 6 | public class I18nConfig 7 | { 8 | /// 9 | /// Langue par défaut de l'application. 10 | /// 11 | public string DefaultLang { get; set; } = string.Empty; 12 | 13 | /// 14 | /// Liste des langues de l'application (autre que la langue par défaut). 15 | /// 16 | public IList Langs { get; set; } = []; 17 | 18 | /// 19 | /// Template du chemin des dossiers de traductions entrants. Doit contenir le template {lang}. 20 | /// 21 | public string RootPath { get; set; } = "{lang}"; 22 | 23 | /// 24 | /// Si les libellés des listes de références doivent être traduits. 25 | /// 26 | public bool TranslateReferences { get; set; } = true; 27 | 28 | /// 29 | /// Si les libellés des propriétés doivent être traduits. 30 | /// 31 | public bool TranslateProperties { get; set; } = true; 32 | } 33 | -------------------------------------------------------------------------------- /tests/output/jpa/src/main/javagen/restaurant/jpa_uuid_jdbc/entities/restaurant/Client.java: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | package restaurant.jpa_uuid_jdbc.entities.restaurant; 6 | 7 | import org.springframework.data.relational.core.mapping.Column; 8 | import org.springframework.data.relational.core.mapping.Table; 9 | 10 | import jakarta.annotation.Generated; 11 | 12 | /** 13 | * Client du restaurant. 14 | */ 15 | @Table(name = "client") 16 | @Generated("TopModel : https://github.com/klee-contrib/topmodel") 17 | public class Client extends Personne { 18 | 19 | /** 20 | * Adresse email du client. 21 | */ 22 | @Column("cli_email") 23 | private String email; 24 | 25 | /** 26 | * Getter for email. 27 | * 28 | * @return value of {@link #email email}. 29 | */ 30 | public String getEmail() { 31 | return this.email; 32 | } 33 | 34 | /** 35 | * Set the value of {@link #email email}. 36 | * @param email value to set. 37 | */ 38 | public void setEmail(String email) { 39 | this.email = email; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /tests/output/pg/src/03_unique_keys.sql: -------------------------------------------------------------------------------- 1 | ---- 2 | ---- ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | ---- 4 | 5 | -- =========================================================================================== 6 | -- Application Name : Restaurant 7 | -- Script Name : 03_unique_keys.sql 8 | -- Description : Script de création des contraintes d'unicité. 9 | -- =========================================================================================== 10 | 11 | alter table AVIS_CLIENT add constraint UK_AVIS_CLIENT_PER_ID_RES_ID_AVI_DATE_AVIS unique (PER_ID, RES_ID, AVI_DATE_AVIS); 12 | 13 | alter table EMPLOYE add constraint UK_EMPLOYE_EMP_MATRICULE unique (EMP_MATRICULE); 14 | 15 | alter table LIGNE_COMMANDE add constraint UK_LIGNE_COMMANDE_COM_ID_PLA_ID unique (COM_ID, PLA_ID); 16 | 17 | alter table MENU_PLAT add constraint UK_MENU_PLAT_MEN_ID_MPL_ORDRE unique (MEN_ID, MPL_ORDRE); 18 | 19 | alter table RESERVATION add constraint UK_RESERVATION_TAB_ID_REV_DATE_RESERVATION unique (TAB_ID, REV_DATE_RESERVATION); 20 | 21 | alter table TABLE add constraint UK_TABLE_RES_ID_TAB_NUMERO unique (RES_ID, TAB_NUMERO); 22 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Damien Frikha 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /TopModel.ModelGenerator/TmdClass.cs: -------------------------------------------------------------------------------- 1 | namespace TopModel.ModelGenerator; 2 | 3 | public class TmdClass 4 | { 5 | #nullable disable 6 | public string Name { get; set; } 7 | 8 | public string SqlName { get; set; } 9 | 10 | #nullable enable 11 | public string Comment { get; set; } = "Non documenté"; 12 | 13 | public IList Properties { get; set; } = []; 14 | 15 | public IList Dependencies => 16 | Properties 17 | .OfType() 18 | .Select(p => p.Association!) 19 | .Concat(Properties.OfType().Select(a => a.Class)) 20 | .Where(c => c != this) 21 | .Distinct() 22 | .ToList(); 23 | 24 | public string Trigram { get; set; } = string.Empty; 25 | 26 | public IList> Unique { get; set; } = []; 27 | 28 | public bool PreservePropertyCasing { get; set; } 29 | 30 | public string? Extends { get; set; } 31 | 32 | public IList> Values { get; set; } = []; 33 | 34 | public TmdFile? File { get; set; } 35 | } 36 | -------------------------------------------------------------------------------- /TopModel.Utils/IFileWriterProvider.cs: -------------------------------------------------------------------------------- 1 | using System.Text; 2 | using Microsoft.Extensions.Logging; 3 | 4 | namespace TopModel.Utils; 5 | 6 | /// 7 | /// Provider pour récupérer des File Writers. 8 | /// 9 | public interface IFileWriterProvider 10 | { 11 | /// 12 | /// Crée une nouvelle instance. 13 | /// 14 | /// Nom du fichier à écrire. 15 | /// Logger. 16 | /// UTF8 avec BOM ? 17 | /// GeneratedFileWriter 18 | IFileWriter OpenFileWriter(string fileName, ILogger logger, bool encoderShouldEmitUTF8Identifier = true); 19 | 20 | /// 21 | /// Crée une nouvelle instance. 22 | /// 23 | /// Nom du fichier à écrire. 24 | /// Logger. 25 | /// Encoding 26 | /// GeneratedFileWriter 27 | IFileWriter OpenFileWriter(string fileName, ILogger logger, Encoding encoding); 28 | } 29 | -------------------------------------------------------------------------------- /TopModel.Core/Loaders/YamlUtils/LocatedStringTypeConverter.cs: -------------------------------------------------------------------------------- 1 | using TopModel.Core.FileModel; 2 | using YamlDotNet.Core; 3 | using YamlDotNet.Core.Events; 4 | using YamlDotNet.Serialization; 5 | 6 | namespace TopModel.Core.Loaders.YamlUtils; 7 | 8 | internal class LocatedStringTypeConverter : IYamlTypeConverter 9 | { 10 | /// 11 | public bool Accepts(Type type) 12 | { 13 | return type == typeof(LocatedString) || type == typeof(StringWithVariables); 14 | } 15 | 16 | /// 17 | public object? ReadYaml(IParser parser, Type type, ObjectDeserializer rootDeserializer) 18 | { 19 | return type == typeof(LocatedString) 20 | ? new LocatedString(parser.Consume()) 21 | : new StringWithVariables(parser.Consume()); 22 | } 23 | 24 | /// 25 | public void WriteYaml(IEmitter emitter, object? value, Type type, ObjectSerializer serializer) 26 | { 27 | throw new NotSupportedException(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /TopModel.Core/ModelException.cs: -------------------------------------------------------------------------------- 1 | using TopModel.Core.FileModel; 2 | using TopModel.Utils; 3 | 4 | namespace TopModel.Core; 5 | 6 | /// 7 | /// Exception dans la lecture/parsing du modèle. 8 | /// 9 | public class ModelException : LegitException 10 | { 11 | /// 12 | /// Constructeur. 13 | /// 14 | /// Message. 15 | public ModelException(string message) 16 | : base(message) { } 17 | 18 | /// 19 | /// Constructeur. 20 | /// 21 | /// Objet de modèle concerné. 22 | /// Message. 23 | /// Référence éventuelle vers l'erreur (si pas liée à l'objet) 24 | public ModelException(object objet, string message, Reference? reference = null) 25 | { 26 | ModelError = new ModelError(ErrorType.TMD0000, objet, message, reference); 27 | } 28 | 29 | public override string Message => ModelError != null ? ModelError.ToString() : base.Message; 30 | 31 | public ModelError? ModelError { get; } 32 | } 33 | -------------------------------------------------------------------------------- /tests/tmdgen/open-api/Petstore/Domains.tmd: -------------------------------------------------------------------------------- 1 | --- 2 | module: none 3 | tags: 4 | - "" 5 | --- 6 | domain: 7 | name: DO_ID 8 | label: ID technique 9 | autoGeneratedValue: true 10 | ts: 11 | type: number 12 | --- 13 | domain: 14 | name: DO_ENTIER 15 | label: Nombre 16 | autoGeneratedValue: false 17 | ts: 18 | type: number 19 | --- 20 | domain: 21 | name: DO_ENTIER_MAP 22 | label: Nombre 23 | autoGeneratedValue: false 24 | ts: 25 | type: number[] 26 | --- 27 | domain: 28 | name: DO_BOOLEAN 29 | label: Vrai ou faux 30 | autoGeneratedValue: false 31 | ts: 32 | type: boolean 33 | --- 34 | domain: 35 | name: DO_LIBELLE 36 | label: Libelle 37 | autoGeneratedValue: false 38 | ts: 39 | type: string 40 | --- 41 | domain: 42 | name: DO_LIST 43 | label: Liste pour composition 44 | --- 45 | domain: 46 | name: DO_FILE 47 | label: Fichier 48 | autoGeneratedValue: false 49 | bodyParam: true 50 | ts: 51 | type: File 52 | --- 53 | domain: 54 | name: DO_DATE_TIME 55 | label: Date heure 56 | autoGeneratedValue: false 57 | ts: 58 | type: Date 59 | -------------------------------------------------------------------------------- /tests/output/focus/src/model/restaurant/commande-item.ts: -------------------------------------------------------------------------------- 1 | //// 2 | //// ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! 3 | //// 4 | 5 | import {e, entity, EntityToType} from "@focus4/entities"; 6 | import {DO_CODE, DO_DATE_HEURE, DO_ID, DO_PRIX} from "../../domains"; 7 | 8 | import {StatutCommandeCode} from "./references"; 9 | 10 | export type CommandeItem = EntityToType; 11 | export type CommandeItemEntityType = typeof CommandeItemEntity; 12 | 13 | export const CommandeItemEntity = entity({ 14 | id: e.field(DO_ID, f => f.optional() 15 | .label("restaurant.commande.id") 16 | ), 17 | dateCommande: e.field(DO_DATE_HEURE, f => f 18 | .label("restaurant.commande.dateCommande") 19 | ), 20 | montantTotal: e.field(DO_PRIX, f => f 21 | .label("restaurant.commande.montantTotal") 22 | ), 23 | statutCommandeCode: e.field(DO_CODE, f => f.type().defaultValue("EN_ATT") 24 | .label("restaurant.commande.statutCommandeCode") 25 | ), 26 | clientId: e.field(DO_ID, f => f 27 | .label("restaurant.commande.clientId") 28 | ) 29 | }); 30 | -------------------------------------------------------------------------------- /TopModel.Utils/IFileWriter.cs: -------------------------------------------------------------------------------- 1 | namespace TopModel.Utils; 2 | 3 | /// 4 | /// Writer pour les fichiers dans les générateurs. 5 | /// 6 | public interface IFileWriter : IDisposable 7 | { 8 | /// 9 | /// Active la lecture et l'écriture d'un entête avec un hash du fichier. 10 | /// 11 | bool EnableHeader { get; set; } 12 | 13 | /// 14 | /// Nom du fichier à écrire. 15 | /// 16 | string FileName { get; } 17 | 18 | /// 19 | /// Message à mettre dans le header. 20 | /// 21 | string HeaderMessage { get; set; } 22 | 23 | /// 24 | /// Indentation. 25 | /// 26 | string IndentValue { get; set; } 27 | 28 | /// 29 | /// Renvoie le token de début de ligne de commentaire dans le langage du fichier. 30 | /// 31 | string StartCommentToken { get; set; } 32 | 33 | /// 34 | /// Ecrit un string dans le stream. 35 | /// 36 | /// Chaîne de caractère.