Skip to content
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

Upsert with bulk entities does not work #898

Open
pardeep632 opened this issue Sep 16, 2019 · 0 comments
Open

Upsert with bulk entities does not work #898

pardeep632 opened this issue Sep 16, 2019 · 0 comments
Labels

Comments

@pardeep632
Copy link

pardeep632 commented Sep 16, 2019

fun insertDriverToMasterTable(driverList: ArrayList<Driver>) { val entities = ArrayList<Driver_MasterEntity>() driverList.forEach { driver -> val entity = Driver_MasterEntity() entity.vehicleId = driver.trucknumber entity.driverId = driver.DRIVERID entity.driverName = driver.NAME entity.driverInactive = driver.driverinactive ?: false entity.trainingAttended = driver.TRAINING ?: false entity.mobile = driver.mobile entity.driverHomeCountry = driver.land1 entity.licenseNo = driver.licnecenum entities.add(entity) } try { val array = arrayOfNulls<Driver_MasterEntity>(entities.size) data.upsert(entities.toArray(array)) } catch (e: StatementExecutionException) { log.e("Exception while upserting to Driver Master table") } }

It throws following exception:

io.requery.meta.NotMappedException: No mapping for [Lcom.organization.api.ms.database.tables.Driver_MasterEntity;
at io.requery.meta.ImmutableEntityModel.typeOf(ImmutableEntityModel.java:52) ~[requery-1.6.0.jar:?]
at io.requery.sql.EntityDataStore$DataContext.proxyOf(EntityDataStore.java:610) ~[requery-1.6.0.jar:?]
at io.requery.sql.EntityDataStore.upsert(EntityDataStore.java:280) ~[requery-1.6.0.jar:?]
at io.requery.sql.KotlinEntityDataStore.upsert(KotlinEntityDataStore.kt:129) ~[requery-kotlin-1.6.0.jar:?]

@npurushe npurushe added the bug label Jan 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants