Do you need to create Java classes, or an Xcore or Ecore representation of your exisiting database? g9 Database Model Import is a free g9 Eclipse plugin producing models based on structure information read from databases.
Given a connection to an existing database, the g9 Database Import will read tables and columns in your database (using the database schema) and create the corresponding model either in Java, Xcore or Ecore depending on the project type of your Eclipse project.
Install g9 Database Import, restart Eclipse and create a Java or Xcore project. Select File > Import... > g9 > Import Database Model to start the import wizard (see the Screenshots).
Complete documentation is available from Help > Help Contents. Select g9 Documentation > g9 Database Model Import.
- which tables to include: by default all tables are included and a class name based on the table names are suggested
- which columns to include: by default all columns are included and an attribute name based on the column names are suggested
- the data type mappings for your domain model based on the JDBC types - or use default values
An import of your database to a Java Project will create Java classes, an import to an Xcore Project will create an Xcore model, all other Eclipse Project types will result in an Ecore model. The Java classes may be enriched with JPA annotations. If you work with Xcore or Ecore models you should use Eclipse for Java and DSL Developers.
In the g9 Database Import feature you connect to a database using a JDBC driver. The built-in drivers are MySQL, MS SQL Server (jTDS) and Sybase ASE (jTDS). Use the function [Maintain JDBC Drivers] in the g9 Import feature to connect to other databases, e.g Oracle, PostgreSQL, Firebird or a DBMS of your choice.
You may download the complete g9 product and use the Database import feature in a g9 Eclipse Project. To be able to exploit the other features in g9, you should create a g9 UI Modeling Project and import your database to an Ecore, Xcore model or Java source with g9 annotations. Please see the User guide for more information about the g9 Database Import feature.