-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Creating a Job with default JDL breaks entity access #7463
Comments
What do you mean by "breaks entity access"?Le 10 avr. 2018 17:26, "Alexandre GC." <notifications@github.com> a écrit :Overview of the issue
When you try to create a Job entity it breaks it's entity.
Motivation for or Use Case
Bug with the default JDL.
Reproduce the error
Create a "vanilla" Angular project and import the default JDL provided by JDL Studio
Related issues
idk
Suggest a Fix
idk, I'll try to take a look this week.
JHipster Version(s)
test@0.0.0 /home/ippon/repos/tests/test
└── generator-jhipster@5.0.0-beta.0 -> /home/ippon/repos/generator-jhipster
JHipster configuration, a .yo-rc.json file generated in the root folder
.yo-rc.json file
{
"generator-jhipster": {
"promptValues": {
"packageName": "com.mycompany.myapp",
"nativeLanguage": "en"
},
"jhipsterVersion": "5.0.0-beta.0",
"baseName": "test",
"reactive": false,
"packageName": "com.mycompany.myapp",
"packageFolder": "com/mycompany/myapp",
"serverPort": "8080",
"authenticationType": "jwt",
"cacheProvider": "ehcache",
"enableHibernateCache": true,
"websocket": false,
"databaseType": "sql",
"devDatabaseType": "h2Disk",
"prodDatabaseType": "mysql",
"searchEngine": false,
"messageBroker": false,
"serviceDiscoveryType": false,
"buildTool": "maven",
"enableSwaggerCodegen": false,
"jwtSecretKey": "replaced-by-jhipster-info",
"clientFramework": "angularX",
"useSass": false,
"clientPackageManager": "yarn",
"applicationType": "monolith",
"testFrameworks": [],
"jhiPrefix": "jhi",
"enableTranslation": true,
"nativeLanguage": "en",
"languages": [
"en"
]
}
}
JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory
JDL entity definitions
entity Region (region) {
regionName String
}
entity Country (country) {
countryName String
}
/**
* not an ignored comment
*/
entity Location (location) {
streetAddress String,
postalCode String,
city String,
stateProvince String
}
entity Department (department) {
departmentName String required
}
/**
* Task entity.
* @author The JHipster team.
*/
entity Task (task) {
title String,
description String
}
/**
* The Employee entity.
*/
entity Employee (employee) {
/**
* The firstname attribute.
*/
firstName String,
lastName String,
email String,
phoneNumber String,
hireDate Instant,
salary Long,
commissionPct Long
}
entity Job (job) {
jobTitle String,
minSalary Long,
maxSalary Long
}
entity JobHistory (job_history) {
startDate Instant,
endDate Instant,
language Language
}
enum Language {
FRENCH,
ENGLISH,
SPANISH
}
relationship OneToOne {
Country{region} to Region,
Location{country} to Country,
Department{location} to Location,
JobHistory{job} to Job,
JobHistory{department} to Department,
JobHistory{employee} to Employee
}
relationship OneToMany {
/**
* A relationship
*/
Department{employee} to Employee{department},
Employee{job} to Job{employee}
}
relationship ManyToOne {
Employee{manager} to Employee
}
relationship ManyToMany {
Job{task(title)} to Task{job}
}
dto Region, Country, Location, Department, Task, Employee, Job, JobHistory with mapstruct
service Region, Country, Location, Department, Task, JobHistory with serviceImpl
angularSuffix Region, Country, Location, Department, Task, Employee, Job, JobHistory with mySuffix
paginate Employee, JobHistory with infinite-scroll
paginate Job with pagination
Environment and Tools
openjdk version "1.8.0_162"
OpenJDK Runtime Environment (build 1.8.0_162-8u162-b12-0ubuntu0.16.04.2-b12)
OpenJDK 64-Bit Server VM (build 25.162-b12, mixed mode)
git version 2.7.4
node: v8.11.1
npm: 5.6.0
yeoman: 2.0.1
yarn: 1.5.1
Docker version 1.13.1, build 092cba3
docker-compose version 1.8.0, build unknown
Entity configuration(s) entityName.json files generated in the .jhipster directory
Browsers and Operating System
I don't think it matters.
—You are receiving this because you are subscribed to this thread.Reply to this email directly, view it on GitHub, or mute the thread.
|
@MathieuAA I meant that requesting |
Based on the changes from #5629 (comment) (same issue as here), we no longer allow DTOs without an entity Service or ServiceImpl. The only way this happened was by importing the JDL. The proposed fix enables eager loading of the relationship which is a code smell (see linked issue for discussion on that). But it seems we eager load One thing we should do is update the default JDL to remove incompatible options |
Agreed. I intended to replace it entirely by the end of the month..Le 10 avr. 2018 20:02, Jon Ruddell <notifications@github.com> a écrit :Based on the changes from #5629 (comment) (same issue as here), we no longer allow DTOs without an entity Service or ServiceImpl. The only way this happened was by importing the JDL.
The proposed fix enables eager loading of the relationship which is a code smell (see linked issue for discussion on that). But it seems we eager load ManyToMany relationships when you use a service+DTO... Not sure what to do here.
One thing we should do is update the default JDL to remove incompatible options
—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or mute the thread.
|
Looks like it's a bit more complicated than I thought. |
Indeed, using a DTO without a service is not supported anymore, and the JDL should not allow that. On the main generator there is no problem, as you don't have that option in the prompts, and this is why I'm closing this. |
I'll make sure this gets fixed for the JDL
|
Thanks @MathieuAA !! |
Overview of the issue
When you try to create a Job entity the server will return a 500, and you won't be able to access that entity anymore.
Motivation for or Use Case
Bug with the default JDL.
Reproduce the error
Create a "vanilla" Angular project and import the default JDL provided by JDL Studio
Related issues
idk
Suggest a Fix
idk, I'll try to take a look this week.
JHipster Version(s)
JHipster configuration, a
.yo-rc.json
file generated in the root folder.yo-rc.json file
JDL for the Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryJDL entity definitions
Environment and Tools
openjdk version "1.8.0_162"
OpenJDK Runtime Environment (build 1.8.0_162-8u162-b12-0ubuntu0.16.04.2-b12)
OpenJDK 64-Bit Server VM (build 25.162-b12, mixed mode)
git version 2.7.4
node: v8.11.1
npm: 5.6.0
yeoman: 2.0.1
yarn: 1.5.1
Docker version 1.13.1, build 092cba3
docker-compose version 1.8.0, build unknown
Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryBrowsers and Operating System
I don't think it matters.
The text was updated successfully, but these errors were encountered: