Bulk update selected properties with record based custom data

24 views
Skip to first unread message

Gökhan Abatay

unread,
Sep 16, 2019, 5:25:21 AM9/16/19
to nhusers
Hi,
We have a Customer entity which has 100 properties/columns. At some business, some set of columns need to be updated with customer based custom data.
Think about that we have a fund batch and this batch create funds and updates Customer with latest fund amount "LastFundAmount".

Customer No  Last Fund Amount   Last Fund Date
100                   333                         20190916
101                   342                         20190916
102                   404.3                      20190916
103                   500                         20190916

We don't want to update Customer all properties which may create unnecessary index rebuild on db site, we need to update just changed data, but we don't want to use dynamic update.

IQuery query = ISession.CreateQuery(Update Customer Set LastFundAmount = :LastFundAmount, LastFundDate = :LastFundDate where CustomerNo = :CustomerNo);

Above hql IQuery api does not have method that we can send list of object? 
Also Batcher makes some database specific thinks for bulk insert/update so, this hql needs to be send batcher with some "ExecuteUpdateBulk()" method.

Our application runs with 3 customer with 3 different database:Oracle, SQLServer, PostgresSql 


 
Reply all
Reply to author
Forward
0 new messages