Blackdread / sql-to-jdl

Tool to translate SQL databases to JDL format of jHipster (Created due to existing databases to be generated with jHipster and build angular-java web)
MIT License
179 stars 81 forks source link

Duplicate names in many to one rel fix #170

Closed gleb619 closed 1 year ago

gleb619 commented 1 year ago

Closes #169

gleb619 commented 1 year ago

With this change, the jdl will be generated in:

entity Task(task) {
    name String required maxlength(255),
    summary String maxlength(255),
    description String maxlength(255),
    priority String maxlength(255),
    status String maxlength(255)
}

entity Worker(worker) {
    name String required maxlength(255),
    details String maxlength(255)
}

// Relations
relationship ManyToOne {
    Task{assignee} to Worker{task}
}

relationship ManyToOne {
    Task{author} to Worker{taskOfAuthor}
}

The name will change to taskOfAuthor, which represents the following pattern:
name + 'of' + columnName relation

Blackdread commented 1 year ago

Thank you, it makes sense, field name is duplicated in Worker entity