protected int executeUpdate(UpdateCommand update, Object id) { int r = update.execute(); if(null != ex.handler) { ex.handler.postUpdateProperties(context, id, r); } return r; }
/** * Creates a new {@link UpdateCommand} command for updating an exists record. */ @Instrument public static UpdateCommand cmdUpdate(Object id) { Args.notNull(id,"id"); ModelContext context = context(); return context.getDao().cmdUpdate(context.getEntityMapping()).withId(id); }
@Override public int update(Object entity) throws MappingNotFoundException { Args.notNull(entity,"entity"); EntityMapping em = emForObject(entity); return runInWrapperContext(em, (context)->{ return commandFactory().newUpdateCommand(context.getDao(), context.getEntityMapping()).from(entity).execute(); }); }