entity A {
  @Id Long customId
}
Should set id option to true instead of Id.
application {entities *} entity A{} entity B{} relationship OneToOne { @id A to B }
Currently generates:
{
  "name": "A",
  "relationships": [
    {
      "relationshipType": "one-to-one",
      "otherEntityName": "b",
      "otherEntityRelationshipName": "a",
      "relationshipName": "b",
      "otherEntityField": "id",
      "ownerSide": true,
      "options": {
        "id": true
      }
    }
  ],
...
}
{
  "name": "B",
  "relationships": [
    {
      "relationshipType": "one-to-one",
      "otherEntityName": "a",
      "otherEntityRelationshipName": "b",
      "relationshipName": "a",
      "otherEntityField": "id",
      "ownerSide": false,
      "options": {
        "id": true
      }
    }
  ],
...
}
Makes harder to detect if A is id of B or if B is id of A.
A solution is to allow annotations on other side:
relationship OneToOne { A to @id B }
cc @MathieuAA
I'm taking this one
This is a jdl breaking change.
Needs to be implemented before v7.
Indeed @mshima. For the first issue, this involves every option. Plus, I don't see why options beginning by an upper-case letter should be allowed. I propose to only allow options beginning with a lowercase letter. @mshima WDYT?
For the second issue, thanks for the examples. I'm fixing it.
For the first issue, this involves every option. Plus, I don't see why options beginning by an upper-case letter should be allowed. I propose to only allow options beginning with a lowercase letter.
I prefer upper case, I think it鈥檚 prettier and AFAIK most of languages uses upper case annotations.
Any approach fixes the issue 馃槃 .
For the second issue, thanks for the examples. I'm fixing it.
Great thanks.
@pascalgrimaud this change is a breaking change.
IMO can be done after first beta, but should be resolved before final.
Annotations for relationship should be inverted IMO.
OneToOne { @id A to B }
Should generate:
{
  "name": "A",
  "relationships": [
    {
      "relationshipType": "one-to-one",
      "otherEntityName": "b",
      "otherEntityRelationshipName": "a",
      "relationshipName": "b",
      "otherEntityField": "id",
      "ownerSide": true
    }
  ],
...
}
{
  "name": "B",
  "relationships": [
    {
      "relationshipType": "one-to-one",
      "otherEntityName": "a",
      "otherEntityRelationshipName": "b",
      "relationshipName": "a",
      "otherEntityField": "id",
      "ownerSide": false,
      "options": {
        "id": true
      }
    }
  ],
...
}
Meaning A is an id for B
Just like OneToOne { B to @id A }
Makes more sense for me.
Agreed, it's already taken care of BTW :)
Thanks Marcelo