Is there any way to plugin a custom weak association detection logic into schemacrawler? - schemacrawler

I am using schemacrawler cli to generate diagrams for my database.
I do not have many FK relationships in my db and so I am relying on weak-associations. But the these weak associations are not accurate. Is there any way to plugin custom logic for this detection?
The only associations that I want to plot are:
When tablename_id column in any table in a database maps to tablename.id in the same database. There are thousands of these associations.
Plus the 10 or 20 custom defined associations in the yml file.
I know I can manually define the associations in the yaml file but that is not a feasible option. I also know that I can build a custom script to generate the said yaml file, but that might not be as performant as being able to plugin the logic into the flow.

You should be able to plug in a custom catalog loader. Catalog loaders are loaded by the Java Service Provider Interface (SPI), and the WeakAssociationsCatalogLoader itself is loaded dynamically from the CLASSPATH. You can write your own implementation in your own jar file, and add it to the CLASSPATH, or simply drop your jar into SchemaCrawler's lib folder if you are using the command-line. Your jar file should have the SPI properties file, like this one - schemacrawler.tools.catalogloader.CatalogLoader.
It seems like your idea may be useful to other people. If you make your implementation an open-source project, please let me know, and I will link to it from the SchemaCrawler website.
Sualeh Fatehi
SchemaCrawler

Related

Is there a way to generate jHipster code without the Liquibase? Or to Disable the Liqibase ? JHipster 4.7.0

Is there a way to generate jHipster code without Liquibase?
Or Is there a jHipster generator for database scripts in some kind of separate project of database scripts like in Oracle, MySQL, P SQL etc.
What I mean is Liqibase does not meet my needs, like I want to create tablespaces for my Oracle DB, create a user and grant privileges to it and then create my SQL scripts with in pure SQL not in Liquibase XML file as I want my table data to reside in my tablespace and want to specify the size of columns based on my requirements. And when I'm done with creating the SQL file I just have to run the jar file for all the DB work.
If there is not an option for generating schema without Liquibase. I'm considering disabling the Liquibase and generate the tables manually. Can I disable the Liqibase? There are some online suggestions but for jHipster 3.12 but I have not tried it yet.
Disable Liquibase temporarily in JHipster 2.26
Yes you can use the no-liquibase profile (here is the documentation), and Liquibase will not run anymore
However, JHipster will still generate the Liquibase files for you: you can just ignore them, or even delete them
I personally often use that profile, even if I use Liquibase a lot, as this speeds up deployment (of course, I only use it when I don't modify my database, but I'm not modifying it all the time). So this is nice trick to know, whether you like Liquibase or not.
Then, I'm pretty sure you can do your database-specific scripts with Liquibase, or run them before Liquibase, so maybe this is another solution you could use.

how to integrate a monolithic jhipster application with another jhispter application. ?- Jhipster

I have made three different applications in j JHipster with monolithic. I need to merge these applications. I know that by using micro-services my quest can be easy but the current requirement is to do the merging with the monolithic pattern only.
I need to merge two applications with another or main application. I am using MySQL as database. I don't know where I need to change and how. Please help me out, I am a newbie in this scenario.
i tried to create a java file for setter getter methods and and a dao file for three databases and now in the main class file and am trying to take every dao file as an array of object and integrate it and put it into the third db.is it possible.i wanted to show the code bt,since i am new not able to maintain the coding standards to show.
by this i way i tried to involve three databases in a single scenario and want to complete my query through CRUD model.
as you already pointed out, the proper way of merging here would be using the microservice option, which you cannot take, as you are forced to use monolithic architecture...
almost automatic merge
if you did not changed anything to your code, after generating the entities, you just can put the contents of your applications .jhipster directory into one, and run yo jhipster --with-entities to regenerate the entities in one application. You should keep in mind, you will have to take a look at your main/resource/config/liquibase folder, to set the migration ids properly.
manual merge
For this you should be more experienced in the underlying technologies, as you will have to:
recreate your entity classes
recreate zour DAO/Repositories
(maybe) recreate your services, or service implementations
recreate your REST controllers
do a proper liquibase migration
provide some tests
migrate the frontend code, by adding states, components, templates etc..
the most of these things you just can copy paste already generated code.
For more information, you should ask more precise, what is not working, if you already tried something...

JHipster, Customization of generated code

i'm newbie in JHipster and i'm trying to figure this, when i create a new entity JHipster generates several files, angular, html and java classes, now if i want a common code for all this generated code i must edit each time that i use the yeoman generator? what i want is:
Custom Index template, and pages, is secure to edit them?.
Customize the entity tables, entity forms using angular, maybe extending yeoman generators
Customize generate java classes, maybe i think using AOP
So i need to edit each time for each generated code? and is a good practice this or what i want? for clarify more i want to use a Custom Bootstrap/angular Dashboard template like Minovate, i see how to customize bootstrap in the documentation but not about what i'm asking for, Thanks.
JHipster is just a code generator, once generated the code is yours.
For angular screens I would say do as much as you can in CSS/SASS.
But it's very likely that you will need to build some screen mixing several entities and change the structure of entity screens.
So you should rather consider them as a starting point and do your own stuff in another folder so that it does not get overwritten by next re-generations.
This way you can still update your entity definitions in .jhipster folder and re-run yo jhispter:entity <entity name> on the entities you modified.
Customising java Entities is usually much simpler and you can easiliy achieve this by merging generated code with git and defining your service classes.
AOP seems overkill here.
Extending a yeoman generator is a lot of work.
I suggest to use some VSC (git, subversion or whatever you like) have a branch dedicated to plain jhipster generated code and another one where you make customization.
Eventually regenerate on jhipster branch and merge back on yours.
You should at least reduce manual intervention.

Generate entity related files based on current entity java class with jhipster

Because of some reason, I want to use my current java entity classes to generate all entity related files, which are generated with yo jhipster:entity book. I need the liqibase configuration files, repository files, rest resources, and the sample files of html and js files.
So is there any way I can do that?
I don't think there's a way to do that at the moment. But with JHipster 2 you could manually create a .jhipster/{entityname}.json file based on your class, and that would generate those files (and also recreate the class object) you're looking for.

Bulk download of wsdl and schemas(SoapUI export definition)

We are mantaining a java project that consumes a lot of different web services. Service definitions change regularly and new services are added very often. So we need to automate the generation of all the java clients.
We have a batch script that downloads(curl) all the needed wsdls and all the dependent schemas, then generates all the corresponding java clients(wsimport) and finally generates a jar that includes all the clients and all the wsdls and xsds which. We deploy this jar in our artifactory and we use it in our project. We need to include the wsdls and xsds in our jar to avoid jax-ws calls to the wsdls in execution.
The script has become a monster, because we use very different web services. Every wsdl, has it's own different schemas located in different urls, so we have to identify all the files that have to be downloaded and put the xsds in the correct path in the disk.
Our goal would be to have a script that, given a wsdl url list, downloads all the wsdls and dependent xsds in a folder so that we can execute wsimport against them.
SoapUI's "export definition" tool, exports the wsdld and the dependent schemas in a folder, and modifying the "ws:import" paths in the wsdl automaticaly. Is there any way to invoke this tool from command line?
Is there any other tool that would help us improving this process?
thanks in advance

Resources