How to generate entities from one file YAML in Doctrine 2? - doctrine-orm

I have plugin to MySQL Workbench, which generate YAML file.
In doctrine 1.2, I use
Doctrine_Core::generateModelsFromYaml('1.yml', $models_dir, $options);
and PHP models are created.
It is possible to make the same process in Doctrine 2?

If you want more reliable solution for generating your YML (or XML or annotations) Doctrine2 files, you can take a look at Skipper application.
It's a visual modeler for ORM frameworks (Doctrine, Doctrine2, MongoDB ODM, ...) with schema definition import/export support.

Related

Is there a way to build TMSL scripts programatically on the same way that XMLA tools create it (like Tabular editor) from an existent tabular db?

I am wondering how is possible to create a TMSL script from an tabular database (power bi service or SSAS) using some programing language. These kind of scripts are available in several tools, like SSMS or Tabular Editor:
Example of the menu to create TMSL script in SSMS from an active DB
What creates (as an example) something like this:
Example: A TMSL script header for a role
So, the question is if, for example, a python library / .NET wrapper could do that automatically. I am able to send several DMVs using pyadomd to extract the information by parts (with several lookups in alternate tables to transforms ids) and then recompose everything into an script, but if where a easy way to create it could less error prone and time saver.
Thanks in advance
Alexis
IT's a .NET Library called Tabular Object Model, which can be used to read Tabular Model metadata and generate scripts using the JSON Scripter.

How to update Camunda DMN table at runtime?

I have a DMN table created with a few rules and deployed to Camunda.
How do we update DMN tables programmatically at run-time and add a new rule when it is already deployed?
When you change the dmn table but keep the decision-key, a deployment will create a new revision of the table.
So yes, you can update dmn tables at runtime.
You can do so by either using the REST or the java API.
The java api relies on the RepositoryService#createDeployment Builder. The concrete implementation depends on where your files are stored, and how you read them. Here are some examples.
Deployment deployment = repositoryService.createDeployment()
.addString(resourceName, instanceAsString)
.deploy();

Apache Calcite - How to Integrate CSV and MySQL

It is easy to use each adapter by command connect.
for example:
!connect jdbc:calcite:model=target/test-classes/model.json admin admin
but I have not found in documentation how to do queries involving heterogeneous sources.
I would like to do a query involving entities that are in the two sources, CSV and MySQL.
You have to add two schemas in your in model.json file, one that targets CSV source and another one that targets JDBC MySQL source.
If the sources contain tables that are somehow connected, then you can create queries like this:
SELECT csv_source.table1.field1, mysql_source.table2.field2,
csv_source.table1.joint_field, mysql_source.table2.joint_field
FROM csv_source.table1
JOIN mysql_source.table2
ON joint_field;

Generating MySql scheme from Doctrine (using ZF2)

Are there any third party tools that can generate a Mysql database from a doctrine scheme?
I am using ZF2 with Doctrine Orm 2 with Skipper to generate my entities. However when it comes to generating my MySql database I do this via Workbench. The problem is that this DB does not always follow the changes and updates I make to the Skipper files.
Now I know I can update via Doctrine's vendor folder using the tool provided, however I have never been able to get this to work due to other vendor modules crashing the environment while in console mode. ZfcRbac / Oauth2 and others that just done play nicely when in command line.
So my question is simply, is there an easy third party tool I can use to save time and frustration or at least some other technique I can use?
thanks!
The best way to synchronize your database is to use Doctrine Migrations. Every time when you update your entities, it does not matter how - manually or with Skypper, you should create a migration. My workflow is:
1) I modify some entity, let say adding a new property;
2) Then I use Doctrine orm tool to generate the entity accessors. /If you already have them, generated by Skypper, you can skip this step/
$php public/index.php orm:generate-entities --update-entities="true" --generate-methods="true" module/Application/src
3) Updated: Generate doctrine proxies
$php public/index.php orm:generate:proxies
4) The next step is to generate the migrations:
$php public/index.php migrations:diff
5) And the final step is to execute the migration and get your database synchronized with the new schema:
$php public/index.php migrations:migrate
That's all, now your database is synchronized. I am not sure if there is a third party library for this. If you have problems with the other modules, it is a good idea to check your configurations trying to fix them.

Unable to generate JPA entities from HSQLDB

I am using OpenJPA and HSQLDB for my current project.
But I am unable to generate JPA entities from the HSQLDB because eclipse plugin is not giving me an option to select the schema.
Does anybody have idea about this? Or is there any other way to generate entities in eclipse?
I am assuming that you are using the "standard" JPA tooling (JPT), since you are not specifying otherwise.
First, you need to define a connection (in the Data Source Exlporer). You should be able to drill down and see the actual tables you need to work with:
You select the schema on the "JPA Facet" page when you create the JPA project or activate the JPA Facet: There is a checkbox called "Override default schema from connection", and a combo-box where you select the "Schema":
You can even select the schema when you ask to generate entities (right click on the project, JPA Tools > Generate Entities from Tables...), and then you get this dialog:
Happy Mapping!