@Override public int executeUpdate() { return cmd.executeUpdate(this,null); }
@Override public int executeUpdate(SqlCommand command, Object bean) { return command.executeUpdate(simpleSqlContext, bean); }
protected int executeUpdate(){ return sqlCommand.executeUpdate(this, params); } }
@Override public int executeUpdate(Params params) { return cmd.executeUpdate(this, params); }
public int executeUpdate(SqlCommand command, Object[] args) { return command.executeUpdate(simpleSqlContext, args); }
public int executeUpdate(SqlCommand command, Map params) { return command.executeUpdate(simpleSqlContext, params); }
/** * Executes update and returns the affected rows. * * @throws IllegalStateException if this command is not an update command. * @throws NestedSQLException if a {@link SQLException} thrown. * * @see PreparedStatement#executeUpdate() */ default int executeUpdate(SqlContext context,@Nullable Object params) throws IllegalStateException, NestedSQLException { return executeUpdate(context, params, null); }
@Override public int executeUpdate(Map<String, Object> map) { return cmd.executeUpdate(this, params(map)); }
@Override public int executeUpdate(Object[] args) { return cmd.executeUpdate(this, params(args)); }
@Override public int executeNamedUpdate(String sqlKey, Map<String, Object> params) { return ensureGetSqlCommand(sqlKey).executeUpdate(simpleSqlContext, params); }
protected int doExecuteDelete() { if(em.hasSecondaryTable()) { context.getSqlFactory().createDeleteCommand(context, em, true).executeUpdate(this, idParameter); } return primaryCommand.executeUpdate(this, idParameter); }
@Override public int execute() { if(em.hasSecondaryTable()) { context.getSqlFactory().createDeleteAllCommand(context, em, true).executeUpdate(this, null); } return primaryCommand.executeUpdate(this,null); }
@Override public int executeNamedUpdate(String sqlKey, Object bean) { return ensureGetSqlCommand(sqlKey).executeUpdate(simpleSqlContext, Beans.toMap(bean)); }
@Override public int executeNamedUpdate(String sqlKey, Object[] args) { return ensureGetSqlCommand(sqlKey).executeUpdate(simpleSqlContext, new ArrayParams(args)); }
protected int doExecuteUpdate() { String[] fields = entity.getFieldNames().toArray(Arrays2.EMPTY_STRING_ARRAY); SqlCommand primaryCommand = sf.createInsertCommand(context, em, fields); SqlCommand secondaryCommand = em.hasSecondaryTable() ? sf.createInsertCommand(context, em, fields, true) : null; //Resolve statement handler. PreparedStatementHandler<Db> handler = null; if(null != em.getInsertInterceptor()){ handler = em.getInsertInterceptor().getPreparedStatementHandler(this); } //Creates map for saving. Map<String,Object> map = entity.toMap(); if(null != values) { map.putAll(values); } //Prepared id and serialization prepareIdAndSerialization(id, map); //Executes int result = primaryCommand.executeUpdate(this, map, handler); if(null != secondaryCommand) { secondaryCommand.executeUpdate(this, withGeneratedId(map)); } return result; }
result = primaryCommand.executeUpdate(this, map); result = secondaryCommand.executeUpdate(this, map); }else if(result > 0){ secondaryCommand.executeUpdate(this, map);