Home | Download | Quick sample |
Tutorial (4)
|
Manual (2)
|
Forum | Our customers |
QxOrm >> Manual - QxEntityEditor application user guide |
|
The goal of this documentation is to provide a user guide to learn how to work with QxEntityEditor application features (the graphic editor for QxOrm library).
This manual is intended for developers and software architects who are looking for a solution to manage a persistent data layer in C++/Qt.
Technical skills in C++ and databases are required to understand this document.
Note : another documentation dedicated to QxOrm library is available. QxEntityEditor : graphic editor for QxOrm library
QxEntityEditor is a graphic editor for QxOrm library : QxEntityEditor provides a graphic way to manage the data model.
QxEntityEditor is multi-platform (available for Windows, Linux and Mac OS X) and generates native code for all environments : desktop (Windows, Linux, Mac OS X), embedded and mobile (Android, iOS, Windows Phone, Raspberry Pi, etc.). QxEntityEditor is based on plugins and provides many ways to import/export your data model :
QxEntityEditor application is developed by Lionel Marty, a software development engineer since 2003.
QxEntityEditor application can be downloaded on QxOrm web site, « Download » web page.
Several QxEntityEditor versions are available :
For Linux and Mac OS X, QxEntityEditor is available only with a portable ZIP file. No extra dependency is required, QxEntityEditor installation is very easy : you just have to unzip downloaded file and run QxEntityEditor executable.
Here is a quick overview of QxEntityEditor features :
Video presentation step by step :
Here is another video of QxEntityEditor application to show how to import an existing database structure (MySQL Workbench project) : Video step by step :
QxEntityEditor is a graphic editor to manage : entities, properties, relationships between entities, enumerations, namespaces.
To link database and C++ source code :
Here is a screenshot which shows all areas of QxEntityEditor main view :
QxEntityEditor application provides several ways to zoom on entities diagram :
View >> Show/hide splitter mode menu switches tabs settings (entities, properties, relationships, enumerations + C++ source code preview) :
QxEntityEditor application settings
QxEntityEditor application global parameters (for all projects) are accessible via main menu Tools >> Global settings :
Without a valid license key, a QxEntityEditor project is limited to 5 entities per project.
To remove this limitation, you can register a license key via main menu Help >> License information :
Just copy/past your license key in the field License key, then push the Save button. A web access is required to register a license key. If no error occurred, then the license key is registered and QxEntityEditor application can be used without any limitation until Expiration date field. Note : if a web access error occurred during registration, you could try to enable « If you are behind a proxy... » option. Other note : to get a valid license key, please contact us at : contact@qxorm.com
A new QxEntityEditor project is created via main menu File >> New project :
An existing QxEntityEditor project can be opened via main menu File >> Open project : then just select a project file with *.qxee extension. Under the main toolbar of QxEntityEditor application, a list of recent projects is available to switch quickly from a project to another : Architecture of a *.qxee project file (SQLite database)
A *.qxee project file of QxEntityEditor application is a SQLite database.
A same QxEntityEditor project can be shared on all environments : Windows, Linux and Mac OS X. A *.qxee project file can be opened by a SQLite database manager tool : for example, the free Firefox plugin SQLite Manager : Note : using the Execute custom scripts (shell/bat) before/after plugin execution feature, it is possible for example to apply a script (.bat or .sh) to modify some imported data in the *.qxee SQLite database file after an import process.
QxEntityEditor *.qxee project parameters are accessible via main menu Tools >> Project settings :
The second tab of project parameters screen provides a way to manage items colors in the entities diagram at a project level : Note : items colors in the entities diagram can be defined at several levels (from the more global level to the more specific level) :
An entity in QxEntityEditor application is a table from a database point of view, and is a persistent class (registered in QxOrm context) in C++ source code.
QxEntityEditor application provides features to create, modify, delete and clone entity.
A new entity can be created via :
Note : these actions open the entity parameters screen in creation context. The entity will be really created and added to the *.qxee project after saving it in the entity parameters screen.
An entity can be modified via :
Note : these actions open the entity parameters screen in change context. All entity changes will be really applied to the *.qxee project after saving it in the entity parameters screen.
An entity (or several entities) can be deleted via :
An entity can be cloned via :
Note : a cloned entity has all properties from source entity. Relationships are not cloned.
Entity parameters are accessible via Entity settings tab :
This parameters screen is divided in several sections : -- Section Entity information (version XX) : entity version is incremented by each project historic.
-- Section Entity triggers :
-- Section Primary key property : fast definition of primary key (detailled settings of primary key is available).
-- Section List of properties : fast definition of list of properties (detailled settings for each property is available). This list can be manually sorted using arrow up and arrow down buttons.
-- Section List of relationships : fast definition of list of relationships (detailled settings for each relationship is available). This list can be manually sorted using arrow up and arrow down buttons.
-- Section List of meta-data : meta-data provides a way to add and manage extra-parameters and are available in C++ source code (QxOrm introspection engine) and Javascript engine to customize QxEntityEditor export process.
Colors associated to an entity
Entity colors can be defined via right-click contextual menu Define entity colors :
Note : items colors in the entities diagram can be defined at several levels (from the more global level to the more specific level) :
Manage list of properties of an entity
A property in QxEntityEditor application is a column (of a table) from a database point of view, and is a data member in a C++ class (registered in QxOrm context).
QxEntityEditor application provides features to create, modify, delete and sort properties of an entity.
Add and delete a property is done via entity parameters screen : the List of properties section of this settings screen provides a way to add/remove properties.
It is also possible to sort manually this list of properties.
Modify a property is accessible via a button which is displayed on entities diagram when the mouse is closed to a property :
Detailled property parameters are accessible via Property settings tab :
This parameters screen is divided in several sections : -- Section Property information (version XX) : property version depends on project historic.
-- Section Property type :
-- Section Property validation : validate a property before inserting/updating in database using QxValidator module of QxOrm library.
-- Section Advanced :
-- Section List of meta-data : meta-data provides a way to add and manage extra-parameters and are available in C++ source code (QxOrm introspection engine) and Javascript engine to customize QxEntityEditor export process.
Manage relationships between entities
A relationship between 2 entities (1-n, n-1, 1-1 or n-n) in QxEntityEditor application links 2 tables in database, and links 2 classes in C++ source code.
QxEntityEditor application provides features to create, modify, delete and sort relationships of an entity.
Add/modify/delete a relationship
Add and delete a relationship is done via entity parameters screen : the List of relationships section of this settings screen provides a way to add/remove relationships.
It is also possible to sort manually this list of relationships.
Modify a relationship is accessible via a button which is displayed on entities diagram when the mouse is closed to a relationship :
Detailled relationship parameters are accessible via Relationship settings tab :
This parameters screen is divided in several sections : -- Section Relationship information (version XX) : relationship version depends on project historic.
-- Section Advanced :
-- Section List of meta-data : meta-data provides a way to add and manage extra-parameters and are available in C++ source code (QxOrm introspection engine) and Javascript engine to customize QxEntityEditor export process.
An enumeration in QxEntityEditor application is a list of values available in C++ source code (converted to a numeric value in database).
QxEntityEditor application provides features to create, modify, delete and clone enumeration.
Add/modify/delete/clone an enumeration
Add, modify, delete and clone an enumeration is done via equivalent menu for an entity (just replace entity word by enumeration).
So QxEntityEditor application provides exactly same menus as an entity to manage enumeration.
Enumeration parameters are accessible via Enumeration settings tab :
This parameters screen is divided in several sections : -- Section Enumeration information (version XX) : enumeration version is incremented by each project historic.
-- Section List of values :
-- Section List of meta-data : meta-data provides a way to add and manage extra-parameters and are available in C++ source code (QxOrm introspection engine) and Javascript engine to customize QxEntityEditor export process.
Colors associated to an enumeration
Enumeration colors can be defined via right-click contextual menu Define enumeration colors :
Note : items colors in the entities diagram can be defined at several levels (from the more global level to the more specific level) :
A namespace in QxEntityEditor application is used to group several items (entities and enumerations) in a same area.
From a database point of view, a namespace is generally a schema.
In C++ source code, a namespace defines where classes and functions are located (to group them).
Namespaces are used by the following QxEntityEditor feature : Organize diagram layout (to group items automatically). The QxEntityEditor application treeview (which displays all loaded items in a project) provides some menus to manage namespaces :
To rename a namespace, just do a right-click on project treeview, then contextual menu Move entities to another namespace :
To define items colors at a namespace level, just do a right-click on project treeview, then contextual menu Define colors by namespace :
The left part of this screen displays all namespaces available in *.qxee project. The right part of this screen provides a way to manage colors for all items located in the selected namespace. It is also possible to define a background color (generally a light color) to group all items in entities diagram. Note : items colors in the entities diagram can be defined at several levels (from the more global level to the more specific level) :
A comment (or post-it) in QxEntityEditor application is a tag displayed on entities diagram to provide some details about data model or *.qxee project.
A post-it can be moved everywhere in the entities diagram.
A post-it has a title and a free text area.
It is possible to write some text using HTML format to add colors, put text in bold, italic, etc...
QxEntityEditor application provides features to create, modify, delete and clone comment/post-it. Add/modify/delete/clone a post-it
Add, modify, delete and clone a post-it is done via equivalent menu for an entity (just replace entity word by comment).
So QxEntityEditor application provides exactly same menus as an entity to manage post-it. Colors associated to a post-it
Post-it colors can be defined via right-click contextual menu Define comment colors :
Note : items colors in the entities diagram can be defined at several levels (from the more global level to the more specific level) :
A feature is available in QxEntityEditor application to group automatically all items in entities diagram depending on namespace, and depending on relationships between entities : main menu View >> Organize diagram layout.
This feature can be useful for example to organize entities diagram after executing an import process.
Project historic (tag project state)
A QxEntityEditor project can have several versions/historics : main menu Actions >> Tag project state.
Each project historic changes project items version number (entities, properties, relationships, etc...). Version number is used to manage ascendant compatibility with serialization engine of QxOrm library. Project historic is also used by database DDL SQL export plugin : manage database schema evolution (add a table, remove a column, add an index, etc...). The first tab of this historic screen provides a way to create a new historic title (for example : date/time, project version number, etc...) and a comment in free text. The second tab of this historic screen displays the list of all project historics already saved. This list of historics provides buttons to restore a project state in several formats (XML, JSON or QxEntityEditor *.qxee project file).
It is possible to display a preview of generated C++ source code (header *.h and source *.cpp files) for the selected item in entities diagram (entity or enumeration).
This C++ source code can be generated by C++ export plugin of QxEntityEditor.
C++ preview is accessible after selecting an item in entities diagram, then go to C++ preview tab :
Naming convention (snake_case, camelCase)
QxEntityEditor application provides a feature to apply quickly a naming convention on all project items (entities, properties, relationships, etc...).
This feature keeps (doesn't break) mapping with database. This feature is available via main menu : Naming convention.
3 styles of naming convention are provided : snake_case, camelCase and PascalCase.
Note : this feature can be useful for example after executing an import process to harmonize generated C++ source code.
All import process in QxEntityEditor application are accessible via main menu Import :
Import from a directory linked to a Source Control manager (Git, Perforce, CVS, etc.)
A QxEntityEditor project (*.qxee file) can be managed by a developers team : the source code of a QxEntityEditor project can be exported/imported (manually or using command line) with QxEESourceControlExport and QxEESourceControlImport plugins.
Associated with a Source Control manager (Git, Perforce, CVS, etc.), these 2 plugins provide :
The parameter to enter corresponds to the JSON file present at the root of the directory where the *.qxee project was exported. This JSON file is named <project_name>.qxee.export.json, for example with the qxBlog sample project : qxBlog.qxee.export.json. Warning : an import deletes all elements of the current project (entities, properties, relationships, etc.). Note : It is possible to start QxEntityEditor from the command line to automatically load a directory associated with a source code manager when the application starts. Command line example : QxEntityEditor --project="<path_to_your_qxee_project_file>" --plugin=QxEESourceControlImport --QxEESourceControlImport_path="<path_to_the_root_source_control_json_file>" Import project based on JSON file
Note : to work with a source code manager (Git, Perforce, CVS, etc.), it is recommended to use QxEESourceControlExport and QxEESourceControlImport plugins (instead of creating a single file).
A QxEntityEditor project can be managed with a text file in JSON format : main menu Import >> Import from JSON file. To know the JSON structure of a *.qxee project, it is recommended to do a first export process to JSON file. The JSON import screen is simple and has only 1 field to define : the JSON file to import. Warning : a JSON import process removes all items from current project (entities, properties, relationships, etc...). Note : QxEntityEditor application can be executed with a command-line to load automatically a JSON file at startup. Here is a command-line example : QxEntityEditor --project="<path_to_your_qxee_project_file>" --plugin=QxEEJsonImport --QxEEJsonImport_file="<path_to_your_json_file>" Here is a JSON file example (deployed in ./samples/qxBlog.json directory of QxEntityEditor package) : { "app_version": 0, "description": "", "dt_creation": "20131206221737", "dt_modification": "20131206221737", "id": 1, "list_all_entities": [ { "app_version": 0, "description": "", "dt_creation": "20131206221810", "dt_modification": "20140617214144", "id": 1, "is_abstract": false, "is_read_only": false, "key": "", "list_functions": null, "list_functions_static": null, "list_meta_data": null, "list_properties": [ { "accessibility": "protected", "allow_null": false, "app_version": 0, "column_name": "", "description": "", "dt_creation": "20131206221810", "dt_modification": "20140617214144", "entity_id": { "id": 1 }, "force_sql_alias": "", "force_sql_type": "", "format": "", "get_method": "", "id": 1, "is_index": true, "is_obsolete": false, "is_primary_key": true, "is_read_only": false, "is_serializable": true, "is_transient": false, "is_unique": false, "key": "", "list_meta_data": null, "max_length": "", "max_value": "", "min_length": "", "min_value": "", "name": "author_id", "order_level": 0, "project_version": 0, "property_type_id": { "app_version": 0, "collection": "", "decoration": "", "default_value": "", "dt_creation": "20131206221810", "dt_modification": "20140617214144", "entity_id": null, "enumeration_id": null, "id": 1, "list_meta_data": null, "primitive_type": "long", "property_id": { "id": 1 }, "user_id_creation": 0, "user_id_modification": 0 }, "qt_property": "", "reg_exp": "", "relation_id": null, "set_method": "", "user_id_creation": 0, "user_id_modification": 0, "version": 0, "write_accessors": true }, { "accessibility": "protected", "allow_null": true, "app_version": 0, "column_name": "", "description": "", "dt_creation": "20131206221810", "dt_modification": "20140617214144", "entity_id": { "id": 1 }, "force_sql_alias": "", "force_sql_type": "", "format": "", "get_method": "", "id": 2, "is_index": false, "is_obsolete": false, "is_primary_key": false, "is_read_only": false, "is_serializable": true, "is_transient": false, "is_unique": false, "key": "", "list_meta_data": null, "max_length": "", "max_value": "", "min_length": "", "min_value": "", "name": "firstname", "order_level": 1, "project_version": 0, "property_type_id": { "app_version": 0, "collection": "", "decoration": "", "default_value": "", "dt_creation": "20131206221810", "dt_modification": "20140617214144", "entity_id": null, "enumeration_id": null, "id": 2, "list_meta_data": null, "primitive_type": "QString", "property_id": { "id": 2 }, "user_id_creation": 0, "user_id_modification": 0 }, "qt_property": "", "reg_exp": "", "relation_id": null, "set_method": "", "user_id_creation": 0, "user_id_modification": 0, "version": 0, "write_accessors": true }, { "accessibility": "protected", "allow_null": true, "app_version": 0, "column_name": "", "description": "", "dt_creation": "20131206221810", "dt_modification": "20140617214144", "entity_id": { "id": 1 }, "force_sql_alias": "", "force_sql_type": "", "format": "", "get_method": "", "id": 3, "is_index": true, "is_obsolete": false, "is_primary_key": false, "is_read_only": false, "is_serializable": true, "is_transient": false, "is_unique": false, "key": "", "list_meta_data": null, "max_length": "", "max_value": "", "min_length": "", "min_value": "", "name": "lastname", "order_level": 2, "project_version": 0, "property_type_id": { "app_version": 0, "collection": "", "decoration": "", "default_value": "", "dt_creation": "20131206221810", "dt_modification": "20140617214144", "entity_id": null, "enumeration_id": null, "id": 3, "list_meta_data": null, "primitive_type": "QString", "property_id": { "id": 3 }, "user_id_creation": 0, "user_id_modification": 0 }, "qt_property": "", "reg_exp": "", "relation_id": null, "set_method": "", "user_id_creation": 0, "user_id_modification": 0, "version": 0, "write_accessors": true }, { "accessibility": "protected", "allow_null": true, "app_version": 0, "column_name": "", "description": "", "dt_creation": "20131206221810", "dt_modification": "20140617214144", "entity_id": { "id": 1 }, "force_sql_alias": "", "force_sql_type": "", "format": "", "get_method": "", "id": 4, "is_index": true, "is_obsolete": false, "is_primary_key": false, "is_read_only": false, "is_serializable": true, "is_transient": false, "is_unique": false, "key": "", "list_meta_data": null, "max_length": "", "max_value": "", "min_length": "", "min_value": "", "name": "birthdate", "order_level": 3, "project_version": 0, "property_type_id": { "app_version": 0, "collection": "", "decoration": "", "default_value": "", "dt_creation": "20131206221810", "dt_modification": "20140617214144", "entity_id": null, "enumeration_id": null, "id": 4, "list_meta_data": null, "primitive_type": "QDateTime", "property_id": { "id": 4 }, "user_id_creation": 0, "user_id_modification": 0 }, "qt_property": "", "reg_exp": "", "relation_id": null, "set_method": "", "user_id_creation": 0, "user_id_modification": 0, "version": 0, "write_accessors": true }, { "accessibility": "protected", "allow_null": true, "app_version": 0, "column_name": "", "description": "", "dt_creation": "20131206221810", "dt_modification": "20140617214144", "entity_id": { "id": 1 }, "force_sql_alias": "", "force_sql_type": "", "format": "", "get_method": "", "id": 5, "is_index": false, "is_obsolete": false, "is_primary_key": false, "is_read_only": false, "is_serializable": true, "is_transient": false, "is_unique": false, "key": "", "list_meta_data": null, "max_length": "", "max_value": "", "min_length": "", "min_value": "", "name": "sex", "order_level": 4, "project_version": 0, "property_type_id": { "app_version": 0, "collection": "", "decoration": "", "default_value": "", "dt_creation": "20131206221810", "dt_modification": "20140617214144", "entity_id": null, "enumeration_id": { "id": 1 }, "id": 5, "list_meta_data": null, "primitive_type": "sex::enum_sex", "property_id": { "id": 5 }, "user_id_creation": 0, "user_id_modification": 0 }, "qt_property": "", "reg_exp": "", "relation_id": null, "set_method": "", "user_id_creation": 0, "user_id_modification": 0, "version": 0, "write_accessors": true }, { "accessibility": "protected", "allow_null": true, "app_version": 0, "column_name": "", "description": "", "dt_creation": "20131206222031", "dt_modification": "20140617214144", "entity_id": { "id": 1 }, "force_sql_alias": "", "force_sql_type": "", "format": "", "get_method": "", "id": 18, "is_index": false, "is_obsolete": false, "is_primary_key": false, "is_read_only": false, "is_serializable": true, "is_transient": false, "is_unique": false, "key": "", "list_meta_data": null, "max_length": "", "max_value": "", "min_length": "", "min_value": "", "name": "list_of_blog", "order_level": 17, "project_version": 0, "property_type_id": { "app_version": 0, "collection": "qx::QxCollection", "decoration": "boost::shared_ptr", "default_value": "", "dt_creation": "20131206222031", "dt_modification": "20140617214144", "entity_id": { "id": 4 }, "enumeration_id": null, "id": 18, "list_meta_data": null, "primitive_type": "", "property_id": { "id": 18 }, "user_id_creation": 0, "user_id_modification": 0 }, "qt_property": "", "reg_exp": "", "relation_id": { "app_version": 0, "dt_creation": "20131206222031", "dt_modification": "20140617214144", "extra_table": "", "foreign_key": "author", "foreign_key_owner": "", "id": 2, "inverse_property_id": { "id": 15 }, "list_meta_data": null, "property_id": { "id": 18 }, "type_relation": "one-to-many", "user_id_creation": 0, "user_id_modification": 0 }, "set_method": "", "user_id_creation": 0, "user_id_modification": 0, "version": 0, "write_accessors": true } ], "name": "author", "namespace": "", "parent_id": null, "project_id": { "id": 1 }, "project_version": 0, "property_id": { "accessibility": "protected", "allow_null": false, "app_version": 0, "column_name": "", "description": "", "dt_creation": "20131206221810", "dt_modification": "20140617214144", "entity_id": { "id": 1 }, "force_sql_alias": "", "force_sql_type": "", "format": "", "get_method": "", "id": 1, "is_index": true, "is_obsolete": false, "is_primary_key": true, "is_read_only": false, "is_serializable": true, "is_transient": false, "is_unique": false, "key": "", "list_meta_data": null, "max_length": "", "max_value": "", "min_length": "", "min_value": "", "name": "author_id", "order_level": 0, "project_version": 0, "property_type_id": { "app_version": 0, "collection": "", "decoration": "", "default_value": "", "dt_creation": "20131206221810", "dt_modification": "20140617214144", "entity_id": null, "enumeration_id": null, "id": 1, "list_meta_data": null, "primitive_type": "long", "property_id": { "id": 1 }, "user_id_creation": 0, "user_id_modification": 0 }, "qt_property": "", "reg_exp": "", "relation_id": null, "set_method": "", "user_id_creation": 0, "user_id_modification": 0, "version": 0, "write_accessors": true }, "soft_delete_column": "", "table_name": "t_author", "trigger_after_delete": false, "trigger_after_fetch": false, "trigger_after_insert": false, "trigger_after_update": false, "trigger_before_delete": false, "trigger_before_fetch": false, "trigger_before_insert": false, "trigger_before_update": false, "user_id_creation": 0, "user_id_modification": 0, "validator_method": "", "version": 0 }, { "app_version": 0, "description": "", "dt_creation": "20131206222031", "dt_modification": "20140617214043", "id": 4, "is_abstract": false, "is_read_only": false, "key": "", "list_functions": null, "list_functions_static": null, "list_meta_data": null, "list_properties": [ { "accessibility": "protected", "allow_null": false, "app_version": 0, "column_name": "", "description": "", "dt_creation": "20131206222031", "dt_modification": "20140617214043", "entity_id": { "id": 4 }, "force_sql_alias": "", "force_sql_type": "", "format": "", "get_method": "", "id": 12, "is_index": true, "is_obsolete": false, "is_primary_key": true, "is_read_only": false, "is_serializable": true, "is_transient": false, "is_unique": false, "key": "", "list_meta_data": null, "max_length": "", "max_value": "", "min_length": "", "min_value": "", "name": "blog_id", "order_level": 11, "project_version": 0, "property_type_id": { "app_version": 0, "collection": "", "decoration": "", "default_value": "", "dt_creation": "20131206222031", "dt_modification": "20140617214043", "entity_id": null, "enumeration_id": null, "id": 12, "list_meta_data": null, "primitive_type": "long", "property_id": { "id": 12 }, "user_id_creation": 0, "user_id_modification": 0 }, "qt_property": "", "reg_exp": "", "relation_id": null, "set_method": "", "user_id_creation": 0, "user_id_modification": 0, "version": 0, "write_accessors": true }, { "accessibility": "protected", "allow_null": false, "app_version": 0, "column_name": "", "description": "", "dt_creation": "20131206222031", "dt_modification": "20140617214043", "entity_id": { "id": 4 }, "force_sql_alias": "", "force_sql_type": "", "format": "", "get_method": "", "id": 13, "is_index": true, "is_obsolete": false, "is_primary_key": false, "is_read_only": false, "is_serializable": true, "is_transient": false, "is_unique": false, "key": "", "list_meta_data": null, "max_length": "", "max_value": "", "min_length": "", "min_value": "", "name": "title", "order_level": 12, "project_version": 0, "property_type_id": { "app_version": 0, "collection": "", "decoration": "", "default_value": "", "dt_creation": "20131206222031", "dt_modification": "20140617214043", "entity_id": null, "enumeration_id": null, "id": 13, "list_meta_data": null, "primitive_type": "QString", "property_id": { "id": 13 }, "user_id_creation": 0, "user_id_modification": 0 }, "qt_property": "", "reg_exp": "", "relation_id": null, "set_method": "", "user_id_creation": 0, "user_id_modification": 0, "version": 0, "write_accessors": true }, { "accessibility": "protected", "allow_null": true, "app_version": 0, "column_name": "", "description": "", "dt_creation": "20131206222031", "dt_modification": "20140617214043", "entity_id": { "id": 4 }, "force_sql_alias": "", "force_sql_type": "", "format": "", "get_method": "", "id": 14, "is_index": false, "is_obsolete": false, "is_primary_key": false, "is_read_only": false, "is_serializable": true, "is_transient": false, "is_unique": false, "key": "", "list_meta_data": null, "max_length": "", "max_value": "", "min_length": "", "min_value": "", "name": "text", "order_level": 13, "project_version": 0, "property_type_id": { "app_version": 0, "collection": "", "decoration": "", "default_value": "", "dt_creation": "20131206222031", "dt_modification": "20140617214043", "entity_id": null, "enumeration_id": null, "id": 14, "list_meta_data": null, "primitive_type": "QString", "property_id": { "id": 14 }, "user_id_creation": 0, "user_id_modification": 0 }, "qt_property": "", "reg_exp": "", "relation_id": null, "set_method": "", "user_id_creation": 0, "user_id_modification": 0, "version": 0, "write_accessors": true }, { "accessibility": "protected", "allow_null": true, "app_version": 0, "column_name": "", "description": "", "dt_creation": "20131206222031", "dt_modification": "20140617214043", "entity_id": { "id": 4 }, "force_sql_alias": "", "force_sql_type": "", "format": "", "get_method": "", "id": 15, "is_index": false, "is_obsolete": false, "is_primary_key": false, "is_read_only": false, "is_serializable": true, "is_transient": false, "is_unique": false, "key": "", "list_meta_data": null, "max_length": "", "max_value": "", "min_length": "", "min_value": "", "name": "author", "order_level": 14, "project_version": 0, "property_type_id": { "app_version": 0, "collection": "qx::QxCollection", "decoration": "boost::shared_ptr", "default_value": "", "dt_creation": "20131206222031", "dt_modification": "20140617214043", "entity_id": { "id": 1 }, "enumeration_id": null, "id": 15, "list_meta_data": null, "primitive_type": "", "property_id": { "id": 15 }, "user_id_creation": 0, "user_id_modification": 0 }, "qt_property": "", "reg_exp": "", "relation_id": { "app_version": 0, "dt_creation": "20131206222031", "dt_modification": "20140617214043", "extra_table": "", "foreign_key": "", "foreign_key_owner": "", "id": 1, "inverse_property_id": { "id": 18 }, "list_meta_data": null, "property_id": { "id": 15 }, "type_relation": "many-to-one", "user_id_creation": 0, "user_id_modification": 0 }, "set_method": "", "user_id_creation": 0, "user_id_modification": 0, "version": 0, "write_accessors": true }, { "accessibility": "protected", "allow_null": true, "app_version": 0, "column_name": "", "description": "", "dt_creation": "20131206222031", "dt_modification": "20140617214043", "entity_id": { "id": 4 }, "force_sql_alias": "", "force_sql_type": "", "format": "", "get_method": "", "id": 16, "is_index": false, "is_obsolete": false, "is_primary_key": false, "is_read_only": false, "is_serializable": true, "is_transient": false, "is_unique": false, "key": "", "list_meta_data": null, "max_length": "", "max_value": "", "min_length": "", "min_value": "", "name": "list_of_comment", "order_level": 15, "project_version": 0, "property_type_id": { "app_version": 0, "collection": "qx::QxCollection", "decoration": "boost::shared_ptr", "default_value": "", "dt_creation": "20131206222031", "dt_modification": "20140617214043", "entity_id": { "id": 3 }, "enumeration_id": null, "id": 16, "list_meta_data": null, "primitive_type": "", "property_id": { "id": 16 }, "user_id_creation": 0, "user_id_modification": 0 }, "qt_property": "", "reg_exp": "", "relation_id": { "app_version": 0, "dt_creation": "20131206222031", "dt_modification": "20140617214043", "extra_table": "", "foreign_key": "blog_id", "foreign_key_owner": "", "id": 3, "inverse_property_id": { "id": 19 }, "list_meta_data": null, "property_id": { "id": 16 }, "type_relation": "one-to-many", "user_id_creation": 0, "user_id_modification": 0 }, "set_method": "", "user_id_creation": 0, "user_id_modification": 0, "version": 0, "write_accessors": true }, { "accessibility": "protected", "allow_null": true, "app_version": 0, "column_name": "", "description": "", "dt_creation": "20131206222031", "dt_modification": "20140617214043", "entity_id": { "id": 4 }, "force_sql_alias": "", "force_sql_type": "", "format": "", "get_method": "", "id": 17, "is_index": false, "is_obsolete": false, "is_primary_key": false, "is_read_only": false, "is_serializable": true, "is_transient": false, "is_unique": false, "key": "", "list_meta_data": null, "max_length": "", "max_value": "", "min_length": "", "min_value": "", "name": "list_of_category", "order_level": 16, "project_version": 0, "property_type_id": { "app_version": 0, "collection": "qx::QxCollection", "decoration": "boost::shared_ptr", "default_value": "", "dt_creation": "20131206222031", "dt_modification": "20140617214043", "entity_id": { "id": 2 }, "enumeration_id": null, "id": 17, "list_meta_data": null, "primitive_type": "", "property_id": { "id": 17 }, "user_id_creation": 0, "user_id_modification": 0 }, "qt_property": "", "reg_exp": "", "relation_id": { "app_version": 0, "dt_creation": "20131206222031", "dt_modification": "20140617214043", "extra_table": "t_qxee_blog_category", "foreign_key": "blog_id", "foreign_key_owner": "category_id", "id": 5, "inverse_property_id": { "id": 20 }, "list_meta_data": null, "property_id": { "id": 17 }, "type_relation": "many-to-many", "user_id_creation": 0, "user_id_modification": 0 }, "set_method": "", "user_id_creation": 0, "user_id_modification": 0, "version": 0, "write_accessors": true } ], "name": "blog", "namespace": "", "parent_id": null, "project_id": { "id": 1 }, "project_version": 0, "property_id": { "accessibility": "protected", "allow_null": false, "app_version": 0, "column_name": "", "description": "", "dt_creation": "20131206222031", "dt_modification": "20140617214043", "entity_id": { "id": 4 }, "force_sql_alias": "", "force_sql_type": "", "format": "", "get_method": "", "id": 12, "is_index": true, "is_obsolete": false, "is_primary_key": true, "is_read_only": false, "is_serializable": true, "is_transient": false, "is_unique": false, "key": "", "list_meta_data": null, "max_length": "", "max_value": "", "min_length": "", "min_value": "", "name": "blog_id", "order_level": 11, "project_version": 0, "property_type_id": { "app_version": 0, "collection": "", "decoration": "", "default_value": "", "dt_creation": "20131206222031", "dt_modification": "20140617214043", "entity_id": null, "enumeration_id": null, "id": 12, "list_meta_data": null, "primitive_type": "long", "property_id": { "id": 12 }, "user_id_creation": 0, "user_id_modification": 0 }, "qt_property": "", "reg_exp": "", "relation_id": null, "set_method": "", "user_id_creation": 0, "user_id_modification": 0, "version": 0, "write_accessors": true }, "soft_delete_column": "", "table_name": "t_blog", "trigger_after_delete": false, "trigger_after_fetch": false, "trigger_after_insert": false, "trigger_after_update": false, "trigger_before_delete": false, "trigger_before_fetch": false, "trigger_before_insert": false, "trigger_before_update": false, "user_id_creation": 0, "user_id_modification": 0, "validator_method": "", "version": 0 }, { "app_version": 0, "description": "", "dt_creation": "20131206221933", "dt_modification": "20140617214115", "id": 2, "is_abstract": false, "is_read_only": false, "key": "", "list_functions": null, "list_functions_static": null, "list_meta_data": null, "list_properties": [ { "accessibility": "protected", "allow_null": false, "app_version": 0, "column_name": "", "description": "", "dt_creation": "20131206221933", "dt_modification": "20140617214115", "entity_id": { "id": 2 }, "force_sql_alias": "", "force_sql_type": "", "format": "", "get_method": "", "id": 6, "is_index": true, "is_obsolete": false, "is_primary_key": true, "is_read_only": false, "is_serializable": true, "is_transient": false, "is_unique": false, "key": "", "list_meta_data": null, "max_length": "", "max_value": "", "min_length": "", "min_value": "", "name": "category_id", "order_level": 5, "project_version": 0, "property_type_id": { "app_version": 0, "collection": "", "decoration": "", "default_value": "", "dt_creation": "20131206221933", "dt_modification": "20140617214115", "entity_id": null, "enumeration_id": null, "id": 6, "list_meta_data": null, "primitive_type": "QString", "property_id": { "id": 6 }, "user_id_creation": 0, "user_id_modification": 0 }, "qt_property": "", "reg_exp": "", "relation_id": null, "set_method": "", "user_id_creation": 0, "user_id_modification": 0, "version": 0, "write_accessors": true }, { "accessibility": "protected", "allow_null": true, "app_version": 0, "column_name": "", "description": "", "dt_creation": "20131206221933", "dt_modification": "20140617214115", "entity_id": { "id": 2 }, "force_sql_alias": "", "force_sql_type": "", "format": "", "get_method": "", "id": 7, "is_index": false, "is_obsolete": false, "is_primary_key": false, "is_read_only": false, "is_serializable": true, "is_transient": false, "is_unique": false, "key": "", "list_meta_data": null, "max_length": "", "max_value": "", "min_length": "", "min_value": "", "name": "name", "order_level": 6, "project_version": 0, "property_type_id": { "app_version": 0, "collection": "", "decoration": "", "default_value": "", "dt_creation": "20131206221933", "dt_modification": "20140617214115", "entity_id": null, "enumeration_id": null, "id": 7, "list_meta_data": null, "primitive_type": "QString", "property_id": { "id": 7 }, "user_id_creation": 0, "user_id_modification": 0 }, "qt_property": "", "reg_exp": "", "relation_id": null, "set_method": "", "user_id_creation": 0, "user_id_modification": 0, "version": 0, "write_accessors": true }, { "accessibility": "protected", "allow_null": true, "app_version": 0, "column_name": "", "description": "", "dt_creation": "20131206221933", "dt_modification": "20140617214115", "entity_id": { "id": 2 }, "force_sql_alias": "", "force_sql_type": "", "format": "", "get_method": "", "id": 8, "is_index": false, "is_obsolete": false, "is_primary_key": false, "is_read_only": false, "is_serializable": true, "is_transient": false, "is_unique": false, "key": "", "list_meta_data": null, "max_length": "", "max_value": "", "min_length": "", "min_value": "", "name": "description", "order_level": 7, "project_version": 0, "property_type_id": { "app_version": 0, "collection": "", "decoration": "", "default_value": "", "dt_creation": "20131206221933", "dt_modification": "20140617214115", "entity_id": null, "enumeration_id": null, "id": 8, "list_meta_data": null, "primitive_type": "QString", "property_id": { "id": 8 }, "user_id_creation": 0, "user_id_modification": 0 }, "qt_property": "", "reg_exp": "", "relation_id": null, "set_method": "", "user_id_creation": 0, "user_id_modification": 0, "version": 0, "write_accessors": true }, { "accessibility": "protected", "allow_null": true, "app_version": 0, "column_name": "", "description": "", "dt_creation": "20131206222031", "dt_modification": "20140617214115", "entity_id": { "id": 2 }, "force_sql_alias": "", "force_sql_type": "", "format": "", "get_method": "", "id": 20, "is_index": false, "is_obsolete": false, "is_primary_key": false, "is_read_only": false, "is_serializable": true, "is_transient": false, "is_unique": false, "key": "", "list_meta_data": null, "max_length": "", "max_value": "", "min_length": "", "min_value": "", "name": "list_of_blog", "order_level": 19, "project_version": 0, "property_type_id": { "app_version": 0, "collection": "qx::QxCollection", "decoration": "boost::shared_ptr", "default_value": "", "dt_creation": "20131206222031", "dt_modification": "20140617214115", "entity_id": { "id": 4 }, "enumeration_id": null, "id": 20, "list_meta_data": null, "primitive_type": "", "property_id": { "id": 20 }, "user_id_creation": 0, "user_id_modification": 0 }, "qt_property": "", "reg_exp": "", "relation_id": { "app_version": 0, "dt_creation": "20131206222031", "dt_modification": "20140617214115", "extra_table": "t_qxee_blog_category", "foreign_key": "category_id", "foreign_key_owner": "blog_id", "id": 6, "inverse_property_id": { "id": 17 }, "list_meta_data": null, "property_id": { "id": 20 }, "type_relation": "many-to-many", "user_id_creation": 0, "user_id_modification": 0 }, "set_method": "", "user_id_creation": 0, "user_id_modification": 0, "version": 0, "write_accessors": true } ], "name": "category", "namespace": "", "parent_id": null, "project_id": { "id": 1 }, "project_version": 0, "property_id": { "accessibility": "protected", "allow_null": false, "app_version": 0, "column_name": "", "description": "", "dt_creation": "20131206221933", "dt_modification": "20140617214115", "entity_id": { "id": 2 }, "force_sql_alias": "", "force_sql_type": "", "format": "", "get_method": "", "id": 6, "is_index": true, "is_obsolete": false, "is_primary_key": true, "is_read_only": false, "is_serializable": true, "is_transient": false, "is_unique": false, "key": "", "list_meta_data": null, "max_length": "", "max_value": "", "min_length": "", "min_value": "", "name": "category_id", "order_level": 5, "project_version": 0, "property_type_id": { "app_version": 0, "collection": "", "decoration": "", "default_value": "", "dt_creation": "20131206221933", "dt_modification": "20140617214115", "entity_id": null, "enumeration_id": null, "id": 6, "list_meta_data": null, "primitive_type": "QString", "property_id": { "id": 6 }, "user_id_creation": 0, "user_id_modification": 0 }, "qt_property": "", "reg_exp": "", "relation_id": null, "set_method": "", "user_id_creation": 0, "user_id_modification": 0, "version": 0, "write_accessors": true }, "soft_delete_column": "", "table_name": "t_category", "trigger_after_delete": false, "trigger_after_fetch": false, "trigger_after_insert": false, "trigger_after_update": false, "trigger_before_delete": false, "trigger_before_fetch": false, "trigger_before_insert": false, "trigger_before_update": false, "user_id_creation": 0, "user_id_modification": 0, "validator_method": "", "version": 0 }, { "app_version": 0, "description": "", "dt_creation": "20131206221951", "dt_modification": "20131206221951", "id": 3, "is_abstract": false, "is_read_only": false, "key": "", "list_functions": null, "list_functions_static": null, "list_meta_data": null, "list_properties": [ { "accessibility": "protected", "allow_null": false, "app_version": 0, "column_name": "", "description": "", "dt_creation": "20131206221951", "dt_modification": "20131206221951", "entity_id": { "id": 3 }, "force_sql_alias": "", "force_sql_type": "", "format": "", "get_method": "", "id": 9, "is_index": true, "is_obsolete": false, "is_primary_key": true, "is_read_only": false, "is_serializable": true, "is_transient": false, "is_unique": false, "key": "", "list_meta_data": null, "max_length": "", "max_value": "", "min_length": "", "min_value": "", "name": "comment_id", "order_level": 8, "project_version": 0, "property_type_id": { "app_version": 0, "collection": "", "decoration": "", "default_value": "", "dt_creation": "20131206221951", "dt_modification": "20131206221951", "entity_id": null, "enumeration_id": null, "id": 9, "list_meta_data": null, "primitive_type": "long", "property_id": { "id": 9 }, "user_id_creation": 0, "user_id_modification": 0 }, "qt_property": "", "reg_exp": "", "relation_id": null, "set_method": "", "user_id_creation": 0, "user_id_modification": 0, "version": 0, "write_accessors": true }, { "accessibility": "protected", "allow_null": true, "app_version": 0, "column_name": "", "description": "", "dt_creation": "20131206221951", "dt_modification": "20131206221951", "entity_id": { "id": 3 }, "force_sql_alias": "", "force_sql_type": "", "format": "", "get_method": "", "id": 10, "is_index": false, "is_obsolete": false, "is_primary_key": false, "is_read_only": false, "is_serializable": true, "is_transient": false, "is_unique": false, "key": "", "list_meta_data": null, "max_length": "", "max_value": "", "min_length": "", "min_value": "", "name": "title", "order_level": 9, "project_version": 0, "property_type_id": { "app_version": 0, "collection": "", "decoration": "", "default_value": "", "dt_creation": "20131206221951", "dt_modification": "20131206221951", "entity_id": null, "enumeration_id": null, "id": 10, "list_meta_data": null, "primitive_type": "QString", "property_id": { "id": 10 }, "user_id_creation": 0, "user_id_modification": 0 }, "qt_property": "", "reg_exp": "", "relation_id": null, "set_method": "", "user_id_creation": 0, "user_id_modification": 0, "version": 0, "write_accessors": true }, { "accessibility": "protected", "allow_null": true, "app_version": 0, "column_name": "", "description": "", "dt_creation": "20131206221951", "dt_modification": "20131206221951", "entity_id": { "id": 3 }, "force_sql_alias": "", "force_sql_type": "", "format": "", "get_method": "", "id": 11, "is_index": false, "is_obsolete": false, "is_primary_key": false, "is_read_only": false, "is_serializable": true, "is_transient": false, "is_unique": false, "key": "", "list_meta_data": null, "max_length": "", "max_value": "", "min_length": "", "min_value": "", "name": "text", "order_level": 10, "project_version": 0, "property_type_id": { "app_version": 0, "collection": "", "decoration": "", "default_value": "", "dt_creation": "20131206221951", "dt_modification": "20131206221951", "entity_id": null, "enumeration_id": null, "id": 11, "list_meta_data": null, "primitive_type": "QString", "property_id": { "id": 11 }, "user_id_creation": 0, "user_id_modification": 0 }, "qt_property": "", "reg_exp": "", "relation_id": null, "set_method": "", "user_id_creation": 0, "user_id_modification": 0, "version": 0, "write_accessors": true }, { "accessibility": "protected", "allow_null": true, "app_version": 0, "column_name": "", "description": "", "dt_creation": "20131206222031", "dt_modification": "20131206222031", "entity_id": { "id": 3 }, "force_sql_alias": "", "force_sql_type": "", "format": "", "get_method": "", "id": 19, "is_index": false, "is_obsolete": false, "is_primary_key": false, "is_read_only": false, "is_serializable": true, "is_transient": false, "is_unique": false, "key": "", "list_meta_data": null, "max_length": "", "max_value": "", "min_length": "", "min_value": "", "name": "blog_id", "order_level": 18, "project_version": 0, "property_type_id": { "app_version": 0, "collection": "qx::QxCollection", "decoration": "boost::shared_ptr", "default_value": "", "dt_creation": "20131206222031", "dt_modification": "20131206222031", "entity_id": { "id": 4 }, "enumeration_id": null, "id": 19, "list_meta_data": null, "primitive_type": "", "property_id": { "id": 19 }, "user_id_creation": 0, "user_id_modification": 0 }, "qt_property": "", "reg_exp": "", "relation_id": { "app_version": 0, "dt_creation": "20131206222031", "dt_modification": "20131206222031", "extra_table": "", "foreign_key": "", "foreign_key_owner": "", "id": 4, "inverse_property_id": { "id": 16 }, "list_meta_data": null, "property_id": { "id": 19 }, "type_relation": "many-to-one", "user_id_creation": 0, "user_id_modification": 0 }, "set_method": "", "user_id_creation": 0, "user_id_modification": 0, "version": 0, "write_accessors": true } ], "name": "comment", "namespace": "", "parent_id": null, "project_id": { "id": 1 }, "project_version": 0, "property_id": { "accessibility": "protected", "allow_null": false, "app_version": 0, "column_name": "", "description": "", "dt_creation": "20131206221951", "dt_modification": "20131206221951", "entity_id": { "id": 3 }, "force_sql_alias": "", "force_sql_type": "", "format": "", "get_method": "", "id": 9, "is_index": true, "is_obsolete": false, "is_primary_key": true, "is_read_only": false, "is_serializable": true, "is_transient": false, "is_unique": false, "key": "", "list_meta_data": null, "max_length": "", "max_value": "", "min_length": "", "min_value": "", "name": "comment_id", "order_level": 8, "project_version": 0, "property_type_id": { "app_version": 0, "collection": "", "decoration": "", "default_value": "", "dt_creation": "20131206221951", "dt_modification": "20131206221951", "entity_id": null, "enumeration_id": null, "id": 9, "list_meta_data": null, "primitive_type": "long", "property_id": { "id": 9 }, "user_id_creation": 0, "user_id_modification": 0 }, "qt_property": "", "reg_exp": "", "relation_id": null, "set_method": "", "user_id_creation": 0, "user_id_modification": 0, "version": 0, "write_accessors": true }, "soft_delete_column": "", "table_name": "t_comment", "trigger_after_delete": false, "trigger_after_fetch": false, "trigger_after_insert": false, "trigger_after_update": false, "trigger_before_delete": false, "trigger_before_fetch": false, "trigger_before_insert": false, "trigger_before_update": false, "user_id_creation": 0, "user_id_modification": 0, "validator_method": "", "version": 0 } ], "list_comments": [ { "app_version": 0, "comment_text": "- Design the entity model in few minutes\n\n- Generate C++ persistent classes automatically\n\n- Generate DDL SQL script automatically\n\n- Manage schema evolution for each project version\n\n- Compile C++ native code everywhere : Windows, Linux, MacOSX, Android, iOS, etc...\n\n- Transfer your data model over network and create quickly client/server applications", "comment_text_html": false, "comment_title": "qxBlog project", "dt_creation": "20131206222130", "dt_modification": "20140107093142", "id": 1, "list_meta_data": null, "user_id_creation": 0, "user_id_modification": 0 } ], "list_enumerations": [ { "app_version": 0, "description": "", "dt_creation": "20131206221840", "dt_modification": "20131210205552", "id": 1, "key": "", "list_meta_data": null, "list_of_key_value": { "female": 2, "male": 1, "unknown": 3 }, "name": "sex", "namespace": "", "project_id": { "id": 1 }, "project_version": 0, "qt_enum": false, "user_id_creation": 0, "user_id_modification": 0, "version": 0 } ], "list_groups": null, "list_meta_data": null, "list_namespaces": null, "location": "C:/Temp/qxee", "name": "qxBlog", "project_guid": "{16335d56-73ac-48cf-8fcd-f74cc7d97201}", "project_parameters": { "app_version": 0, "default_entity_namespace": "", "default_primary_key_type": "long", "default_property_type": "QString", "dt_creation": "20131206221737", "dt_modification": "20131206221737", "id": 1, "list_meta_data": null, "lst_plugin_script": { }, "primary_key_prefix": "", "primary_key_suffix": "_id", "project_id": { "id": 1 }, "table_name_prefix": "t_", "table_name_suffix": "", "user_id_creation": 0, "user_id_modification": 0 }, "user_id_creation": 0, "user_id_modification": 0, "version": 0 } Import from MySQL or MariaDB database
A MySQL (or MariaDB) database structure can be imported in QxEntityEditor application via main menu : Import >> Import from MySQL (or MariaDB) database :
This import parameters screen is divided in several sections : -- Section MySQL (or MariaDB) database connection :
-- Section Import settings :
-- Section Relationship import settings :
-- Section Mapping database SQL type to C++ type : QxEntityEditor provides a default mapping SQL type / C++ type. You can use this list to override default behaviour :
-- Section Database items to import to QxEntityEditor project : when QxEntityEditor is connected to database, all items (tables, columns, primary keys, relationships, views, etc...) are displayed in this section. By default, there is no item selected. You can select all items to import with 1 click on the treeview root item. It is also possible to select quickly items from a specific schema. Once items to import are selected, the « Ok » button becomes enabled to run import process. Note : all import parameters (database connection, import settings and relationships, SQL type / C++ type mapping, etc...) are automatically saved when closing the import screen. All import parameters are automatically re-loaded when opening the import screen. Other note : a QxEntityEditor video is available to show how to import the MySQL database sample named sakila. Import from PostgreSQL database
A PostgreSQL database structure can be imported in QxEntityEditor application via main menu : Import >> Import from PostgreSQL database :
This import parameters screen is divided in several sections : -- Section PostgreSQL database connection :
-- Section Import settings :
-- Section Relationship import settings :
-- Section Mapping database SQL type to C++ type : QxEntityEditor provides a default mapping SQL type / C++ type. You can use this list to override default behaviour :
-- Section Database items to import to QxEntityEditor project : when QxEntityEditor is connected to database, all items (tables, columns, primary keys, relationships, views, etc...) are displayed in this section. By default, there is no item selected. You can select all items to import with 1 click on the treeview root item. It is also possible to select quickly items from a specific schema. Once items to import are selected, the « Ok » button becomes enabled to run import process. Note : all import parameters (database connection, import settings and relationships, SQL type / C++ type mapping, etc...) are automatically saved when closing the import screen. All import parameters are automatically re-loaded when opening the import screen. Other note : a QxEntityEditor video is available to show how to import the MySQL database sample named sakila.
A SQLite database structure can be imported in QxEntityEditor application via main menu : Import >> Import from SQLite database :
This import parameters screen is divided in several sections : -- Section Database connection :
-- Section Import settings :
-- Section Relationship import settings :
-- Section Mapping database SQL type to C++ type : QxEntityEditor provides a default mapping SQL type / C++ type. You can use this list to override default behaviour :
-- Section Database items to import to QxEntityEditor project : when QxEntityEditor is connected to database, all items (tables, columns, primary keys, relationships, views, etc...) are displayed in this section. By default, there is no item selected. You can select all items to import with 1 click on the treeview root item. It is also possible to select quickly items from a specific schema. Once items to import are selected, the « Ok » button becomes enabled to run import process. Note : all import parameters (database connection, import settings and relationships, SQL type / C++ type mapping, etc...) are automatically saved when closing the import screen. All import parameters are automatically re-loaded when opening the import screen. Other note : a QxEntityEditor video is available to show how to import the MySQL database sample named sakila. Import from database using ODBC driver (Oracle, MS SQL Server, etc.)
QxEntityEditor application provides a generic database import using ODBC drivers : main menu Import >> Import from database using ODBC driver.
This kind of import process requires a DSN (Data Source Name) defined on the environment.
Import by ODBC process is able to manage following databases : Oracle, Microsoft SQL Server, SQLite, MySQL/MariaDB, PostgreSQL, etc...
This import parameters screen is divided in several sections : -- Section Database connection :
-- Section Import settings :
-- Section Relationship import settings :
-- Section Mapping database SQL type to C++ type : QxEntityEditor provides a default mapping SQL type / C++ type. You can use this list to override default behaviour :
-- Section Database items to import to QxEntityEditor project : when QxEntityEditor is connected to database, all items (tables, columns, primary keys, relationships, views, etc...) are displayed in this section. By default, there is no item selected. You can select all items to import with 1 click on the treeview root item. It is also possible to select quickly items from a specific schema. Once items to import are selected, the « Ok » button becomes enabled to run import process. Note : all import parameters (database connection, import settings and relationships, SQL type / C++ type mapping, etc...) are automatically saved when closing the import screen. All import parameters are automatically re-loaded when opening the import screen. Other note : a QxEntityEditor video is available to show how to import the MySQL database sample named sakila.
All export process in QxEntityEditor application are accessible via main menu Export :
C++ export generates a full C++ project ready to be built (using qmake and/or cmake) which contains all entities/properties/relationships/enumerations registered in QxOrm context.
All QxOrm library features (persistence, serialization, introspection, etc...) are available for all items inside generated C++ project.
C++ export parameters are accessible via main menu : Tools >> Export to C++ project (settings).
Export parameters screen is displayed automatically when the first export is launched if no setting is saved in *.qxee project.
When a C++ export process has already been executed, then export parameters screen is only accessible via : Tools >> Export to C++ project (settings) :
This export parameters screen is divided in several sections : -- Section C++ export settings :
-- Section Custom script (Javascript file) to change the default behaviour of the export process : settings for export custom engine.
-- Section C++ template files : this section defines entities C++ source code for Header *.h and Source *.cpp files. Export engine is based on placeholders (@@ACTION@@ format) to replace code by calculated value. Placeholder is the most important part to understand how Javascript customization engine works. Please note that you can define your own custom placeholder with @@CUSTOM_ prefix, for example : @@CUSTOM_MY_ACTION@@.
Overview of generated C++ project
Output directory of generated C++ project looks like :
Build generated C++ project (using qmake or cmake)
Generated C++ project can be built using CMake or qmake.
QxOrm library provides some documented compilation options in QxOrm.pri (and QxOrm.cmake) configuration files (you can keep default compilation options). QxOrm library user manual has a topic about how to build a QxOrm project. A tutorial is also available to explain how to setup an development environment on Windows with MSVC. Once C++ project is built, then output binary is available in the « bin » directory of exported project (*.dll on Windows, *.so on Linux, etc...). Example : how to use generated C++ project
The ./samples/ directory of QxEntityEditor package provides a sample project : qxBlog.qxee.
This qxBlog.qxee project can be opened in QxEntityEditor application without any valid license key.
Once C++ project is exported by QxEntityEditor, you can build the project to get a qxBlog.dll shared library (or qxBlog.so on Linux).
This shared library registers all entities, properties and enumerations in QxOrm context : so all QxOrm library features are available.
The ./samples/ directory of QxEntityEditor package also provides a C++ sample project which depends on qxBlog.qxee exported project : qxBlogExec.zip. Once qxBlogExec.zip is unzipped, the readme.txt file in the root folder contains instructions to build this sample project : -------------------------------------------- -- To build qxBlogExec project with qmake -- -------------------------------------------- 1- Export the 'qxBlog.qxee' project as a C++ project with QxEntityEditor and build it 2- Open the 'qxBlogExec.pro' file 3- Replace '$$(QXORM_DIR)' by your QxOrm library installation path 4- Replace 'C:/Temp/qxee/cpp/' by the path where you have exported the 'qxBlog.qxee' project as a C++ project 5- run command line : qmake 6- run command line : make debug (or make release) -------------------------------------------- -- To build qxBlogExec project with CMake -- -------------------------------------------- 1- Export the 'qxBlog.qxee' project as a C++ project with QxEntityEditor and build it 2- Open the 'CMakeLists.txt' file 3- Replace '$ENV{QXORM_DIR}' by your QxOrm library installation path 4- Replace 'C:/Temp/qxee/cpp/' by the path where you have exported the 'qxBlog.qxee' project as a C++ project 5- run cmake or cmake-gui to configure and generate your make files Here is the commented content of main() function (close to qxBlog tutorial) : int main(int argc, char * argv[]) { // Qt application QCoreApplication app(argc, argv); QFile::remove("./qxBlog.sqlite"); // Parameters to connect to database qx::QxSqlDatabase::getSingleton()->setDriverName("QSQLITE"); qx::QxSqlDatabase::getSingleton()->setDatabaseName("./qxBlog.sqlite"); qx::QxSqlDatabase::getSingleton()->setHostName("localhost"); qx::QxSqlDatabase::getSingleton()->setUserName("root"); qx::QxSqlDatabase::getSingleton()->setPassword(""); // Only for debug purpose : assert if invalid offset detected fetching a relation qx::QxSqlDatabase::getSingleton()->setVerifyOffsetRelation(true); // !!! TO CREATE TABLES, PLEASE USE THE C++ DDL SQL EXPORT PLUGIN OF QXENTITYEDITOR !!! // Create all tables in database (you should not use 'qx::dao::create_table<T>()' function in a production software, use it just for prototypes or samples) QSqlError daoError = qx::dao::create_table<author>(); daoError = qx::dao::create_table<comment>(); daoError = qx::dao::create_table<category>(); daoError = qx::dao::create_table<blog>(); // Create a list of 3 author author_ptr author_1; author_1.reset(new author()); author_ptr author_2; author_2.reset(new author()); author_ptr author_3; author_3.reset(new author()); author_1->setlastname("author_1"); author_1->setsex(sex::male); author_1->setbirthdate(QDateTime::currentDateTime()); author_2->setlastname("author_2"); author_2->setsex(sex::female); author_2->setbirthdate(QDateTime::currentDateTime()); author_3->setlastname("author_3"); author_3->setsex(sex::female); author_3->setbirthdate(QDateTime::currentDateTime()); list_of_author authorX; authorX.insert(1, author_1); authorX.insert(2, author_2); authorX.insert(3, author_3); // Insert list of 3 author into database daoError = qx::dao::insert(authorX); qAssert(qx::dao::count<author>() == 3); // Clone author n°2 : 'author_id_2' author_ptr author_clone = qx::clone(* author_2); qAssert(author_clone->getauthor_id() == author_2->getauthor_id()); qAssert(author_clone->getsex() == sex::female); // Create a query to fetch only female author : 'author_id_2' and 'author_id_3' qx::QxSqlQuery query("WHERE t_author.sex = :sex"); query.bind(":sex", sex::female); list_of_author list_of_female_author; daoError = qx::dao::fetch_by_query(query, list_of_female_author); qAssert(list_of_female_author.count() == 2); // Dump list of female author (xml serialization) qx::dump(list_of_female_author); // Create 3 categories category_ptr category_1 = category_ptr(new category("cat_1")); category_ptr category_2 = category_ptr(new category("cat_2")); category_ptr category_3 = category_ptr(new category("cat_3")); category_1->setname("category_1"); category_1->setdescription("desc_1"); category_2->setname("category_2"); category_2->setdescription("desc_2"); category_3->setname("category_3"); category_3->setdescription("desc_3"); { // Create a scope to destroy temporary connexion to database // Open a transaction to database QSqlDatabase db = qx::QxSqlDatabase::getDatabase(); bool bCommit = db.transaction(); // Insert 3 categories into database, use 'db' parameter for the transaction daoError = qx::dao::insert(category_1, (& db)); bCommit = (bCommit && ! daoError.isValid()); daoError = qx::dao::insert(category_2, (& db)); bCommit = (bCommit && ! daoError.isValid()); daoError = qx::dao::insert(category_3, (& db)); bCommit = (bCommit && ! daoError.isValid()); qAssert(bCommit); qAssert(category_1->getcategory_id() != ""); qAssert(category_2->getcategory_id() != ""); qAssert(category_3->getcategory_id() != ""); // Terminate transaction => commit or rollback if there is error if (bCommit) { db.commit(); } else { db.rollback(); } } // End of scope : 'db' is destroyed // Create a blog with the class name (factory) boost::any blog_any = qx::create("blog"); blog_ptr blog_1; try { blog_1 = boost::any_cast<blog_ptr>(blog_any); } catch (...) { blog_1.reset(new blog()); } blog_1->settext("blog_text_1"); blog_1->settitle("blog_title_1"); blog_1->setauthor(author_1); // Insert 'blog_1' into database with 'save()' method daoError = qx::dao::save(blog_1); // Modify 'blog_1' properties and save into database blog_1->settext("update blog_text_1"); blog_1->setauthor(author_2); daoError = qx::dao::save(blog_1); // Add 2 comments to 'blog_1' comment_ptr comment_1; comment_1.reset(new comment()); comment_ptr comment_2; comment_2.reset(new comment()); comment_1->settext("comment_1 text"); comment_1->setblog_id(blog_1); comment_2->settext("comment_2 text"); comment_2->setblog_id(blog_1); daoError = qx::dao::insert(comment_1); daoError = qx::dao::insert(comment_2); qAssert(qx::dao::count<comment>() == 2); // Add 2 categories to 'blog_1' => must insert into extra-table 'category_blog' blog::type_list_of_category lst_category; lst_category.insert(category_1->getcategory_id(), category_1); lst_category.insert(category_3->getcategory_id(), category_3); blog_1->setlist_of_category(lst_category); daoError = qx::dao::save_with_relation("list_of_category", blog_1); // Fetch blog into a new variable with all relation : 'author', 'comment' and 'category' blog_ptr blog_tmp; blog_tmp.reset(new blog()); blog_tmp->setblog_id(blog_1->getblog_id()); daoError = qx::dao::fetch_by_id_with_all_relation(blog_tmp); qAssert(blog_tmp->list_of_comment().count() == 2); qAssert(blog_tmp->list_of_category().count() == 2); qAssert(blog_tmp->gettext() == "update blog_text_1"); qAssert(blog_tmp->getauthor() && blog_tmp->getauthor()->getauthor_id() == author_2->getauthor_id()); // Fetch blog into a new variable with many relations using "*->*->*->*" (4 levels of relationships) blog_tmp.reset(new blog()); blog_tmp->setblog_id(blog_1->getblog_id()); daoError = qx::dao::fetch_by_id_with_relation("*->*->*->*", blog_tmp); qAssert(blog_tmp->list_of_comment().count() == 2); qAssert(blog_tmp->list_of_category().count() == 2); qAssert(blog_tmp->gettext() == "update blog_text_1"); qAssert(blog_tmp->getauthor() && blog_tmp->getauthor()->getauthor_id() == author_2->getauthor_id()); // Dump 'blog_tmp' result from database (xml serialization) qx::dump(blog_tmp); // Check qx::dao::save_with_relation_recursive() function daoError = qx::dao::save_with_relation_recursive(blog_tmp); qAssert(! daoError.isValid()); daoError = qx::dao::save_with_relation_recursive(blog_tmp, qx::dao::save_mode::e_update_only); qAssert(! daoError.isValid()); // Call 'age()' method with class name and method name (reflexion) //qx_bool bInvokeOk = qx::QxClassX::invoke("author", "age", author_1); //qAssert(bInvokeOk); // Test 'isDirty()' method qx::dao::ptr<blog> blog_isdirty = qx::dao::ptr<blog>(new blog()); blog_isdirty->setblog_id(blog_1->getblog_id()); daoError = qx::dao::fetch_by_id(blog_isdirty); qAssert(! daoError.isValid() && ! blog_isdirty.isDirty()); blog_isdirty->settext("blog property 'text' modified => blog is dirty !!!"); QStringList lstDiff; bool bDirty = blog_isdirty.isDirty(lstDiff); qAssert(bDirty && (lstDiff.count() == 1) && (lstDiff.at(0) == "text")); if (bDirty) { qDebug("[QxOrm] test dirty 1 : blog is dirty => '%s'", qPrintable(lstDiff.join("|"))); } // Update only property 'm_text' of 'blog_isdirty' daoError = qx::dao::update_optimized(blog_isdirty); qAssert(! daoError.isValid() && ! blog_isdirty.isDirty()); qx::dump(blog_isdirty); // Test 'isDirty()' method with a container typedef qx::dao::ptr< QList<author_ptr> > type_lst_author_test_is_dirty; type_lst_author_test_is_dirty container_isdirty = type_lst_author_test_is_dirty(new QList<author_ptr>()); daoError = qx::dao::fetch_all(container_isdirty); qAssert(! daoError.isValid() && ! container_isdirty.isDirty() && (container_isdirty->count() == 3)); author_ptr author_ptr_dirty = container_isdirty->at(1); author_ptr_dirty->setlastname("author name modified at index 1 => container is dirty !!!"); bDirty = container_isdirty.isDirty(lstDiff); qAssert(bDirty && (lstDiff.count() == 1)); if (bDirty) { qDebug("[QxOrm] test dirty 2 : container is dirty => '%s'", qPrintable(lstDiff.join("|"))); } author_ptr_dirty = container_isdirty->at(2); author_ptr_dirty->setfirstname("firstname changed"); bDirty = container_isdirty.isDirty(lstDiff); qAssert(bDirty && (lstDiff.count() == 2)); if (bDirty) { qDebug("[QxOrm] test dirty 3 : container is dirty => '%s'", qPrintable(lstDiff.join("|"))); } // Update only property 'm_name' at position 1, only property 'm_birthdate' at position 2 and nothing at position 0 daoError = qx::dao::update_optimized(container_isdirty); qAssert(! daoError.isValid() && ! container_isdirty.isDirty()); qx::dump(container_isdirty); // Fetch only property 'm_text' of blog QStringList lstColumns = QStringList() << "text"; QList<blog_ptr> lst_blog_with_only_text; daoError = qx::dao::fetch_all(lst_blog_with_only_text, NULL, lstColumns); qAssert(! daoError.isValid() && (lst_blog_with_only_text.size() > 0)); if ((lst_blog_with_only_text.size() > 0) && (lst_blog_with_only_text[0].get() != NULL)) { qAssert(lst_blog_with_only_text[0]->gettitle().isEmpty()); } qx::dump(lst_blog_with_only_text); // Dump all registered classes into QxOrm context (introspection engine) qx::QxClassX::dumpAllClasses(); // Call a custom SQL query or a stored procedure qx_query testStoredProc("SELECT * FROM t_author"); daoError = qx::dao::call_query(testStoredProc); qAssert(! daoError.isValid()); testStoredProc.dumpSqlResult(); // Call a custom SQL query or a stored procedure and fetch automatically properties (with a collection of items) qx_query testStoredProcBis("SELECT * FROM t_author"); authorX.clear(); daoError = qx::dao::execute_query(testStoredProcBis, authorX); qAssert(! daoError.isValid()); qAssert(authorX.count() > 0); qx::dump(authorX); // Call a custom SQL query or a stored procedure and fetch automatically properties qx_query testStoredProcThird("SELECT name, category_id FROM t_category"); category_ptr category_tmp = category_ptr(new category()); daoError = qx::dao::execute_query(testStoredProcThird, category_tmp); qAssert(! daoError.isValid()); qAssert(category_tmp->getcategory_id() != ""); qx::dump(category_tmp); return 0; } Export to C++ model/view project
QxOrm library provides QxModelView module.
A documentation about QxModelView module is available in the QxOrm library user manual.
QxModelView module provides a way to work with Qt model/view engine with all classes registered in QxOrm context :
QxEntityEditor application is able to generate a full C++ model/view project ready to be built : so all entities and their relationships are accessible in QML views.
C++ model/view export parameters are accessible via main menu : Tools >> Export to C++ model/view project (settings).
Export parameters screen is displayed automatically when the first export is launched if no setting is saved in *.qxee project.
When a C++ model/view export process has already been executed, then export parameters screen is only accessible via : Tools >> Export to C++ model/view project (settings) :
This export parameters screen is divided in several sections : -- Section C++ model/view export settings :
-- Section Custom script (Javascript file) to change the default behaviour of the export process : settings for export custom engine.
-- Section C++ model/view template files : this section defines model/view C++ source code for Header *.h and Source *.cpp files. Export engine is based on placeholders (@@ACTION@@ format) to replace code by calculated value. Placeholder is the most important part to understand how Javascript customization engine works. Please note that you can define your own custom placeholder with @@CUSTOM_ prefix, for example : @@CUSTOM_MY_ACTION@@.
Output directory of generated C++ model/view project looks like :
Export to C++ services project
QxOrm library provides QxService module.
A documentation about QxService module is available in QxOrm library user manual.
QxService module of QxOrm library provides a way to create quickly a powerful C++ applications server (based on services with request from client and response from server).
A tutorial is available on QxOrm website to explain how to work with QxService module.
QxEntityEditor application is able to generate a full C++ services project ready to be built (a C++ project to manage client layer and a C++ project to publish services on server side) : so all entities and their relationships can be transfered over network (client/server application).
C++ services export parameters are accessible via main menu : Tools >> Export to C++ services project (settings).
Export parameters screen is displayed automatically when the first export is launched if no setting is saved in *.qxee project.
When a C++ services export process has already been executed, then export parameters screen is only accessible via : Tools >> Export to C++ services project (settings) :
This export parameters screen is divided in several sections : -- Section C++ services export settings :
-- Section Custom script (Javascript file) to change the default behaviour of the export process : settings for export custom engine.
-- Section C++ services template files : this section defines services C++ source code for Header *.h and Source *.cpp files (client and server). Export engine is based on placeholders (@@ACTION@@ format) to replace code by calculated value. Placeholder is the most important part to understand how Javascript customization engine works. Please note that you can define your own custom placeholder with @@CUSTOM_ prefix, for example : @@CUSTOM_MY_ACTION@@.
Output directory of generated C++ services project (client and server) looks like :
Generic application server to provide services
If « Generate server application » option is enabled, then C++ services export process generates also a generic applications server.
This sample applications server is able to publish services loading plugins.
Like all other C++ projects generated by QxEntityEditor, the generic applications server can be built with qmake and CMake.
Output directory of the generic applications server project looks like :
Once project is built, an executable is available in the « bin » directory. Open the executable will launch following window : This screen is divided in several sections : -- Section Plugins services :
-- Section Database connection parameters :
-- Section Server parameters :
-- Section Log last client-server reply-request transaction :
-- Section Log last server error :
Export SQL DDL database schema
QxEntityEditor application is able to generate a database schema (structure) in a DDL SQL format.
QxEntityEditor application support most commonly used databases : SQLite, MySQL, MariaDB, PostgreSQL, Oracle and Microsoft SQL Server.
Generated DDL SQL script can be imported in database to create automatically all tables, columns, primary keys, relationships, index, etc...
DDL SQL parameters are accessible via main menu : Tools >> Export to DDL SQL script file (settings) :
This export parameters screen is divided in several sections : -- Section DDL export settings :
-- Section Mapping C++ type to database SQL type :
-- Section Custom script (Javascript file) to change the default behaviour of the export process : settings for export custom engine.
QxEntityEditor application is able to print entities diagram to PNG and/or PDF format.
Print parameters are accessible via main menu : Tools >> Print the entities diagram (settings) :
Export to a directory linked to a Source Control manager (Git, Perforce, CVS, etc.)
A QxEntityEditor project (*.qxee file) can be managed by a developers team : the source code of a QxEntityEditor project can be exported/imported (manually or using command line) with QxEESourceControlExport and QxEESourceControlImport plugins.
Associated with a Source Control manager (Git, Perforce, CVS, etc.), these 2 plugins provide :
The parameter to enter corresponds to the directory in which the JSON files will be generated. Each *.qxee project item (entities, properties, relationships, comments, etc.) is exported to a specific JSON file. The directory where the JSON files are exported has the following structure : Note : it is possible to export a project from command line without starting the QxEntityEditor application UI. Command line example : QxEntityEditor --no_gui --project="<path_to_your_qxee_project_file>" --plugin=QxEESourceControlExport --QxEESourceControlExport_path="<path_to_your_export_output_directory>" Export project to XML or JSON format
Note : to work with a source code manager (Git, Perforce, CVS, etc.), it is recommended to use QxEESourceControlExport and QxEESourceControlImport plugins (instead of creating a single file).
QxEntityEditor application can export a *.qxee project to XML or JSON format. XML/JSON export parameters are accessible via main menu : Tools >> Export to XML or JSON file (settings) : Note : a XML file cannot be used to import items in a *.qxee project. On the other hand, a JSON file can be used to import items in a *.qxee project using the import plugin : Import project based on JSON file. Javascript engine to customize export
QxEntityEditor application provides a powerful export customization engine.
This engine is based on Javascript language to write scripts to customize QxEntityEditor exports.
These Javascript scripts can access to all parameters and items of a *.qxee project, and a QxEntityEditor native debugger can be enabled to help you to develop and fix your scripts.
It is also possible to write your own files during export process.
Note : the ./samples/ directory of QxEntityEditor package provides 2 documented samples scripts : custom_script.js and q_property.js. Architecture and workflow of Javascript engine
All QxEntityEditor export plugins provide following settings : Custom script (Javascript file) to change the default behaviour of the export process.
This is where you can define a Javascript file to use to customize your exports.
Export engine is based on placeholders (@@ACTION@@ format) to replace code by calculated value.
Placeholder is the most important part to understand how Javascript customization engine works.
Please note that you can define your own custom placeholder with @@CUSTOM_ prefix, for example : @@CUSTOM_MY_ACTION@@.
During an export process, QxEntityEditor application iterates over all entities and enumerations defined in *.qxee project.
Each time a placeholder is read by export engine (@@ACTION@@ format), the Javascript script is called with all input parameters required to customize output files.
Here is a minimal Javascript file example. This script does nothing, it just shows what is a valid QxEntityEditor Javascript file :
({ // Here is the entry point of the QxEntityEditor javascript engine // This function is called for each placeholder defined in the C++ template section customProcess : function(params) { try { // quit with 'params[0]' means : doesn't change the default export behaviour return params[0]; } catch (err) { return ("[CustomScriptError] an unexpected error occurred : " + err); } } }); Input parameters of Javascript engine
customProcess() function input parameter (named params) is an array which contain a list of values (this is the call context of the script).
Here is a sample function which can be used in your own scripts to list and to give meaning to all input values :
function printParams(params) { var log = ""; log = log + "\n - default_value = " + params[0]; log = log + "\n - project_name = " + params[1]; log = log + "\n - project_file = " + params[2]; log = log + "\n - plugin_name = " + params[3]; log = log + "\n - current_file = " + params[4]; log = log + "\n - action (or placeholder) = " + params[5]; log = log + "\n - entity_name = " + params[6]; log = log + "\n - entity_table_name = " + params[7]; log = log + "\n - property_name = " + params[8]; log = log + "\n - property_type = " + params[9]; log = log + "\n - property_column_name = " + params[10]; log = log + "\n - property_is_primary_key = " + params[11]; log = log + "\n - enumeration_name = " + params[12]; log = log + "\n - entity_id = " + params[13]; log = log + "\n - property_id = " + params[14]; log = log + "\n - enumeration_id = " + params[15]; log = log + "\n - output_location = " + params[16]; print(log); // print value to the custom script debugger window helper.print(log); // print value to the standard output (for example, on Windows, use the 'DebugView' application to see all logs) return log; } Available functions in Javascript
QxEntityEditor export customization engine support all Javascript language features (ECMAScript 5).
QxEntityEditor application provides also a global instance of object named helper which can be used in your own scripts to access to more features.
We will list in this chapter the most commonly used features to customize output files.
Here is an example to get all current entity parameters, helper.getEntityDetails(entity_id) :
var entity_id = params[13]; printEntityDetails(entity_id); //... function printEntityDetails(entity_id) { var details = helper.getEntityDetails(entity_id); if (details.length == 0) { return details; } var log = ""; log = log + "\n - entity_id = " + details[0]; log = log + "\n - entity_key = " + details[1]; log = log + "\n - entity_name = " + details[2]; log = log + "\n - entity_namespace = " + details[3]; log = log + "\n - entity_tablename = " + details[4]; log = log + "\n - entity_description = " + details[5]; log = log + "\n - entity_is_read_only = " + details[6]; log = log + "\n - entity_is_abstract = " + details[7]; log = log + "\n - entity_version = " + details[8]; log = log + "\n - entity_primary_key_property_id = " + details[9]; log = log + "\n - entity_list_of_properties_id = " + details[10]; log = log + "\n - entity_has_triggers = " + details[11]; log = log + "\n - entity_trigger_on_before_fetch = " + details[12]; log = log + "\n - entity_trigger_on_after_fetch = " + details[13]; log = log + "\n - entity_trigger_on_before_insert = " + details[14]; log = log + "\n - entity_trigger_on_after_insert = " + details[15]; log = log + "\n - entity_trigger_on_before_update = " + details[16]; log = log + "\n - entity_trigger_on_after_update = " + details[17]; log = log + "\n - entity_trigger_on_before_delete = " + details[18]; log = log + "\n - entity_trigger_on_after_delete = " + details[19]; log = log + "\n - entity_parent_id = " + details[20]; log = log + "\n - entity_soft_delete_column = " + details[21]; log = log + "\n - entity_validator_method = " + details[22]; print(log); // print value to the custom script debugger window helper.print(log); // print value to the standard output (for example, on Windows, use the 'DebugView' application to see all logs) return details; } Iterate over list of properties of an entity
Here is an example to iterate over all properties defined in current entity :
var entity_id = params[13]; var entity_details = helper.getEntityDetails(entity_id); var entity_list_of_properties_id = ((entity_details.length > 0) ? entity_details[10] : ""); var entity_list_of_properties_array = entity_list_of_properties_id.split("|"); for (var idx = 0; idx < entity_list_of_properties_array.length; idx++) { var property_id = entity_list_of_properties_array[idx]; var property_details = helper.getPropertyDetails(property_id); // ... }
Here is an example to get all property parameters, helper.getPropertyDetails(property_id) :
function printPropertyDetails(property_id) { var details = helper.getPropertyDetails(property_id); if (details.length == 0) { return details; } var log = ""; log = log + "\n - property_id = " + details[0]; log = log + "\n - property_key = " + details[1]; log = log + "\n - property_name = " + details[2]; log = log + "\n - property_column_name = " + details[3]; log = log + "\n - property_description = " + details[4]; log = log + "\n - property_type = " + details[5]; log = log + "\n - property_version = " + details[6]; log = log + "\n - property_entity_id = " + details[7]; log = log + "\n - property_is_read_only = " + details[8]; log = log + "\n - property_is_primary_key = " + details[9]; log = log + "\n - property_is_serializable = " + details[10]; log = log + "\n - property_is_transient = " + details[11]; log = log + "\n - property_is_obsolete = " + details[12]; log = log + "\n - property_is_index = " + details[13]; log = log + "\n - property_is_unique = " + details[14]; log = log + "\n - property_allow_null = " + details[15]; log = log + "\n - property_order_level = " + details[16]; log = log + "\n - property_default_value = " + details[17]; log = log + "\n - property_format = " + details[18]; log = log + "\n - property_force_sql_type = " + details[19]; log = log + "\n - property_force_sql_alias = " + details[20]; log = log + "\n - property_min_value = " + details[21]; log = log + "\n - property_max_value = " + details[22]; log = log + "\n - property_min_length = " + details[23]; log = log + "\n - property_max_length = " + details[24]; log = log + "\n - property_reg_exp = " + details[25]; log = log + "\n - property_accessibility = " + details[26]; log = log + "\n - property_is_relationship = " + details[27]; log = log + "\n - property_relation_type = " + details[28]; log = log + "\n - property_relation_entity_target_id = " + details[29]; log = log + "\n - property_relation_inverse_property_id = " + details[30]; log = log + "\n - property_relation_foreign_key = " + details[31]; log = log + "\n - property_relation_foreign_key_owner = " + details[32]; log = log + "\n - property_relation_extra_table = " + details[33]; log = log + "\n - property_relation_type_desc = " + details[34]; print(log); // print value to the custom script debugger window helper.print(log); // print value to the standard output (for example, on Windows, use the 'DebugView' application to see all logs) return details; }
Here is an example to get all current enumeration parameters, helper.getEnumerationDetails(enumeration_id) :
var enumeration_id = params[15]; printEnumerationDetails(enumeration_id); //... function printEnumerationDetails(enumeration_id) { var details = helper.getEnumerationDetails(enumeration_id); if (details.length == 0) { return details; } var log = ""; log = log + "\n - enumeration_id = " + details[0]; log = log + "\n - enumeration_key = " + details[1]; log = log + "\n - enumeration_name = " + details[2]; log = log + "\n - enumeration_namespace = " + details[3]; log = log + "\n - enumeration_description = " + details[4]; log = log + "\n - enumeration_version = " + details[5]; log = log + "\n - enumeration_use_qt_enum_macro = " + details[6]; log = log + "\n - enumeration_list_of_keys = " + details[7]; log = log + "\n - enumeration_list_of_values = " + details[8]; print(log); // print value to the custom script debugger window helper.print(log); // print value to the standard output (for example, on Windows, use the 'DebugView' application to see all logs) return details; } Get meta-data of entity/property/enumeration
QxEntityEditor application provides a feature to define some meta-data linked to entity, property or enumeration.
These meta-data can be used for example to define extra-parameters not provided by default by QxEntityEditor application.
These meta-data are available in generated C++ code (introspection engine of QxOrm library), and are also available in QxEntityEditor Javascript engine.
Here is an example to get meta-data values in Javascript :
var entity_id = params[13]; var entity_meta_data = helper.getEntityMetaData(entity_id, "MY_ENTITY_META_DATA_KEY"); // ... var property_meta_data = helper.getPropertyMetaData(property_id, "MY_PROPERTY_META_DATA_KEY"); // ... var enumeration_id = params[15]; var enumeration_meta_data = helper.getEnumerationMetaData(enumeration_id, "MY_ENUM_META_DATA_KEY");
Here is an example to get/set environment variables in Javascript, helper.getEnvironmentVariable() and helper.setEnvironmentVariable() :
var env_var = helper.getEnvironmentVariable("QT_DIR"); var set_env_var_ok = helper.setEnvironmentVariable("MY_ENV_VAR", "my_value");
Javascript engine of QxEntityEditor application is able to read and write to files (whatever files on your system, not only exported files).
Javascript classes file and dir are available to instantiate Javascript objects and to provide functions to manage files and directories.
The Javascript file class provides the same definition as QFile Qt class : /*
--- 'file' class methods available by script (QFile wrapper : http://doc.qt.io/qt-5/qfile.html) ---
bool copy(string fileName, string newName);
bool exists(string fileName);
bool link(string fileName, string linkName);
bool remove(string fileName);
bool rename(string oldName, string newName);
string readAll(string fileName);
void setFileName(string name);
string fileName();
bool open(int mode); // enum QIODevice::OpenMode, for example : 26 = (QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text) = (2 + 8 + 16)
int error(); // enum QFile::FileError
void close();
bool atEnd();
string readLine();
void write(string text);
*/
The Javascript dir class provides the same definition as QDir Qt class : /*
--- 'dir' class methods available by script (QDir wrapper : http://doc.qt.io/qt-5/qdir.html) ---
void setPath(string path);
string path();
string appPath();
string homePath();
string rootPath();
string tempPath();
string fromNativeSeparators(string pathName);
string toNativeSeparators(string pathName);
string cleanPath(string path);
bool isAbsolutePath(string path);
bool isRelativePath(string path);
bool match(string filter, string fileName);
bool mkdir(string dirName);
bool mkpath(string dirPath);
bool rmdir(string dirName);
bool rmpath(string dirPath);
bool exists(string name);
bool cdUp();
bool cd(string dirName);
string absoluteFilePath(string fileName);
string absolutePath();
string canonicalPath();
string dirName();
string filePath(string fileName);
void refresh();
string relativeFilePath(string fileName);
bool isAbsolute();
bool isReadable();
bool isRelative();
bool isRoot();
*/
Example : read a file content : var f1 = new file(); var f1_content = f1.readAll("C:\\Temp\\my_file.txt"); Other example : write to a file : var f2 = new file(); f2.setFileName("C:\\Temp\\file_generated_by_script.txt"); f2.open(26); // (QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text) = (2 + 8 + 16) f2.write("aaa"); f2.write("bbb"); f2.close(); Get list of entities/enumerations of a project
Here is how to get all entities and enumerations of a *.qxee project :
var listOfAllEntities = helper.getListOfAllEntities(); // 'listOfAllEntities' variable is an array, each item of this array contains : <entity_id>|<entity_name> var listOfAllEnums = helper.getListOfAllEnums(); // 'listOfAllEnums' variable is an array, each item of this array contains : <enum_id>|<enum_name> Fetch all application settings (at global level, project level and plugin level)
Here is how to fetch all application settings (JSON format) :
var globalSettings = helper.getQxEEGlobalSettingsJson(); // the result is a string in JSON format ==> so just use JSON.parse() function to get a javascript object instance var projectSettings = helper.getQxEEProjectSettingsJson(); // the result is a string in JSON format ==> so just use JSON.parse() function to get a javascript object instance var pluginSettings = helper.getQxEEPluginSetingsJson(); // the result is a string in JSON format ==> so just use JSON.parse() function to get a javascript object instance print(globalSettings); helper.print(globalSettings); print(projectSettings); helper.print(projectSettings); print(pluginSettings); helper.print(pluginSettings); globalSettings = JSON.parse(globalSettings); // Now 'globalSettings' is a javascript object instance projectSettings = JSON.parse(projectSettings); // Now 'projectSettings' is a javascript object instance pluginSettings = JSON.parse(pluginSettings); // Now 'pluginSettings' is a javascript object instance Add a custom action (placeholder) in C++ export template
C++ export plugins provide a setting to define template files to use during export : Header *.h and Source *.cpp.
QxEntityEditor application provides several C++ templates by default, and it is possible to define your own C++ template (option « Custom »).
Header *.h and Source *.cpp C++ templates contain some placeholders (@@ACTION@@ format) to replace code by calculated value.
Placeholder is the most important part to understand how Javascript customization engine works.
Please note that you can define your own custom placeholder with @@CUSTOM_ prefix, for example : @@CUSTOM_MY_ACTION@@.
Here is an example to test current action code (so current placeholder inside call context) with the Javascript engine :
/* you can define your own placeholder in the template, it must start with @@CUSTOM_, for example : @@CUSTOM_MY_ACTION@@
==> then, in the custom script, check if you are processing your custom action with this code : */
var action = params[5]; if (action == "CUSTOM_MY_ACTION") { return "quit with my custom code here"; } Script example : add automatically Q_PROPERTY definition on all generated C++ properties
Here is a documented script (deployed with QxEntityEditor package in ./samples/q_property.js file) to add automatically Q_PROPERTY macro definition to all properties of a *.qxee project :
({ /* ---------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------- 'q_property.js' : custom javascript file to customize QxEntityEditor C++ export process. This script is an example to show how to use QxEntityEditor javascript engine to add a Q_PROPERTY definition for each property generated by QxEntityEditor. More details about Q_PROPERTY macro on Qt web site : http://doc.qt.io/qt-5/properties.html To use this javascript file : 1- go to the main menu of QxEntityEditor 'Tools >> Export to C++ project (settings)' ; 2- select the C++ template 'qx::IxPersistable + QObject' : now generated entities will inherit from QObject, which is required to use the Qt Q_PROPERTY macro ; 3- in the field 'Custom script file' : put the location of this 'q_property.js' custom javascript file ; 4- save the settings and start the C++ export process ; 5- check generated files : Q_PROPERTY should be added automatically by the export process. ---------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------- */ // Here is the entry point of the QxEntityEditor javascript engine // This function is called for each placeholder defined in the C++ template section customProcess : function(params) { try { // We use here the @@MACRO_QX_PERSISTABLE_HPP@@ placeholder which is present in the default C++ template 'qx::IxPersistable + QObject' // You could also create your own custom C++ template (based on 'qx::IxPersistable + QObject' template), and create your own placeholder (which must be prefixed by @@CUSTOM_), for example : @@CUSTOM_Q_PROPERTY@@ var action = params[5]; if (action != "MACRO_QX_PERSISTABLE_HPP") { return params[0]; } // quit with 'params[0]' means : doesn't change the default export behaviour // Check if we have an entity var entity_id = params[13]; if ((entity_id == "") || (entity_id == "0")) { return params[0]; } // quit with 'params[0]' means : doesn't change the default export behaviour // Get the list of properties var entity_details = helper.getEntityDetails(entity_id); var entity_list_of_properties_id = ((entity_details.length > 0) ? entity_details[10] : ""); var entity_list_of_properties_array = entity_list_of_properties_id.split("|"); if (entity_list_of_properties_array.length <= 0) { return params[0]; } // quit with 'params[0]' means : doesn't change the default export behaviour // Prepare output string var output = params[0] + "\n"; // Iterate over each property for (var idx = 0; idx < entity_list_of_properties_array.length; idx++) { // Get property details var property_id = entity_list_of_properties_array[idx]; var property_details = helper.getPropertyDetails(property_id); // Here you could also get property meta-data that you can define in QxEntityEditor, property parameters screen, section 'List of meta-data' // This is a way to manage your own property parameters which are not a part of QxEntityEditor // It could be useful for example to manage some Q_PROPERTY settings like : RESET, NOTIFY, REVISION, DESIGNABLE, SCRIPTABLE, FINAL, etc... // To get a property meta-data value, just write this code : var my_meta_data = helper.getPropertyMetaData(property_id, "MY_META_DATA_KEY"); // Get property type and name var property_type = property_details[5]; var property_name = property_details[2]; // Check if property type can be used with Q_PROPERTY macro if (list_of_compatible_property_type.indexOf(property_type) == -1) { continue; } // Create Q_PROPERTY definition output += "\n Q_PROPERTY(" + property_type + " " + property_name + " READ get" + property_name + " WRITE set" + property_name + ")"; } return output; } catch (err) { return ("[CustomScriptError] an unexpected error occurred : " + err); } } }); // Here is a list of C++ types compatible with Qt Q_PROPERTY macro (C++ type can be converted to/from QVariant) // You can of course register your own C++ types to be able to use them with Q_PROPERTY macro (using Qt Q_DECLARE_METATYPE() macro) // So the following array is not fixed : you can add all C++ types you want... var list_of_compatible_property_type = [ "QBitArray", "QBitmap", "bool", "QBrush", "QByteArray", "QChar", "QColor", "QDate", "QDateTime", "double", "QUuid", "QFont", "QVariantHash", "QIcon", "QImage", "int", "QLine", "QLineF", "QVariantList", "qlonglong", "QVariantMap", "QMatrix", "QMatrix4x4", "QPixmap", "QPoint", "QPointF", "QPolygon", "QPolygonF", "QRect", "QRectF", "QRegExp", "QRegion", "QSize", "QSizeF", "QString", "QStringList", "QTime", "uint", "qulonglong", "QUrl", "QVector2D", "QVector3D", "QVector4D" ]; Enable Javascript debugger editor
Javascript engine of QxEntityEditor application provides a native Javascript debugger.
This debug environment provides all required features to help you to develop and fix your custom scripts :
By default, QxEntityEditor Javascript debugger is disabled during an export. To enable it and show the debug editor, you can :
Execute custom scripts (shell/bat) before/after plugin execution
QxEntityEditor application provides a way to define some custom scripts *.bat (Windows), *.sh (Linux) or even executables to run before and/or after a QxEntityEditor plugin execution.
Each script (or process) is called with 1 input parameter : the current *.qxee project location.
This feature can be used for example to :
To define these scripts or executables to run before and/or after a QxEntityEditor plugin execution, just go to the main menu : Tools >> Plugins scripts. Note : you can put in this list an absolute path to your script, or a relative path to *.qxee project file. For example, ./my_script.sh means that my_script.sh file must be located in the same directory as *.qxee project file. QxEntityEditor command-line interface
QxEntityEditor provides a command-line interface to run the application with some parameters.
We will detail in this chapter some QxEntityEditor calling examples :
-- Example n°1 : run QxEntityEditor defining a *.qxee project to load at startup (--project parameter) : QxEntityEditor --project="c:\test\qxBlog.qxee" -- Example n°2 : run QxEntityEditor without displaying the user interface (--no_gui parameter), defining a *.qxee project to load (--project parameter) and executing automatically a C++ export process (--plugin parameter) : QxEntityEditor --no_gui --project="c:\test\qxBlog.qxee" --plugin=QxEECppExport -- Example n°3 : run QxEntityEditor in read-only mode (--viewer_mode parameter), this parameter can be used to open large *.qxee projects without any registered license key : QxEntityEditor --viewer_mode -- Example n°4 : run QxEntityEditor tracing all SQL logs (--log_sql parameter), this parameter logs all SQL queries executed to *.qxee SQLite database : QxEntityEditor --log_sql -- Example n°5 : run QxEntityEditor loading a *.qxee project from a JSON file : QxEntityEditor --project="<path_to_your_qxee_project_file>" --plugin=QxEEJsonImport --QxEEJsonImport_file="<path_to_your_json_file>" -- Example n°6 : display documentation about all QxEntityEditor command line parameters : QxEntityEditor --? Note : --?, --help or --h will log following output to console : *** QxEntityEditor 1.2.5 application global command line parameters *** --project="<full path to *.qxee project file>" : run QxEntityEditor defining a *.qxee project to load at startup --no_gui : run QxEntityEditor without displaying the user interface --viewer_mode : run QxEntityEditor in read-only mode, this parameter can be used to open large *.qxee projects without any registered license key --log_sql : run QxEntityEditor tracing all SQL logs, this parameter logs all SQL queries executed to *.qxee SQLite database --font : define application font (due to issues since macOS Catalina 10.15) with syntax <family>||<pointSize>||<weight>||<italic> (only <family> is required), for example : Courier New||14 --style_sheet : define application style sheet (more details here : https://doc.qt.io/qt-5/stylesheet-reference.html), for example : QWidget { background-color: black } --plugin=<plugin name> : run QxEntityEditor and execute automatically a plugin process (see below for specific parameters per plugin) *** Import plugin QxEEJsonImport *** --QxEEJsonImport_file="<full path to your json file>" : [Required] run QxEntityEditor loading a *.qxee project from a JSON file *** Import plugin QxEEMySQLImport *** --QxEEMySQLImport_db_ip="<DB IP>" : [Required] Database server address (IP) --QxEEMySQLImport_db_port="<DB port>" : [Required] Port number to connect to database --QxEEMySQLImport_db_name="<DB name>" : [Required] Database name --QxEEMySQLImport_filter_regexp="<Regular Expression>" : [Optional] Filter to select tables from database to import --QxEEMySQLImport_login="<DB Login>" : [Optional] Login to connect to database --QxEEMySQLImport_pwd="<DB Password>" : [Optional] Password to connect to database --QxEEMySQLImport_namespace="<Namespace>" : [Optional] C++ namespace where imported classes will be located --QxEEMySQLImport_delete_namespace=0/1 : [Optional] Delete all entities in the namespace before importing --QxEEMySQLImport_import_comment=0/1 : [Optional] Import tables/columns comment to entities/properties description --QxEEMySQLImport_import_default_value=0/1 : [Optional] Import columns default value --QxEEMySQLImport_boost_optional=0/1 : [Optional] Add boost::optional<T> decoration if a column definition allows NULL value --QxEEMySQLImport_organize_diagram=0/1 : [Optional] Organize diagram layout after import process --QxEEMySQLImport_relation_decoration=<numeric value> : [Optional] Decoration used for relationships (0=no decoration, 1=boost::shared_ptr, 2=QSharedPointer, 5=std::shared_ptr) --QxEEMySQLImport_relation_collection=<numeric value> : [Optional] Collection used for relationships (1=qx::QxCollection, 2=std::vector, 3=std::list, 8=QHash, 10=QList) --QxEEMySQLImport_mapping_sql_to_cpp="sql1~cpp1;sql2~cpp2;etc..." : [Optional] List of mappings from SQL type to C++ type --QxEEMySQLImport_verbose=0/1 : [Optional] Display more details during the import process *** Import plugin QxEEOdbcImport *** --QxEEOdbcImport_dsn="<ODBC DSN>" : [Required] ODBC DSN to connect to database --QxEEOdbcImport_db_type=<numeric value> : [Required] Database engine type (0=generic, 1=postgresql, 2=mysql, 3=oracle, 4=mssqlserver, 5=sqlite) --QxEEOdbcImport_filter_regexp="<Regular Expression>" : [Optional] Filter to select tables from database to import --QxEEOdbcImport_login="<DB Login>" : [Optional] Login to connect to database --QxEEOdbcImport_pwd="<DB Password>" : [Optional] Password to connect to database --QxEEOdbcImport_namespace="<Namespace>" : [Optional] C++ namespace where imported classes will be located --QxEEOdbcImport_delete_namespace=0/1 : [Optional] Delete all entities in the namespace before importing --QxEEOdbcImport_import_comment=0/1 : [Optional] Import tables/columns comment to entities/properties description --QxEEOdbcImport_import_default_value=0/1 : [Optional] Import columns default value --QxEEOdbcImport_boost_optional=0/1 : [Optional] Add boost::optional<T> decoration if a column definition allows NULL value --QxEEOdbcImport_organize_diagram=0/1 : [Optional] Organize diagram layout after import process --QxEEOdbcImport_relation_decoration=<numeric value> : [Optional] Decoration used for relationships (0=no decoration, 1=boost::shared_ptr, 2=QSharedPointer, 5=std::shared_ptr) --QxEEOdbcImport_relation_collection=<numeric value> : [Optional] Collection used for relationships (1=qx::QxCollection, 2=std::vector, 3=std::list, 8=QHash, 10=QList) --QxEEOdbcImport_mapping_sql_to_cpp="sql1~cpp1;sql2~cpp2;etc..." : [Optional] List of mappings from SQL type to C++ type --QxEEOdbcImport_verbose=0/1 : [Optional] Display more details during the import process *** Import plugin QxEEPostgreSQLImport *** --QxEEPostgreSQLImport_db_ip="<DB IP>" : [Required] Database server address (IP) --QxEEPostgreSQLImport_db_port="<DB port>" : [Required] Port number to connect to database --QxEEPostgreSQLImport_db_name="<DB name>" : [Required] Database name --QxEEPostgreSQLImport_filter_regexp="<Regular Expression>" : [Optional] Filter to select tables from database to import --QxEEPostgreSQLImport_login="<DB Login>" : [Optional] Login to connect to database --QxEEPostgreSQLImport_pwd="<DB Password>" : [Optional] Password to connect to database --QxEEPostgreSQLImport_namespace="<Namespace>" : [Optional] C++ namespace where imported classes will be located --QxEEPostgreSQLImport_delete_namespace=0/1 : [Optional] Delete all entities in the namespace before importing --QxEEPostgreSQLImport_import_comment=0/1 : [Optional] Import tables/columns comment to entities/properties description --QxEEPostgreSQLImport_import_default_value=0/1 : [Optional] Import columns default value --QxEEPostgreSQLImport_boost_optional=0/1 : [Optional] Add boost::optional<T> decoration if a column definition allows NULL value --QxEEPostgreSQLImport_organize_diagram=0/1 : [Optional] Organize diagram layout after import process --QxEEPostgreSQLImport_relation_decoration=<numeric value> : [Optional] Decoration used for relationships (0=no decoration, 1=boost::shared_ptr, 2=QSharedPointer, 5=std::shared_ptr) --QxEEPostgreSQLImport_relation_collection=<numeric value> : [Optional] Collection used for relationships (1=qx::QxCollection, 2=std::vector, 3=std::list, 8=QHash, 10=QList) --QxEEPostgreSQLImport_mapping_sql_to_cpp="sql1~cpp1;sql2~cpp2;etc..." : [Optional] List of mappings from SQL type to C++ type --QxEEPostgreSQLImport_verbose=0/1 : [Optional] Display more details during the import process *** Import plugin QxEESQLiteImport *** --QxEESQLiteImport_db_path="<DB File Path>" : [Required] SQLite database file path --QxEESQLiteImport_filter_regexp="<Regular Expression>" : [Optional] Filter to select tables from database to import --QxEESQLiteImport_namespace="<Namespace>" : [Optional] C++ namespace where imported classes will be located --QxEESQLiteImport_delete_namespace=0/1 : [Optional] Delete all entities in the namespace before importing --QxEESQLiteImport_import_comment=0/1 : [Optional] Import tables/columns comment to entities/properties description --QxEESQLiteImport_import_default_value=0/1 : [Optional] Import columns default value --QxEESQLiteImport_boost_optional=0/1 : [Optional] Add boost::optional<T> decoration if a column definition allows NULL value --QxEESQLiteImport_organize_diagram=0/1 : [Optional] Organize diagram layout after import process --QxEESQLiteImport_relation_decoration=<numeric value> : [Optional] Decoration used for relationships (0=no decoration, 1=boost::shared_ptr, 2=QSharedPointer, 5=std::shared_ptr) --QxEESQLiteImport_relation_collection=<numeric value> : [Optional] Collection used for relationships (1=qx::QxCollection, 2=std::vector, 3=std::list, 8=QHash, 10=QList) --QxEESQLiteImport_mapping_sql_to_cpp="sql1~cpp1;sql2~cpp2;etc..." : [Optional] List of mappings from SQL type to C++ type --QxEESQLiteImport_verbose=0/1 : [Optional] Display more details during the import process *** Export plugin QxEECppExport *** !!! Note : this plugin loads automatically previous parameters values before starting the export process, but you can use following parameters to override them !!! --QxEECppExport_path="<Export Path>" : [Optional] C++ export path parameter --QxEECppExport_template_type=<numeric value> : [Optional] C++ template type selected to build C++ files (0=no_inheritance, 1=ix_persistable, 2=qx_persistable, 3=ix_persistable_and_q_object, 4=custom) --QxEECppExport_template_header="<Template Header>" : [Optional] Custom C++ template header file path (QxEECppExport_template_type parameter must be equal to 4, which means custom) --QxEECppExport_template_source="<Template Source>" : [Optional] Custom C++ template source file path (QxEECppExport_template_type parameter must be equal to 4, which means custom) --QxEECppExport_qxorm_relative_path=0/1 : [Optional] Relative path to QxOrm library --QxEECppExport_generate_custom_files=0/1 : [Optional] Generate a custom directory with custom files for each entity --QxEECppExport_custom_javacript="<Custom JS>" : [Optional] Custom script (javascript file) to change the default behaviour of the export process *** Export plugin QxEECppModelViewExport *** !!! Note : this plugin loads automatically previous parameters values before starting the export process, but you can use following parameters to override them !!! --QxEECppModelViewExport_path="<Export Path>" : [Optional] C++ model/view export path parameter --QxEECppModelViewExport_namespace="<Namespace>" : [Optional] Namespace where to put all model/view classes --QxEECppModelViewExport_template_type=<numeric value> : [Optional] C++ model/view template type selected to build C++ files (0=default, 1=custom, 2=qx_model_service) --QxEECppModelViewExport_template_header="<Template Header>" : [Optional] Custom C++ template header file path (QxEECppModelViewExport_template_type parameter must be equal to 1, which means custom) --QxEECppModelViewExport_template_source="<Template Source>" : [Optional] Custom C++ template source file path (QxEECppModelViewExport_template_type parameter must be equal to 1, which means custom) --QxEECppModelViewExport_generate_custom_files=0/1 : [Optional] Generate a custom directory with custom files for each entity --QxEECppModelViewExport_custom_javacript="<Custom JS>" : [Optional] Custom script (javascript file) to change the default behaviour of the export process *** Export plugin QxEECppServicesExport *** !!! Note : this plugin loads automatically previous parameters values before starting the export process, but you can use following parameters to override them !!! --QxEECppServicesExport_path="<Export Path>" : [Optional] C++ services export path parameter --QxEECppServicesExport_namespace="<Namespace>" : [Optional] Namespace where to put all services classes --QxEECppServicesExport_template_type=<numeric value> : [Optional] C++ services template type selected to build C++ files (0=default, 1=custom) --QxEECppServicesExport_template_header="<Template Header>" : [Optional] Custom C++ template header file path (QxEECppServicesExport_template_type parameter must be equal to 1, which means custom) --QxEECppServicesExport_template_source="<Template Source>" : [Optional] Custom C++ template source file path (QxEECppServicesExport_template_type parameter must be equal to 1, which means custom) --QxEECppServicesExport_generate_custom_files=0/1 : [Optional] Generate a custom directory with custom files for each entity --QxEECppServicesExport_custom_javacript="<Custom JS>" : [Optional] Custom script (javascript file) to change the default behaviour of the export process --QxEECppServicesExport_generate_server_app=0/1 : [Optional] Generate a sample server application --QxEECppServicesExport_server_app_path="<Server App Path>" : [Optional] Server application location *** Export plugin QxEEGenericDDLExport *** !!! Note : this plugin loads automatically previous parameters values before starting the export process, but you can use following parameters to override them !!! --QxEEGenericDDLExport_path="<Export Path>" : [Optional] DDL export path parameter --QxEEGenericDDLExport_db_type=<numeric value> : [Optional] Database type (0=default, 1=sqlite, 2=mysql, 3=postgresql, 4=oracle, 5=mssqlserver) --QxEEGenericDDLExport_relation_as_fk=0/1 : [Optional] Export relationships as foreign keys in database --QxEEGenericDDLExport_schema_type=<numeric value> : [Optional] Way to export database schema (0=full, 1=evolution, 2=full_and_evolution) --QxEEGenericDDLExport_custom_javacript="<Custom JS>" : [Optional] Custom script (javascript file) to change the default behaviour of the export process *** Export plugin QxEEPrinter *** !!! Note : this plugin loads automatically previous parameters values before starting the export process !!! *** Export plugin QxEEXmlExport *** !!! Note : this plugin loads automatically previous parameters values before starting the export process, but you can use following parameters to override them !!! --QxEEXmlExport_path="<Export Path>" : [Optional] XML or JSON export path parameter --QxEEXmlExport_as_json=0/1 : [Optional] Export project as JSON format Other note : to see logs generated by QxEntityEditor application :
-- Example n°7 : import by ODBC (plugin QxEEOdbcImport) a database schema : QxEntityEditor --no_gui --project="<project_path>" --plugin=QxEEOdbcImport --QxEEOdbcImport_db_type=1 --QxEEOdbcImport_dsn="<your_dsn>" --QxEEOdbcImport_login="<your_login>" --QxEEOdbcImport_pwd="<your_password>" --QxEEOdbcImport_delete_namespace=1 -- Example n°8 : import a PostgreSQL database schema (plugin QxEEPostgreSQLImport) : QxEntityEditor --no_gui --project="<project_path>" --plugin=QxEEPostgreSQLImport --QxEEPostgreSQLImport_db_ip="<ip>" --QxEEPostgreSQLImport_db_port=5432 --QxEEPostgreSQLImport_db_name="<dbname>" --QxEEPostgreSQLImport_login="<your_login>" --QxEEPostgreSQLImport_pwd="<your_password>" --QxEEPostgreSQLImport_delete_namespace=1 -- Example n°9 : export a QxEntityEditor project to a Source Control manager/directory Git, Perforce, CVS, etc. (QxEESourceControlExport plugin) : QxEntityEditor --no_gui --project="<path_to_your_qxee_project_file>" --plugin=QxEESourceControlExport --QxEESourceControlExport_path="<path_to_your_export_output_directory>" -- Example n°10 : import from a Source Control manager/directory Git, Perforce, CVS, etc. (QxEESourceControlImport plugin) : QxEntityEditor --project="<path_to_your_qxee_project_file>" --plugin=QxEESourceControlImport --QxEESourceControlImport_path="<path_to_the_root_source_control_json_file>" |
© 2011-2024 Lionel Marty - contact@qxorm.com |