You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Store as ARRAY of UUID on Postgres@DbArrayList<UUID> uids = newArrayList<>();
// Store as ARRAY on Postgres@DbArrayList<String> phoneNumbers = newArrayList<>();
// Store as ARRAY of INTEGER on Postgres@DbArrayList<Long> someLongs = newArrayList<>();
You are not telling us what version of ebean you are using and what version and type of enhancement (maven, gradle, what version) and if there are any enhancement errors / warnings being reported during the enhancement.
To be clear, there is some specific treatment for @DbArray as to it being nullable or not that changes the enhancement. That is, a non-nullable @DbArray will have pre-getter behaviour to automatically initialise the collection if it is null. So the @Column(nullable = false) is significant for @DbArray.
This is because DbArray uses collections ... and generally it is nice to never deal with null for collection types (unless we explicitly expect null by making the mapping nullable).
@DbJsonB ...
It isn't a @DbArray and doesn't get the same treatment in terms of enhancement.
@rbygrave I added information to the end of issue immediately after creating. The main problem that Javadoc is lying that it working, changing field type was only for checking exception was gone or not
So assuming that is correct, what still is not clear is what "Does not work" actually means, as in a BeanNotEnhancedException is probably suggesting there is some other error reported during enhancement (but maybe that isn't exposed via the play enhancement?). Hmm, I might see if I can reproduce.
Edit: Oh but for ebean we don't support the public fields (unless expert mode) ... so kinda suggests play might also be doing enhancement and so I do wonder if that is an issue (mixed play and ebean enhancement for this case).
Is there something else interesting around the constructor or class initialisation? Or is this Play specific perhaps? Ultimately we need a reproducing test case for this.
Activity
rbygrave commentedon Sep 21, 2026
You are not telling us what version of ebean you are using and what version and type of enhancement (maven, gradle, what version) and if there are any enhancement errors / warnings being reported during the enhancement.
To be clear, there is some specific treatment for
@DbArrayas to it being nullable or not that changes the enhancement. That is, a non-nullable@DbArraywill have pre-getter behaviour to automatically initialise the collection if it is null. So the@Column(nullable = false)is significant for@DbArray.This is because DbArray uses collections ... and generally it is nice to never deal with null for collection types (unless we explicitly expect null by making the mapping nullable).
It isn't a
@DbArrayand doesn't get the same treatment in terms of enhancement.PromanSEW commentedon Sep 21, 2026
@rbygrave I added information to the end of issue immediately after creating. The main problem that Javadoc is lying that it working, changing field type was only for checking exception was gone or not
PromanSEW commentedon Sep 21, 2026
Removing
@Column(nullable = false)fixed the problem, but SQL field isinteger[], notinteger[] not nullEDIT:
@Basic(optional = false)works finerbygrave commentedon Sep 21, 2026
Ok, this might be clear to me now although the "BeanNotEnhancedException" isn't clear.
To be clear, it is really useful to be really obvious. I think you are saying that:
This works (and now the column is not null which is what is desired)
The following does NOT work? (which somehow shows up as BeanNotEnhancedException??)
Also note that
@DbArray(nullable=false)is also an option.So assuming that is correct, what still is not clear is what "Does not work" actually means, as in a BeanNotEnhancedException is probably suggesting there is some other error reported during enhancement (but maybe that isn't exposed via the play enhancement?). Hmm, I might see if I can reproduce.
Edit: Oh but for ebean we don't support the public fields (unless expert mode) ... so kinda suggests play might also be doing enhancement and so I do wonder if that is an issue (mixed play and ebean enhancement for this case).
PromanSEW commentedon Sep 21, 2026
@rbygrave You are right.
This is working:
Throws
BeanNotEnhancedException.@DbArray(nullable = false)- also throwsBeanNotEnhancedException.#3888 Tests for @DBArray using nullable false (various options) for L…
rbygrave commentedon Sep 22, 2026
I was not able to reproduce this issue via - https://github.com/ebean-orm/ebean/pull/3889/changes
Is there something else interesting around the constructor or class initialisation? Or is this Play specific perhaps? Ultimately we need a reproducing test case for this.
PromanSEW commentedon Sep 22, 2026
Cannot reproduce anymore, seems like build or code cache artifact, not bug in
@DbArraySorry
rbygrave commentedon Sep 22, 2026
All good. Thanks for the update.