Re: Question about optionality in one-to-one relationships

2024-01-11 Thread Riccardo De Menna
Hi all, After looking into the source code I think that the method that determines if, at class generation time, a relationship is mandatory, is the following from org.apache.cayenne.map.DbRelationship: @Override public boolean isMandatory() { for (DbJoin join : getJoins()) { if (jo

Re: Question about optionality in one-to-one relationships

2024-01-11 Thread Riccardo De Menna
Hi Nikita, I stumbled upon a discussion thread in which you advertised a pull request to allow the use of metadataUtils via cgen to access comments. Can you tell me how to use it? Works with modeler as well? Thank you in advance, Riccardo > On 11 Jan 2024, at 09:22, Riccardo De Menna wrote: >

Re: Question about optionality in one-to-one relationships

2024-01-11 Thread Nikita Timofeev
Hi Riccardo, I don't quite remember my advice there. In Modeler this metadata goes just as a comment to entity/attribute/relationship. So you could set something in the comment and get access to this information via metadataUtils in the template (via `metadataUtils.getComment(relationship)`). Als

Re: Question about optionality in one-to-one relationships

2024-01-11 Thread Riccardo De Menna
Hi Nikita, Thank you very much for the pointers. I will amend my templates to emulate cayenne and use the metadata comments for any custom behaviour. Thank you for that pull request. Best regards, Riccardo > On 11 Jan 2024, at 17:36, Nikita Timofeev wrote: > > Hi Riccardo, > > I don't quite