예제 #1
0
 /**
  * 将Map对象插入数据库
  *
  * @throws AttributeException
  * @throws InvokeException
  * @throws SQLException
  * @throws DbPropertyException
  */
 public Integer insert()
     throws InvokeException, AttributeException, DbPropertyException, SQLException {
   List<String> keyList = this.getKeys();
   Map<String, Object> valueMap = super.getMap();
   for (String str : keyList) {
     if (super.getMap().get(str) == null) {
       super.getMap().put(str, StringUtil.getUUID());
     }
   }
   BuildSql buildSql = new BuildSql();
   String tableName = getMapTableName();
   buildSql.setValueMap(getMapValuesMap());
   buildSql.setTableName(tableName);
   buildSql.BuildInsertSql();
   DbCon db = new DbCon();
   return db.updateSql(buildSql);
 }