jhipster / generator-jhipster

JHipster is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures.
https://www.jhipster.tech
Apache License 2.0
21.54k stars 4.02k forks source link

🚀 Create constraints on multiple columns #14529

Closed amatosg closed 1 year ago

amatosg commented 3 years ago
Overview of the feature request

Allow to create unique constraints on multiple columns when importing from a JDL file.

Motivation for or Use Case

It might be useful to other users (I actually found it useful). It could be something like

@Unique(column1, column2, column3)
entity Example

and that would generate

@Table(name = "example",
    uniqueConstraints = {
        @UniqueConstraint(columnNames = {"column1", "column2", "column3"})
    })
Related issues or PR

None that I know of.

mshima commented 3 years ago

First problem, jdl doesn't support arrays https://github.com/jhipster/generator-jhipster/pull/12632.

MathieuAA commented 3 years ago

I'm against it. A constraint should be linked to the field (JDL-wise) instead of the entity. That, and this syntax would require you to update the name at least twice when changing a field's name. It's a no for me.

amatosg commented 3 years ago

Well, that would be the case then dealing with constraints that involve only one field. Besides, when dealing with Unique constraints, I don't think I would see changes that often to the field names.

github-actions[bot] commented 3 years ago

This issue is stale because it has been open 30 days with no activity. Our core developers tend to be more verbose on denying. If there is no negative comment, possibly this feature will be accepted. We are accepting PRs :smiley:. Comment or this will be closed in 7 days

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for too long without any activity. Due to the moving nature of jhipster generated application, bugs can become invalid. If this issue still applies please comment otherwise it will be closed in 7 days

laariche-khalid commented 8 months ago

Hi any Update in this feature , it's very useful