I want to use Hibernate 4 to work with the database. I use this configuration to map tables in database with Java class:
<mapping class="test.table1"></mapping>
In my Java class I define compatible fields with the table. But now I want to generate the compatible fields automatically. Is there any tool to do it?
I'm using Java 1.7 and MySQL.
If you just want to generate some Java classes based on the schema defined in your database why don’t you use a code generator designed for this kind of job?
For example you could use Telosys, it’s a very handy tool that can create a “database model” in a few minutes by connecting to an relational DB and then use it to generate any kind of code and especially Java classes.
The advantage is that you can adapt the templates if necessary (and if you want you can generate more than the domain classes).
For more information see the web site http://www.telosys.org/ and read this article https://modeling-languages.com/telosys-tools-the-concept-of-lightweight-model-for-code-generation/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With