Why dont you perform the parameter checking in you Java method ? I guess that the definition of the query is not the right place to manage when throwing Java exceptions
2010/6/3 laredotornado <laredotorn...@gmail.com>: > > Hi, > > We're using iBatis 2.3 with Tomcat 6.0.26 (Java 1.6). We have many queries > where we pass in parameters (e.g. "#company_id#"), similar to > > <select id="getNightlifeDetailsForHotels" > resultMap="SearchResultSQLMaps.searchResultNightlifeMap" > parameterClass="java.util.Map"> > SELECT vw_attractions_and_activities.* FROM > vw_attractions_and_activities WHERE (propertyid = #company_id#) and > (subcategoryid = 7) ORDER BY name > </select> > > I was wondering if there is a way to get ibatis to throw an exception if not > all the parameters are filled in. Right now, it just substitutes a "null" > for parameters that are not included. > > Here is an example Java method we use to invoke a query ... > > public static Object queryForObject(String newStmtId, Object > inputParams) > throws SQLException { > if (inputParams.getClass() == HashMap.class || > inputParams.getClass() == > Hashtable.class) > inputParams = preProcessParameters((Map) inputParams); > return getSqlMapHandle().queryForObject(newStmtId, > inputParams); > } > > Thanks, - Dave > -- > View this message in context: > http://old.nabble.com/Possible-to-get-ibatis-to-throw-an-exception-if-not-all-params-are-filled-in--tp28773130p28773130.html > Sent from the iBATIS - User - Java mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org > For additional commands, e-mail: user-java-h...@ibatis.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org