Modified entites are not reflecting in database - jhipster

I have created a Entity for jhipster Microservice Gateway project.
Tried to modify the entity by adding new fields later. Its corresponding Java classes and Angular files got updated. But, the new field is not added in the database table.
Did i miss any other configurations ? Thanks in advance !

the database changes are done by liquibase, i.e. you need to have a look under
src/main/resources/config/liquibase/
for master.xml. JHipster is adding all the scripts that need to be run when you start your app in master.xml.
When you add new fields over comand line, then the generator is modifing your master.xml by adding a new change or is just updating an existing change. All the changes are located under in the folder changelog which is on the same level as master.xml.

I got it now. I failed to add hibernate statement under jpa in application.dev.yml.
I have added " hibernate.hbm2ddl.auto: update" under jpa in application.dev.yml file. And the field got inserted into mysql DB table.

Related

JHipster: How turn prompt optional in my blueprint when executing the "jdl" command

I've observed the following behavior when I generate a new application using JHipster:
When I just call jhipster, it shows a set of prompts to make my choices.
When I call jhipster jdl <myjslfile.jdl>:
2.1. If the JDL has just entities, not declaring a config application section, I've got an error: Database type is required to validate entities.
2.2. If the JDL has the minimum config application like the following, it assumes some defaults and does not show any prompt.
I'm trying to write my own blueprint and I'd like to know how could I tell to Jhipster some default values should be considered when loading a JDL.
I thought that if I just set the prompt attribute default would be the solution, but I did this and have no effect, the prompts are always shown. When there are more than one application declared in the JDL file it's worst because it's not possible to distinguish what is being answered to each application since this processes happen in parallel.
Regards,
application {
config {
baseName microserviceExample,
applicationType microservice,
prodDatabaseType postgresql
}
entities X
}
entity X {
name String required minlength(3)
}
Personally, I don't like depending on default values that could be changed by a new major version (e.g. default for service registry will change in JHipster 8 from Eureka to Consul).
Why is this a problem to explicit these values in your JDL? For me the JDL should be self contained as much as possible.
Alternatively, you could define a .yo-rc.json file in your project directory or in its parent directory if you want to apply to several apps below.
And finally, you could open a feature request on github for the dev team to comment.

JSON Web Service not appearing in /api/jsonws

I m new to liferay perform crud operation but my create method is not appering in api/jsonws . I also check my service is active by lb gogo shell command
For ServiceBuilder operations, please check if you have remote-service="true" on your entity (attributes) inside the service.xml file. If not, please add this attribute and rerun servicebuilder.
Open your {EntityName}ServiceImpl (inside of the .service.impl package) and add your operations here.
Finally, rerun servicebuilder and deploy your app. When using api/jsonws - make sure you select the right context name with the dropdown.

cannot find the sql generated by jhipster create entity

I have done setup of jhipster(using video ) and tried to create entity using jhipster. I have not taken any json file as input. To make it simple I have created entity Employee as....
Command yo jhipster:entity Employee
---Employee---
name String
email String
with no validation rules and relationship. Entity creation is successful but I cannot find any .sql file containing the sql command.
I can see respective java files are generated in under src\main\java\com\mycompany\myapp\domain. Any idea where is the sql created?
There are no generated SQL files.
JHipster uses Liquibase for the changes to your Database.
You should have these XML files in src/main/resources/config/liquibase/changelog/, doing the same as SQL files.

Is it possible to create services and DTO from existing entity?

I am seeking for a way to create DTO and service automatically from entity. To be more specific I've created some entities and their relationship using JDL-studio and imported using jhipster cli but I didn't found dto and service. Even I tried other option like changing .json file under .jhipster folder but no luck.
Is there any option out there?
Well, I found the solution myself that once the entity is created the entity json file will also automatically created on .jhipster folder and for the service and DTO what we have to do is we've to just put following properties on .json entity.
"dto": "mapstruct",
"service": "serviceImpl",
"microserviceName": "WntVehicleAuthority",
and after that we 've to issue yo jhipster:entity EntityName and it will automatically generate service and dto.
Note only mention Entity name not extension
ie, yo jhipster:entity Employee

Error on Acumatica Create Code File for New DAC based on database table

CreatingCodeFileForNewDACFromDatabaseTable
I am trying to add a new DAC from an existing database table per the Acumatica documentation. However, when I click OK, I get an error:
localhost says "An unhandled exception has occurred in function MoveNext. Please see the trace log for more details.
Anyone seen this before? How should I proceed? Where are the trace logs stored?
Thanks,
David
The issue only happens if there is no ItemDocument table in your database.
If you've just created ItemDocument table, make sure to restart IIS or recycle app pool to make sure Acumatica is aware of the new table, as it caches database schema once, when domain starts.
When you create new DAC in the Customization Manager, its namespace will match name of the customization project:
It's necessary to type FullName of a custom DAC (inc. namespace) when using a custom DAC inside different namespace - DocCenter.ItemBaseDocumen‌​t in your case:
[PXSelector(typeof(S‌​earch<DocCenter.ItemBaseDocumen‌​t.baseDocumentCode,
OrderBy<Asc<DocCenter.ItemBase‌​Document.BaseDocument‌​Code>>>),
DescriptionField = typeof(DocCenter.ItemBaseDocum‌​ent.baseDocumentShort‌​Description))]

Resources