public Object[] getParams() { Object[] params = new Object[entityMeta.columnLength()]; List<Column> columns = entityMeta.getNormalColumns(); int i = 0; for (Column column : columns) { params[i] = EntityMetaManager.getValueByColumn(entityMeta, data, column); i++; } params[i] = EntityMetaManager.getIdValue(entityMeta, data); return params; }
private String getSql() { String table = entityMeta.getTable().name(); StringBuilder sql = new StringBuilder(UPDATE) .append(table) .append(SET) .append(values()) .append(WHERE) .append(EntityMetaManager.getIdName(entityMeta)) .append("=?"); return sql.toString(); }