Skip to content

Commit e1ba0e9

Browse files
authored
DOCSP-30480 Code Generation Drawer (#6)
* DOCSP-30480 Code Generation Drawer
1 parent cf896c4 commit e1ba0e9

12 files changed

+150
-21
lines changed

source/code-generation/code-generation.txt

Lines changed: 71 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,79 @@
22
Code Generation
33
===============
44

5-
.. default-domain:: mongodb
5+
In a migration project, in addition to migrating data, you frequently
6+
update or rewrite parts of your application code. Relational Migrator's
7+
Code Generation feature reduces the time and effort involved in this process.
68

7-
.. contents:: On this page
8-
:local:
9-
:backlinks: none
10-
:depth: 1
11-
:class: singlecol
9+
Relational Migration Code Generation analyzes MongoDB collections and
10+
generates application code from your MongoDB schema.
1211

13-
123
12+
Code Generation:
13+
14+
* Uses connections defined in your project to connect to MongoDB and generate application code files.
15+
* Provides language support for C#, Java, JavaScript and JSON.
16+
17+
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.
18+
19+
Code Generation Options
20+
-----------------------
21+
22+
Code Generation has the following options:
23+
24+
.. list-table::
25+
:header-rows: 1
26+
27+
* - Option
28+
- Description
29+
* - Language
30+
- The programming language that Relational Migrator generates code files for.
31+
* - Template
32+
- Describes the types of artifacts that are generated in the chosen language.
33+
34+
Code Generation Templates
35+
-------------------------
36+
37+
Code Generation supports the following application templates:
38+
39+
.. list-table::
40+
:header-rows: 1
41+
42+
* - Language
43+
- Template Name
44+
- Description
45+
* - C#
46+
- Persistence Layer
47+
- Includes the POCOs as well as repository classes that use the C# MongoDB Driver.
48+
* - C#
49+
- POCO (Plain Old CLR Object)
50+
- Generates your code as framework independent C# entity classes.
51+
* - Java
52+
- POJO (Plain Old Java Object)
53+
- Generates your code as framework independent Java entity classes.
54+
* - Java
55+
- Spring Data
56+
- Includes the POJOs as well as repository classes built using the Spring Data framework.
57+
* - JavaScript
58+
- Mongoose Schemas
59+
- Generates your code as Mongoose JavaScript schema classes.
60+
* - JavaScript
61+
- Node
62+
- Generates CRUD repository classes for use in a Node.js application.
63+
* - JSON
64+
- JSON Schema (MongoDB)
65+
- Generates JSON Schema files that are able to be used for `MongoDB schema validation <https://www.mongodb.com/docs/manual/core/schema-validation/specify-json-schema/>`__.
66+
* - JSON
67+
- JSON Schema (Standard)
68+
- Generates JSON Schema files that can be used with third party tools.
69+
* - JSON
70+
- Sample documents
71+
- Generates sample JSON documents that align to each collection's schema.
72+
73+
To learn how to download code files, see:
74+
75+
76+
- :ref:`<rm-download-all-code-files>`
77+
- :ref:`<rm-download-single-code-file>`
1478

1579
.. toctree::
1680
:hidden:
Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,42 @@
1+
.. _rm-download-all-code-files:
2+
13
=======================
24
Download All Code Files
35
=======================
46

5-
.. default-domain:: mongodb
6-
77
.. contents:: On this page
88
:local:
99
:backlinks: none
1010
:depth: 1
1111
:class: singlecol
1212

13-
TBD.
13+
Code Generation is a feature built into Relational Migrator that helps
14+
automatically generate code files for your applications connected
15+
to MongoDB. This page details how to generate and download all code files into a zip file.
16+
17+
About this Task
18+
---------------
19+
20+
Some templates also generate additional files which are not specific to
21+
a MongoDB collection. These files are called :guilabel:`Support files`.
22+
Click the :guilabel:`Support files` check box to indicate if you would like
23+
these files included in your downloads.
24+
25+
Steps
26+
-----
27+
28+
#. Navigate to the :guilabel:`Code Generation` screen, in the left :guilabel:`Generate code` pane.
29+
#. Select a :guilabel:`Language`.
30+
#. Select a :guilabel:`Template`.
31+
#. Select the MongoDB collections by clicking check box next to the collection name.
32+
#. Click the :guilabel:`Download selected files` button. The selected files download into a zip file
33+
to your :guilabel:`Downloads folder`. The zip file has a naming convention of ``PROJECTNAME-LANGUAGE-TEMPLATE``.
34+
35+
.. image:: /img/code-generation/code-generation-download-all-button.png
36+
:alt: Download All Code Files
37+
38+
Learn More
39+
----------
40+
41+
:ref:`rm-download-single-code-file`
42+
Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,44 @@
1+
.. _rm-download-single-code-file:
2+
13
==========================
24
Download Single Code Files
35
==========================
46

5-
.. default-domain:: mongodb
6-
77
.. contents:: On this page
88
:local:
99
:backlinks: none
1010
:depth: 1
1111
:class: singlecol
1212

13-
TBD.
13+
Code Generation is a feature built into Relational Migrator that helps
14+
automatically generate code files for your applications connected
15+
to MongoDB. This page details how to generate and download individual code files.
16+
17+
About this Task
18+
---------------
19+
20+
Some templates also generate additional files which are not specific to
21+
a MongoDB collection. These files are called :guilabel:`Support files`. Click
22+
the :guilabel:`Support files` check box to indicate if you would like these
23+
files included in your downloads.
24+
25+
Steps
26+
-----
27+
28+
You can view, download, or copy a single collections code file.
29+
30+
#. Navigate to the :guilabel:`Code Generation` screen, in the left :guilabel:`Generate code` pane.
31+
#. Select a :guilabel:`Language`.
32+
#. Select a :guilabel:`Template`.
33+
#. Click the MongoDB collection name.
34+
#. A tab displays for each code file. More than one code file per collection may be generated depending on the template.
35+
#. Click the :guilabel:`Copy` or :guilabel:`Download` buttons in the target code file to download or copy that files contents.
36+
37+
.. image:: /img/code-generation/code-generation-copy-download-button.png
38+
:alt: Download Individual Code File
39+
40+
Learn More
41+
----------
42+
43+
:ref:`Download All Code Files <rm-download-all-code-files>`
44+

source/connection-strings/connection-strings.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
Connection Strings
33
==================
44

5-
65
.. toctree::
76
:titlesonly:
87
:hidden:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
===================================
22
MongoDB Database Connection Strings
3-
===================================
3+
===================================
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
======================================
22
Relational Database Connection Strings
3-
======================================
3+
======================================
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.. note::
2+
3+
URI's are optional, you can use connection string forms to
4+
enter your connection details instead of manually providing a URI.

source/jobs/creating-jobs.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
=================
22
Create a Sync Job
3-
=================
3+
=================

source/jobs/data-verification/data-verification.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. _rm-data-Verification:
2+
13
=================
24
Data Verification
35
=================

source/jobs/monitoring-jobs.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
==================
22
Monitor a Sync Job
3-
==================
3+
==================

source/jobs/stopping-jobs.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
===============
22
Stop a Sync Job
3-
===============
3+
===============
4+
5+

source/jobs/sync-jobs.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
Sync Jobs
33
=========
44

5-
TBD.
6-
75
.. toctree::
86
:titlesonly:
97
:hidden:

0 commit comments

Comments
 (0)