Open
Description
Describe the bug
I have a nested embedded structure similar to the one in this issue, the difference is mostly that in the current issue I have one more abstract embeddable so more or less the workaround the issue 6522.
Logging the created entity we get this structure
ChangeOwner { // change owner is the ouer most entity
id: 1,
fields: [ // fields is an polymorphic array embeddable
ChangeBooleanValue { // the issue only seems to exist for the boolean version of the polymorphic embeddable
type: 'BOOLEAN',
entries: [
BooleanChangeEntry { // the nested embeddable which is also theoretically polymorphic
type: 'BOOLEAN',
value: true
}
]
}
]
}
If we persist and flush this, the db entry looks good, but after querying this with await orm.em.findOneOrFail(ChangeOwner, 1)
we receive the entity like this
ChangeOwner {
fields: [ ChangeBooleanValue { type: 'BOOLEAN', entries: [] } ],
id: 1
}
So the inner array is just completely lost. If after querying we flush without doing anything else, the entity will be updated.
In my reproduction I also queried the entity using knex to demonstrate that it actually is stored correctly in the db.
Reproduction
What driver are you using?
@mikro-orm/postgresql
MikroORM version
6.4.10
Node.js version
v22.9.0
Operating system
Ubuntu 22.04.5 LTS
Validations
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord.
- The provided reproduction is a minimal reproducible example of the bug.
Metadata
Metadata
Assignees
Labels
No labels