I'm using jHipster 4.14.4 . When using the generator to generate entities, it seems it does not generate the default fields like last_modified_by and last_modified_by, neither in the XML files for the DB or the class files. Am I wrong to assume these are included by default? I need these to be able to sync with an offline app I'm building.
Related
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
I am trying to override the a template Entity.java.ejs in my custom blueprint to add some extra functionality. Unfortunately JHipster uses its default one if generate an entity. I don’t want to overwrite the whole writing. Is there a possibility to override only certain ones and use JHipster default templates for the rest?
Helo friend,
in this period I see an application jhipster with a partial custom .ejs defining a default for others components.
The problem is that the overriding is very huge, and cabled only for a specific version 6.9.1 of jhipster.
If this is a good idea to custom a particolar application with a particolar version and with a specific cabling code ok, but is not good if you want a generic custom generator jhipster context, where you can "inject" only custom files, giving overriding of all scope original generator.
I try to search some answers searching on web, and your question is anyway a good clue to define a better solution that I see now.
The problem that I see is that jhipster environment dont have a "handling" approach about .ejs templates, when is very strong and straighweird when you use .jdl file .
An easly customization of templates of any jhipster application created with command "jhipster", ad example.
And searching I see this link https://github.com/jhipster/generator-jhipster/issues/1749
an issue of original jhipster generator where someone consider a good idea to use "subgenerator" using yeoman to modulerize this templates and with all benefits.
This is a another clue to understand somethings.
good luck and thanks
I have got some work to modify default html generated by Jhipster for Angular2 more specifically,i want to modify styles for grid generated by Jhipster for Entity's.
I have gone through tutorial creating module in Jhispter documentation.
https://jhipster.github.io/modules/creating-a-module/
generator for creating subgenerator is also their can someone please give me pointers on this problem?
e.g
yo jhipster:entity Author
from above command jhipster creates all necessary files at server and client like JPA Entity,REST controller,Service, at client side it creates CRUD UI for Author entity using Angular2(i opted for anular2)
I want to modify client generation Code, i just want to modify HTML templates which gets generated by jhipster entity sub:generator
you need to run Yarn and start modifying your author.component.html
which will automatically refreshed in your Browser.
https://jhipster.github.io/development/
You could also consider using git prior to running the generator and then reverting the server side code once the generator has ran
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.
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.