Hibernate.reveng.xml
Hey guys,
this is my first post so please be appreciative :)
So my problem with the IDE and Hibernate:
I have a project with like more then 60 tables in the database and i want to reverse engineer them. I get the connection with the database and i can reverse engineer it BUT the default like "(database) number = (java field) long" is not what i want. Sure at reverse engineering i can tell every single field what it should be in Java but that's really annoying for more then 60 tables.
In Eclipse you can take the JBOSS Plugin and write a "hibernate.reveng.xml" file. With that you can change the default mapping from the fields so that "number = java.math.BigDecimal".
Does Intellij Idea provide any similar option? Or can i create a hibernate.reveng.xml file and bind it to the config?
Or is there an other solution to change the default generation type?
I googled a long time but only find solutions for eclipse.
Thanks for your help :)
Please sign in to leave a comment.
Hello Fabian,
It is not possible currently. Please vote for related requests in our tracker: https://youtrack.jetbrains.com/issue/IDEA-128307 and https://youtrack.jetbrains.com/issue/IDEA-144763
Thank you Andrey Dernov.
I voted both requests. Hope it will be supported some day :)
FYI, it is supported since IDEA 2019.3 (see IDEA-128307):
Hibernate reverse engineering files are now partly supported by IDE: the type-mapping and table-filter sections are taken into consideration. Custom types are automatically detected and shown in the "Generate entities from database schema" dialog. Also consider using code generation scripts which can be found in database tool window -> context menu -> scripted extensions (for instance provided "Generate Kotlin entities.kts") where custom mapping types are also taken into account