0
votes

I'm trying to create job table have multi-image in JDL

I used to one-to-many relationship but jhipster warnning:

WARNING! otherEntityRelationshipName is missing in .jhipster/Attachment.json for relationship {
    "relationshipName": "job",
    "otherEntityName": "job",
    "relationshipType": "many-to-one",
    "otherEntityField": "id",
    "otherEntityRelationshipName": "attachment"
}, using attachment as fallback

My job JDL like that:

microservice * with job

entity Job{
    name String required
    description String
}

entity Attachment{
    name String
    image ImageBlob
}

relationship OneToMany{
     Job{image} to Attachment
}
service * with serviceClass
paginate * with pagination


How can I fix it. please help!

1
Have you tried "Job{image} to Attachment(job)" ? - Gaël Marziou
Yep! I did. Just many-to-one relationship was created without any warning. - Tài Bùi
So you can answer your question or delete it. - Gaël Marziou
My wish is one-to-many relationship! - Tài Bùi
And what? Please clarify your question - Gaël Marziou

1 Answers

0
votes

Unidirectional one-to-many relationship is not provided by default in JHipster at the moment.
It should be like this:

relationship OneToMany{
    Job{image} to Attachment{job}
}