Generate POJOs - Source code (schema information) Follow
i tried to add functionality to the scripted extension "Generate POJOs.groovy". But this is really hard to achieve without any documentation or source code out there.
For example, i want to add a table annotation with the used schema of a specific table. But i have no clue, where to retrieve the schema name using one of the following classes:
- import com.intellij.database.model.DasObject
- import com.intellij.database.model.DasTable
- import com.intellij.database.util.DasUtil
Can you give me a hunch, where i find possible methods/fields of these classes?
Thanks in advance
Please sign in to leave a comment.
For my conrete problem (table schema name) i found a solution using reflection to return all methods of various classes:
did the trick.
But i would still like to know, if there is documentation or at least source code for this groovy code?
I hope the following article https://blog.jetbrains.com/datagrip/2018/02/13/generate-pojos/ will help you
Sorry, but this article only is an example and leads to further examples.
What i want is an API or source code, so i can see what possibilities are there (methods, fields, classes ...).
Without API/source code you have to reverse engineer, what could be possible to create classes with Groovy.
Look for `lib/src/src_database-openapi.zip` file in IntelliJ IDEA Ultimate distribution. That is a complete source code for database and SQL APIs.
Thank you so much Gregory, that is exactly what i was looking for.
Really great stuff, to create custom classes (or anything else) based on the DB model.
With best regards