-
Notifications
You must be signed in to change notification settings - Fork 3
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
Insert: Incorrect parameters count #22
Comments
There is another issue with the public suspend fun update(entity: UserEntity) {
driver.execute(
511551143,
"""UPDATE UserEntity SET id = ?, phoneNumber = ?, gender = ?, name = ?, sampleAge = ?, salary = ?, isMarried = ?, spouseId = ?, data = ?, embeddedData_bankNumber = ?, embeddedData_cardToken = ?, embeddedData_cardNumber = ?, embeddedData_car = ?, embeddedData_price = ?, embeddedData_tires = ?, embeddedData_money = ? WHERE id = ? AND phoneNumber = ?""",
18
)
{
bindLong(0, kotlinIntKotlinLongAdapter.encode(entity.id))
bindString(1, entity.phoneNumber)
bindString(2, comAttafitamimKabinLocalEntitiesUserGenderKotlinStringAdapter.encode(entity.gender))
bindString(3, entity.name)
bindString(4, kotlinIntKotlinStringAdapter.encode(entity.age))
bindDouble(5, entity.salary?.let(kotlinFloatKotlinDoubleAdapter::encode))
bindBoolean(6, entity.isMarried)
bindLong(7, entity.spouseId?.let(kotlinIntKotlinLongAdapter::encode))
bindString(8, entity.data)
bindLong(9, entity.bankInfo?.bankNumber)
bindString(10, entity.bankInfo?.cardToken)
bindString(11, entity.bankInfo?.cardNumber)
bindString(12, entity.bankInfo?.carPurchase?.car)
bindString(13, entity.bankInfo?.carPurchase?.price)
bindLong(14, entity.bankInfo?.carPurchase?.tires?.let(kotlinIntKotlinLongAdapter::encode))
bindDouble(15, entity.bankInfo?.money?.let(kotlinFloatKotlinDoubleAdapter::encode))
}
notifyQueries(511551143) { emit ->
emit("UserEntity")
}
} As we can see, primary key columns are not bound at indexes 16 and 17 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem
The generated code uses an incorrect parameters count for
@Insert
@Update
and other similar annotations, it can be reproduced inside the sample, here's an extract fromUserDao
:Solution
Parameters count must be equal to columns count of the entity, in our example, it must be 4
The text was updated successfully, but these errors were encountered: