Closed JulienLHPro closed 10 months ago
Additional note: on Admin page, internalID
correctly starts at 1
Thanks for reporting! I don't see anything obvious. Can you provide a working unit test or minimal example project that reproduces this?
I fixed my issue but one might find interesting the fact that you can't set a relationship in the constructor:
this.macroCategoryEntry.target =
although you would get no error apart from getting a zero internalID when fetching that entity later
Good to hear. However, from the top of my head there should be nothing preventing you from setting a ToOne
target in the constructor?
Bug description Identifier is set to zero when entity is fetched from database
Basic info
To Reproduce No idea, but it does not happen on all entities
Expected behavior When fetched from database, entity identifier should not be zero
Code
store.box<ItemEntry>().put(itemEntry, mode: PutMode.put)
After insertion,
itemEntry.internalID
is 1itemEntry
is not null and has all correct values, except foritemEntry.internalID
which is 0Logs, stack traces Because of all relations I skipped here, I end up with this error:
"Bad state: Can't store relation info for the target object with zero ID"
Additional context The main insertion is done in a Transaction, but the problem is the same without it.