@ManyToOne and @OneToOne handles optional=true wrong

I had a bunch of optional=false for some of my relations and I decided for the rest of them to make it explicit that they were optional with an optional=true. This should have no effect because optional=true is the default.

However, with optional=true, Cuba-Platform changes the database field to “not null” (i.e. not optional).

Possibly the code is just looking to see if there’s an optional annotation attribute as opposed to looking at what the value of it is.

Hi,

Thank you for reporting the problem. We have created a YouTrack issue. The link is on the right.

Let me mention it: optional=true is redundant here, as Studio makes some code optimization and on the next entity modification the default setting is going to be erased.

:ticket: See the following issue in our bug tracker:

https://youtrack.cuba-platform.com/issue/STUDIO-3414