-
-
Notifications
You must be signed in to change notification settings - Fork 495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Map To PK feature does not convert Id to custom type #4803
Comments
I already pinned the offender line, @B4nan, it's within the ObjectHidrator:
Right before executing this line, the entity.user is a if (data.user != null && convertCustomTypes) {
data.user = convertToDatabaseValue_user(entity.user);
} Then, the
Could you give me any help here on how to fix that, Martin? thanks! |
Hey again, Martin. I believe I found out a way to fix that - I'll create a PR so you can review it. Basically, I've added modified one in the if (prop.mapToPk) {
ret.push(` entity${entityKey} = convertCustomTypes ? convertToJSValue_${convertorKey}(data${dataKey}) : data${dataKey};`);
} So, if we have the |
I already have a (much simpler and more correct) fix, give me a sec. |
Sure, Martin, I appreciate it! |
Hey again, @B4nan , thanks for the fix! Could you publish the latest change? I believe the |
Those flaky tests... |
Describe the bug
User
has ManyProfile
sProfile
side uses themapToPk: true
featureUser
side's Id is a custom type (a Value Object)Profile
entity (Many side) from the databaseuserId
attribute is a plain stringStack trace
To Reproduce
Steps to reproduce the behavior:
yarn
docker compose up -d
yarn test
Expected behavior
the
userId
should be an instance ofId
instead of a plainstring
.Additional context
The
id
data type in the database is actually abigint
Versions
The text was updated successfully, but these errors were encountered: