Unable to generate JPA entities from HSQLDB - jpa-2.0

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!

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();

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.

Is it possible to include a database view in a JPA/EclipseLink CriteriaQuery?

I am working on a project that needs to be able to create dynamic queries into an H2 database. This also includes a full text search with built-in H2 logic, tables, and triggers.
I have been trying to figure out how to add that full-text search into my CriteriaQuery but keep running into the road block that the tables used aren't entities in my model. I could add them as entities, but I don't want them created automatically by EclipseLink when a new database file is created since there is a function in H2 that creates the tables and does other necessary housekeeping.
I had tried the path of creating a view to query the full text tables to give me the information I need in the format I need. But I still keep running into the same problem that that view is not an Entity.
Has anyone encountered this situation before and/or figured out a way around it?
Thanks!

Entity Framework 4.1 RC POCO - Unit Test the name of produced field names

Is it possible to access metadata about a POCO entity using EF4.1 that states what the database field names are? Most importantly on foreign key values.
I would like to access this for the purpose of unit testing whilst trying to apply EF4.1 to an existing database schema. I cannot change the existing column names.
Currently the tests create the database using SQL Server Compact 4.0 so I can see the names of the fields, but it would be better if this was automated.
Pseudo code for a test being
Create entity
Save entity
Check that the field name is as expected
That is not unit testing. That is integration testing. Moreover such tests are not too much usefull. Don't let EF create database and instead use copy of the existing database. Simply save entity and load entity in a new context. If data are ok you are happy with it. You can make each test transactional so the transaction is rolled back after each test.
EF 4.1 with code-first approach doesn't offer access to metadata workspace. You can try to convert DbContext back to ObjectContext and try to access MetadataWorkspace:
ObjectContext ctx = ((IObjectContextAdapter) context).ObjectContext;
MetadataWorkspace workspace = ctx.MetadataWorkspace;
Searching anything in MetadataWorkspace is terrible experience. That class is definitely not designed to be used in custom code.