Automatically create objects from the database

Is there a way to automatically create javax.persistence.Entity classes from an existing database (or from the SQL statements that created them)?

I just read part of the persistence Java EE 5 Tutorial and manually creating all of these annotations seems rather wasteful given that all (or most) of the required knowledge is already encoded in the database or even explicitly specified as SQL statements.

0
source share
1 answer

There are several ways to reprogram the databases to create entity classes, one of the first results from Google shows this blog , but you can find quite a lot of information. Also, if you intend to use sleep mode, check out the ddl2hbm tools, which is basically the same idea.

+3
source

Source: https://habr.com/ru/post/1235581/


All Articles