java.lang.ArrayIndexOutOfBoundsException: 17

項目框架 SpringMVC+Hibernate
java

開發工具 Myeclipse10git

報錯代碼(下圖):框架

檢查項目發現出現問題的緣由:配置文件有問題,少配置了一個字段,下面紅色註釋部分。eclipse

<fields>工具

a.id,a.title,a.author,a.content,a.source,a.createDate,a.releaseDate,(select name from BDic b where b.id=a.audit),(select name from BDic b where b.id=a.release),a.status,(select name from BDic b where b.id=a.type),b.id,c.id,d.id,a.newType,a.contentPicture,a.targetUrl,a.kind開發工具

</fields>spa

配置上缺乏的字段,再次運行OK。code

如下爲部分完整代碼段:ip

<query>
			<id>getList</id>
			<method>getList</method>
			<params>
				<param name="condition" type="java.util.Map"></param>
				<param name="sort" type="java.lang.String"></param>
			</params>
			<properties>id,title,author,content,source,createDate,releaseDate,audit,release,status,type,topic.id,channel.id,conference.id,newType,contentPicture,targetUrl,kind
			</properties>
			<fields>a.id,a.title,a.author,a.content,a.source,a.createDate,a.releaseDate,(select name from BDic b where b.id=a.audit),(select name from BDic b where b.id=a.release),a.status,(select name from BDic b where b.id=a.type),b.id,c.id,d.id,a.newType,a.contentPicture,a.targetUrl,a.kind
			</fields>
			<hql>from News a left join a.topic b left join a.channel c left
				join a.conference d
			</hql>
			<conditions>

				<condition id="id" describe="id">
					<params type="param">
						<param name="id" type="java.lang.String"></param>
					</params>
					<hql>a.id = ?</hql>
				</condition>

				<condition id="title" describe="">
					<params type="param">
						<param name="title" type="java.lang.String" />
					</params>
					<hql>a.title like ?</hql>
				</condition>

				<condition id="author" describe="">
					<params type="param">
						<param name="author" type="java.lang.String" />
					</params>
					<hql>a.author like ? </hql>
				</condition>

	           <condition id="source" describe="">
					<params type="param">
						<param name="source" type="java.lang.String" />
					</params>
					<hql>a.source like ? </hql>
				</condition>
				
				<condition id="audit" describe="">
					<params type="param">
						<param name="audit" type="java.lang.String" />
					</params>
					<hql>a.audit like ? </hql>
				</condition>
				
			</conditions>
			<group></group>
			<order></order>
			<className>cn.digitalpublishing.po.News</className>
		</query>
相關文章
相關標籤/搜索