Repository navigation
@DbArray List<Integer> raises BeanNotEnhancedException #3888
Description
Activity
I got BeanNotEnhancedException
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).
@DbJsonB ...
It isn't a
@DbArrayand 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
Removing
@Column(nullable = false)fixed the problem, but SQL field isinteger[], notinteger[] not null
EDIT:@Basic(optional = false)works fineRemoving @column(nullable = false) fixed the problem, but SQL field is integer[], not integer[] not null
EDIT: @basic(optional = false) works fineOk, this might be clear to me now although the "BeanNotEnhancedException" isn't clear.
@basic(optional = false) works fine
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)
@DbArray @Basic(optional = false) public List<Integer> progress = new ArrayList<>();
The following does NOT work? (which somehow shows up as BeanNotEnhancedException??)
@DbArray @Column(nullable = false) public List<Integer> progress = new ArrayList<>();
Also note that
@DbArray(nullable=false)is also an option.@DbArray(nullable = false) public List<Integer> progress = new ArrayList<>();
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).
@rbygrave You are right.
This is working:@DbArray @Basic(optional = false) public List<Integer> progress = new ArrayList<>();
@DbArray @Column(nullable = false) public List<Integer> progress = new ArrayList<>();
Throws
BeanNotEnhancedException.
@DbArray(nullable = false)- also throwsBeanNotEnhancedException.Reacted by Rob BygraveReacted by Rob Bygrave- linked a pull request that will close this issue#3888 Tests for @DbArray using nullable false (various options) for List<Integer> #3889
on Sep 22, 2026 - added a commit that references this issue
on 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.
Cannot reproduce anymore, seems like build or code cache artifact, not bug in
@DbArray
SorryAll good. Thanks for the update.
Javadoc for
@DbArraysays:But if use this:
I got
BeanNotEnhancedExceptionIf I change to this:
Class compiles succesfully.
Why Javadoc behaviour is not working?
Ebean version: 17.1.0
I use enhancing by ebean-agent in Play Framework, and don't have
querybean-generatorin classpath