Hello Estevão, Thanks for your suggestion. I'm afraid that you will currently need to maintain two separate lists, e.g.
List<People> people = ... List<People> removed = new ArrayList<>(); removed.add(people.remove(people.size() - 1)); ctx.batchStore(people).execute(); ctx.batchDelete(removed).execute(); I wonder if a batchMerge() could be implemented. The question, however, would be how to identify those records that should be removed...? Cheers Lukas 2014-04-15 19:26 GMT+02:00 Estevão Góes <[email protected]>: > Hi all, > I recently discovered the DSLContext.batchStore method that can save or > update records from a list direct to database. This is fabulous. Great code. > But I'm just wondering how I can handle removed records from list. Should > I maintain a complementary list of removed records, or did I code something > wrong? > > This is my code: > > List<Person> people = DSLContext.fetch(Tables.Person); > people.remove(people.size() - 1); //it removes last person > DSLContext.batchStore(people).execute(); //it doesn't work, the record is > not deleted. > > > -- > You received this message because you are subscribed to the Google Groups > "jOOQ User Group" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "jOOQ User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
