Skip to content

generateConstructors #83

@mehmetgunacti

Description

@mehmetgunacti

I have a quick question (couldn't find the answer by searching) :

I have an Entity

@Entity(nameInDb = "configuration", generateConstructors = false, generateGettersSetters = true)
public class ConfigurationVO { ... }

But I get this exception :

io.objectbox.exception.DbException: Entity is expected to have this constructor: configuration(JLjava/lang/Boolean;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
                                                                                   at io.objectbox.Cursor.nativeGetEntity(Native Method)
                                                                                   at io.objectbox.Cursor.get(Cursor.java:151)
                                                                                   at io.objectbox.Box.get(Box.java:186)

I'd expect ObjectBox to simply use the default constructor + accessors if generateConstructors is set to false.
Could someone please clarify this exception and when to use the generateConstructors annotation ?
Thanks in advance and keep up the good work, ObjectBox is great !!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions