Docs Menu
Docs Home
/
Relational Migrator
/

Generate App Code

On this page

  • Code Generation Options
  • Code Generation Templates
  • Get Started

In a migration project, in addition to migrating data, you frequently update or rewrite parts of your application code. Relational Migrator's Code Generation feature reduces the time and effort involved in this process.

Relational Migration Code Generation analyzes MongoDB collections and generates application code from your MongoDB schema.

Code Generation:

  • Uses connections defined in your project to connect to MongoDB and generate application code files.

  • Provides language support for C#, Java, JavaScript and JSON.

For each collection in your destination MongoDB connection, Code Generation generates code files. These files contain language specific model classes and appropriate library imports to run your application on MongoDB. You can then download or copy these automatically generated files into your application. You may need to make manual updates to the generated code in order to integrate it with your existing application code.

Code Generation has the following options:

Option
Description
Language
The programming language that Relational Migrator generates code files for.
Template
Describes the types of artifacts that are generated in the chosen language.

Code Generation supports the following application templates:

Language
Template Name
Description
C#
Persistence Layer
Includes the POCOs as well as repository classes that use the C# MongoDB Driver.
C#
POCO (Plain Old CLR Object)
Generates your code as framework independent C# entity classes.
Java
POJO (Plain Old Java Object)
Generates your code as framework independent Java entity classes.
Java
Spring Data
Includes the POJOs as well as repository classes built using the Spring Data framework.
JavaScript
Mongoose Schemas
Generates your code as Mongoose JavaScript schema classes.
JavaScript
Node
Generates CRUD repository classes for use in a Node.js application.
JSON
JSON Schema (MongoDB)
Generates JSON Schema files that are able to be used for MongoDB schema validation.
JSON
JSON Schema (Standard)
Generates JSON Schema files that can be used with third party tools.
JSON
Sample documents
Generates sample JSON documents that align to each collection's schema.
← Code Generation