How to Generate Spring JPA Entities Given Database Model (Telosys)?

894 Views Asked by At

I am currently using Telosys to help me generate Spring JPA Entity Classes from an existing database. So far, I could generate the repository, service, provider directory by using java7-persistence-spring-data-jpa template, but not the entity. Is it possible to generate these entities if you are using the database model (not the DSL model)?

2

There are 2 best solutions below

0
On

I already figured it out. Looks like each templates serve different purposes in Telosys. If you encounter the same problem with mine, try switching it to this template: java-jpa-entities-T330.

You can explore more java templates here in their github.

0
On

As described at the end of this post https://modeling-languages.com/telosys-tools-the-concept-of-lightweight-model-for-code-generation/ each "bundle of templates" is designed to generate a subpart of the final application.

enter image description here

It's a way to manage separately the differents concerns of a project (REST controllers, domain classes, persitence, unit tests, etc)