Automatically generate java backend and rest api from existing database. Part 2

Expanding on the previous subject about the generation of a back-end and rest API from existing database .

  • Netbeans has a generate entities from database script
  • Jeddict  . This could be already be pre-installed in some Netbeans products
  • Dali persistence tools from Eclipse
  • Hibernate Tools

Jipster offers the on line tool JDL-studio: there you can visually create tables and relationships. Entities generation from database is only available with an external tool. Beware of some cumbersome issues.

 

Last and most important: your good SQL database may be able to generate the text of the most important queries towards you database. Look at PostgreSql . Their pgAdmin toll has many features like these for generating things.

 

 

Autovalue and Eclipse = success

I needed to add the folder target\…\generated_sources amon the src folders..

That was all what was needed .

Neither enablig maven annotation processor in eclipse project, installing of apt plugin  or the following snippet in pom were needed:

<annotationProcessors> <annotationProcessor>com.google.auto.value.processor.AutoValueProcessor</annotationProcessor>

</annotationProcessors–>

Automatically generate java backend and rest api from existing database

I am working a lot with databases , hibernate , restful apis in Java SE / java EE with HTML clients.
I am pleased to suggest this workflow that relies on Netbeans automatic generation capabilities.

1. Netbeans generates JPA entities from an existing database.

As it is described at Dzone and at Oracle site.
You have also the option of generating JAXB annotations directly in the JPA entity classes.

2. Netbeans generates then restful api from the entities.

As it is described at NetBeans Help site.

It is really a breeze to come up fast with a Java backend.
I am working now on the HTML / javascript/ jquery client and I will let you know.

Generate JPA entities from database

with Netbeans

https://dzone.com/articles/crud-in-90-seconds

https://docs.oracle.com/cd/E40938_01/doc.74/e40142/dev_persistence.htm#BABCGACD

with Eclipse

Eclipse Neon Help: Generate entities from tables

Create JPA project

with JBoss

http://www.itbh.at/jpa-tools-generate-entities-from-tables-does-not-work-with-h2-database/?lang=en

with MyEclipse

https://www.genuitec.com/products/myeclipse/features/