JHIPSTER JDL: Confusion between join field and display field

178 Views Asked by At

I'm confused with the JHipster documentation here

relationship (OneToMany | ManyToOne | OneToOne | ManyToMany) {
  <from entity>[{<relationship name>[(<display field>)]}] to <to entity>[{<relationship name>[(<display field>)]}]+
}

<display field> is the name of the field that should show up in select boxes (default: id),

But in another sample the same <display field> is used to join, nor dispay.

relationship OneToOne {
  A{b(name)} to B{a(name)}
}

It roughly translates to SQL: JOIN B b with a.name = b.name

So if I have one bi-directional relationship with two entities with "id" and I need to display the name in both... ¿The join will be done by name and not by id?

0

There are 0 best solutions below