---
title: "ibatis  命名空间"
author: "qinya06"
date: "2011-01-04T19:46:27Z"
tags: ["DAO", "Java", "XML", "iBATIS"]
categories: ["数据库"]
slug: "ibatis"
draft: false
lastmod: "2011-01-04T19:47:09Z"
id: 859010
url: "https://qinya.iteye.com/blog/859010"
---

\[code="xml"] //必须 ....... \[/code] ------------------------------------------ \[code="java"]public class dao extends SqlMapClientDaoSupport{ public List getAllCorp(String nameSpace) throws Exception { SqlMapClientTemplate sqlMap = getSqlMapClientTemplate(); List list=null; if(nameSpace==null||"".equals(nameSpace.trim())) list=sqlMap.queryForList("getAllCorp"); else list=sqlMap.queryForList(nameSpace+".getAllCorp"); return list; } }\[/code]