@Override
	public TableModel getTableFieldMap(String table) {
		TableModel tm = new TableModel();
		Connection conn = null;
		try {
			conn = ConnectionManager.getConnection();
			Statement stmt = conn.createStatement();
			ResultSet res = stmt.executeQuery("desc "+table);
			List<FieldModel> fields = new ArrayList<FieldModel>(0);
			List<FieldModel> primtives = new ArrayList<FieldModel>(0);
			while(res.next()){
				//保存字段信息
				FieldModel fm = new FieldModel(res.getString("Field"), 
												BeanUtil.toMethodName(res.getString("Field")),
												BeanUtil.toClassName(res.getString("Field")),
												res.getString("Type"), 
												"PRI".equals(res.getString("Key")), 
												"auto_increment".equals(res.getString("Extra")),
												"MUL".equals(res.getString("Key")),
												res.getObject("Default"),
												"YES".equals(res.getString("Null")));
				//主键
				if("PRI".equals(res.getString("Key"))){
					primtives.add(fm);
				}
				//自增字段
				if("auto_increment".equals(res.getString("Extra"))){
					tm.setHasFieldAutoIncrease(true);
					tm.setFieldAutoIncrease(res.getString("Field"));
					tm.setPrimeAutoIncreaseType(BeanUtil.toJavaType(res.getString("Type")));
				}
				fields.add(fm);
			}
			//表名称
			tm.setName(table);
			//映射实体类名称
			tm.setToClassName(BeanUtil.toClassName(table));
			//银蛇实体实例名称
			tm.setToEntityName(BeanUtil.toClassInstanceName(table));
			//字段集合
			tm.setFields(fields);
			//主键集合
			tm.setPrimtives(primtives);
			
		} catch (SQLException e) {
			e.printStackTrace();
		} finally{
			try {
				if(null != conn) conn.close();
			} catch (SQLException e) {
				e.printStackTrace();
			}
		}
		return tm;
	}