Failed to generate entity ui from microservie when using jdl - jhipster

I generated a microservice with jdl file using jhipster v4.6.2, when generating the gateway entity from an existing microservice, I got this error:
$ jhipster entity Media
Executing jhipster:entity Media
Options:
The entity Media is being created.
? Do you want to generate this entity from an existing microservice? Yes
? Enter the path to the microservice root directory: ../media
Found the .jhipster/Media.json configuration file, entity can be automatically generated!
Error: ERROR!
The entity configuration file could not be read!
at Environment.error (/Users/austinzhang/.config/yarn/global/node_modules/yeoman-environment/lib/environment.js:140:40)
at constructor.error (/Users/austinzhang/.config/yarn/global/node_modules/generator-jhipster/generators/generator-base.js:1610:18)
at constructor._loadJson (/Users/austinzhang/.config/yarn/global/node_modules/generator-jhipster/generators/entity/index.js:246:18)
at prompt.then (/Users/austinzhang/.config/yarn/global/node_modules/generator-jhipster/generators/entity/prompts.js:87:18)
at <anonymous>
any ideas for resolve it.
Thanks a lot for your help.

Related

How to get the Builds for a project using OData in Azure Devops

I'm trying to get all the builds for a project using Odata for Azure Devops. However I found there was an endpoint for that https://analytics.dev.azure.com/{organization}/{project}/_odata/v3.0-preview/Builds but while trying the same for my Project I'm getting the below error
{"$id":"1","innerException":null,"message":"Resource not found for the segment 'Builds'.","typeName":"Microsoft.OData.UriParser.ODataUnrecognizedPathException, Microsoft.TeamFoundation.OData.Core","typeKey":"ODataUnrecognizedPathException","errorCode":0,"eventId":0}
Is this endpoint not available anymore. Or is there something wrong with my query?
Is this endpoint not available anymore. Or is there something wrong
with my query?
The entity set Build has been renamed. You can check this post from our User Voice forum.
All entity sets and entity properties with names starting with Build will be renamed to start with PipelineRun.
For e.g. Builds entity set will be called PipelineRuns, BuildId entity property will be called PipelineRunId.
So what you should use is : https://analytics.dev.azure.com/{organization}/{project}/_odata/v3.0-preview/PipelineRuns. It works on my side :)

Jhipster using custom entity-client sub-generator

I am trying to create a blueprint for entity-client sub-generator by following the official guide. Tried several times. But when I try to use the generated blueprint, while importing jdl, it always says
Trying to use blueprint generator-jhipster-helloworld
WARNING! No blueprint found for entity-client falling back to default generator
then it generates the entity clients in the default way.
I can see the blueprint is linked into the node-modules folder of the generated app.
If anybody has created a simple working "entity-client sub-generator" blueprint, Please share the code with me. For example, "that adds <h1>lorem ipsum<h1> on the top of component.html file for the generated client of entity (on importing a simple jdl with just one entity)" would be sufficient.
Sample JDL
entity Item{
code String required,
description String required,
quantity Integer required
}
Best Regards.

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

JHipster first application

I’m a complete JHipster beginner and I want to create my first own JHipster application, but I got a problem that I’m not able to solve.
Firstly, I generated my app with following settings:
-Monolithic application
then I chose a base name and a default Java package of my app and HTTP Session Authentication.
Later, I chose following:
-SQL, MYSQL, MYSQL, Yes, with ehcache, Gradle, CSS preprocessor : Yes, Internationalization: Yes, Testing framework: Gatling
And to that moment everything looked fine , then I wanted to create my entity as follows:
Yo jhipster:entity activitylist
and I added three fields:
-activityname (String), acitivitydate (LocalDate) and rating (Integer) and then I added relationship with entity user, type: many to one.
Afterwards
I used yo jhipster:entity user and I added following fields: login(String), name(String), surname(String) and added relationship one to many with field user.
However, everytime when I tried to run it with docker I got compile Java Failure and following warnings:
warning: Unmapped target property: "authorities".
UserDTO userToUserDTO(User user);
error: Unknown property "password" in return type.
User userDTOToUser(UserDTO userDTO);
I would appreciate any help.
The problem with your app is the name of your entity: user.
You need to change the name of this entity because when You name it as following You create a new Java class : User, however JHipster has its own built-in User Java class which is located in src/main/java/domain folder.
This class has its own getter, setter methods and mapper which operation is affected when your entity „user" is created.
You can notice this fact in Your warnings when compiler informs You that it encountered unknown properties in Your return type in User userDTOToUser. I would strongly recommend You changing name of the user entity and everything else should work fine.

Resources