Create array field in jhipster using mongodb

205 Views Asked by At

I want create one field e.g URL in that field we can insert multiple value url that data is stored in array format using jhipster mongodb

Created getter setter of string[]url in dto.java

1

There are 1 best solutions below

0
dangarfield On

With JHipster, you define your entities as per the docs.

It's worth noting that you can't define arrays of Lists directly, you have to create a one-to-many relationship, eg: set up your JDL something like this:

entity SomeEntity {
    id String
    ...
}

entity Url {
    name String
}

relationship OneToMany {
    SomeEntity{url} to Url{parentEntity}
} 

It's also worth noting that JHipster does not provide a uni-direction one-to-many relationship at the minute.