jHipster - simplify generation of the new APP if the DB already exists - jhipster

does any tool exist that can simplify generation of the new APP if the DB already exists? I can create JDL file for new app manually base on existing DB - but I prefer to automate the process. This DB is part of old Spring Roo app.
Thank you.

The spring Roo 1.x version provides the "Database Reverse Engineering" functionality. This add-on allows you to create an application tier of JPA 2.0 entities based on the tables in your database. DBRE will also incrementally maintain your application tier if you add or remove tables and columns.
After generate the entities, you could execute the necessary web mvc commands to generate the complete application.
However, remember that the Spring Roo 1.x is not beeing maintained, because uses old technologies.
See more about the DBRE process here:
http://docs.spring.io/spring-roo/reference/html/base-dbre.html
Hope it helps,

There's a JHipster module that is being developed for this purpose: https://github.com/bastienmichaux/generator-jhipster-db-helper
It is probably not ready yet but could be a good start.

Related

What are the best practices to prevent code loss while regenerating application with JHipster

What are the best practices to deal with code regeneration and custom code in some complex project using JHipster? How not to lose custom changes while regenerating the project? Our team usually consist of 5 to 10 developers.
There is an approach named as side-by-side (see https://www.youtube.com/watch?v=Gg5CYoBdpVo) that requires discipline from developers.
Also --incremental-changelog new feature of JHipster 7 can help to manage incremental changes to SQL database, even though it's currently poorly documented.
Another useful feature is to generate your project with #GeneratedByJHipster annotation in your Java classes by using jhipster --with-generated-flag
If a team of 5 to 10 devs works on same app, it will be hard anyway without JHipster but even harder with JHipster. I see several alternatives:
Use a microservice architecture to help isolating from others changes.
For a monolith, I would recommend using JHipster only for bootstrapping the app, generate few base entities and then forget about it, cut down the dependencies with JHipster and develop the project as a usual Spring Boot project.

Can JHipster be used to maintain a project, or just initially generate it?

Most information on the web demo generating a JHipster project, don't show a maintenance cycle using the tool. It's rather difficult to find a non-feature if that is the case. Thought I'd ask of those with experience with the tool, and hopefully document the feature or non-feature.
You can use the upgrade sub-generator to upgrade your JHipster app between releases. However, as your app grows and becomes more custom, it might make sense to use JHipster to generate your app, and then upgrade your dependencies as needed.

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...

How to do the Authorization in Asp.net by using Identity Framework?

For doing authorization in asp.net mvc 5 I have searched lot on internet but not getting correct answer. Actually I am using Visual studio community edition with .net framework 4.5.2 and mvc5. I want to do the Authorization in my project. My project is created with no authentication mode while creating a project.
Firstly I have tried these things:
I typed a command "Enable Migrations" on Package manager console.
Then I got one error like: Creating a DbModelBuilder or writing the EDMX from a DbContext created using Database First or Model First is not supported. EDMX can only be obtained from a Code First DbContext created without using an existing DbCompiledModel.
I dont know how to resolve this error. please help me to get out of it.
Which approach did you chooses to build our database model? Code First, Model First or Database First?
I'm asking because you can't use migrations with Model First or Database First approach. EF Migrations is a product targeted for Code First approach. CodeFirst assumes that you will never make any changes manually to the database. All the changes to the database will go through the code first migrations.
But there is solution for that - you can use Code First approach with an existing database. Take a look here: Using EF “Code First” with an Existing Database.

Integration of Java application with OpenCms

I want to know how to integrate a Java web application with OpenCms contents. Is it possible to integrate a Java application with OpenCms?
Yes, it's possible. For example you can integrate SpringMVC or Struts into OpenCms, or other tools like JForum, an open source java forum, which also supports single-sign-on (SSO).
You can find information here & a small sample OpenCms+Spring integration project:
http://www.opencms-wiki.org/wiki/Integration_HOWTOs
Since OpenCms is open source and based on Java EE standards, you are pretty free.
What I have done successfully is to create a jstl tag library to connect JSPs in OpenCms to a business backend.
In my case it was done through a SOAP web-service.
Another advantage of this was that I could test and develop my code in Eclipse, without a dependency on OpenCms.
Deploying to production would then mean to deploy a jar file to the OpenCms webapp.
Yet another advantage: Since we put some of the view-logic into the OpenCms-hosted JSPs, they were versioned by OpenCms.
We have integrated SprigMVC into an existing OpenCMS installation. Here is a description of how we went about that: http://blog.shinetech.com/2013/04/09/integrating-springmvc-with-opencms/

Resources