Yeah wrapping the class may be your only alternative. Should be easy and you only need to override the problematic methods.
Cheers, Nathan On 9/13/06, Salman Khattak <[EMAIL PROTECTED]> wrote:
Thanks Daniel and Nathan. Nathan: The mutators are the problem as they have the same underscore convention :( Daniel: Since I am extending the class with the non-conventional methods, I guess your suggestion works for now. My class will follow the java bean convention and have setters and getters in the same vein. Later refactoring might be necessary. Salman Khattak Daniel Pitts wrote: > > Even if they don't follow the spec, here is a work around: > Create a object wrapper that DOES follow the spec, and it just delegates > to the legacy object. > > If you can, however, I would refactor it to be more appropriate for > modern coding practices. > > -----Original Message----- > From: Nathan Maves [mailto:[EMAIL PROTECTED] > Sent: Wednesday, September 13, 2006 1:25 PM > To: [email protected] > Subject: Re: underscore in java bean property > > What do the mutator methods look like? > > If they follow the bean spec then you should be fine. > > On 9/13/06, Salman Khattak <[EMAIL PROTECTED]> wrote: >> >> Strangely enough some legacy code here has underscore in property >> names like ministry_Code. IBatis mapping does not like this. Any help >> would be appreciated. >> >> This is the stack trace: >> >> >> org.springframework.jdbc.UncategorizedSQLException: SqlMapClient >> operation; uncategorized SQLException for SQL []; SQL state [null]; >> error code [0]; >> --- The error occurred in com.xxxxxx/dao/ibatis/maps/Oxxxxing.xml. >> --- The error occurred while applying a result map. >> --- Check the Oxxxxing.minimalResultMap. >> --- The error happened while setting a property on the result object. >> --- Cause: com.ibatis.common.exception.NestedRuntimeException: Error >> setting properties of '[EMAIL PROTECTED]'. > Cause: >> java.lang.NullPointerException >> Caused by: java.lang.NullPointerException; nested exception is >> com.ibatis.common.jdbc.exception.NestedSQLException: >> --- The error occurred in com.xxxxxx/dao/ibatis/maps/Oxxxxing.xml. >> --- The error occurred while applying a result map. >> --- Check the Oxxxxing.minimalResultMap. >> --- The error happened while setting a property on the result object. >> --- Cause: com.ibatis.common.exception.NestedRuntimeException: Error >> setting properties of '[EMAIL PROTECTED]'. > Cause: >> java.lang.NullPointerException >> Caused by: java.lang.NullPointerException Caused by: >> com.ibatis.common.exception.NestedRuntimeException: Error setting >> properties of '[EMAIL PROTECTED]'. Cause: >> java.lang.NullPointerException >> Caused by: java.lang.NullPointerException Caused by: >> com.ibatis.common.jdbc.exception.NestedSQLException: >> --- The error occurred in com.xxxxxx/dao/ibatis/maps/Oxxxxing.xml. >> --- The error occurred while applying a result map. >> --- Check the Oxxxxing.minimalResultMap. >> --- The error happened while setting a property on the result object. >> --- Cause: com.ibatis.common.exception.NestedRuntimeException: Error >> setting properties of '[EMAIL PROTECTED]'. > Cause: >> java.lang.NullPointerException >> Caused by: java.lang.NullPointerException Caused by: >> com.ibatis.common.exception.NestedRuntimeException: Error setting >> properties of '[EMAIL PROTECTED]'. Cause: >> java.lang.NullPointerException >> Caused by: java.lang.NullPointerException >> at >> > com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQuery > WithCallback(GeneralStatement.java:188) >> at >> > com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQuery > ForList(GeneralStatement.java:123) >> at >> > com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMap > ExecutorDelegate.java:610) >> at >> > com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMap > ExecutorDelegate.java:584) >> at >> > com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessi > onImpl.java:101) >> at >> > org.springframework.orm.ibatis.SqlMapClientTemplate$3.doInSqlMapClient(S > qlMapClientTemplate.java:255) >> at >> > org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClient > Template.java:188) >> at >> > org.springframework.orm.ibatis.SqlMapClientTemplate.executeWithListResul > t(SqlMapClientTemplate.java:214) >> at >> > org.springframework.orm.ibatis.SqlMapClientTemplate.queryForList(SqlMapC > lientTemplate.java:253) >> at >> > com.xxxxxx.dao.ibatis.event.SqlMapOxxxxingDAO.getOxxxxingListByCriteria( > SqlMapOxxxxingDAO.java:43) >> at >> > com.xxxxxx.bo.event.EventBOImpl.getOxxxxingListByCriteria(EventBOImpl.ja > va:58) >> at >> > com.xxxxxx.lis.actions.ManageOxxxxingsAction.search(ManageOxxxxingsActio > n.java:177) >> at >> > com.xxxxxx.lis.actions.ManageOxxxxingsAction.doSecureAction(ManageOxxxxi > ngsAction.java:42) >> at >> > com.xxxxxx.lis.cecal.actions.SecureLoginAction.doPerform(SecureLoginActi > on.java:111) >> at > com.xxxxxx.lis.cecal.actions.BaseAction.doExecute(BaseAction.java:63) >> at >> > com.xxxxxx.web.struts.XxxxxxAction.doNonTransaction(XxxxxxAction.java:20 > 3) >> at > com.xxxxxx.web.struts.XxxxxxAction.doExecute(XxxxxxAction.java:113) >> at >> > com.xxxxxx.web.struts.BaseXxxxxxAction.execute(BaseXxxxxxAction.java:120 > ) >> at >> > org.apache.struts.action.RequestProcessor.processActionPerform(RequestPr > ocessor.java:431) >> at >> > org.apache.struts.action.RequestProcessor.process(RequestProcessor.java: > 236) >> at > org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) >> at > org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432) >> at > javax.servlet.http.HttpServlet.service(HttpServlet.java:763) >> at > javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code)) >> at >> com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper. >> java(Compiled >> Code)) >> at >> com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper. >> java(Compiled >> Code)) >> at >> com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilter >> Chain.java(Compiled >> Code)) >> at org.ajaxanywhere.AAFilter.doFilter(AAFilter.java:46) >> at >> > com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInst > anceWrapper.java:142) >> at >> com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilter >> Chain.java(Compiled >> Code)) >> at >> > org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFi > lter.java:125) >> at >> > com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInst > anceWrapper.java:142) >> at >> com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilter >> Chain.java(Compiled >> Code)) >> at >> com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilte >> rChain.java(Compiled >> Code)) >> at >> com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWr >> apper.java(Compiled >> Code)) >> at >> > com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheS > ervletWrapper.java:80) >> at >> > com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:180 > 2) >> at >> > com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:8 > 4) >> at >> > com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscriminatio > n(HttpInboundLink.java:469) >> at >> > com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformatio > n(HttpInboundLink.java:408) >> at >> > com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpIC > LReadCallback.java:101) >> at >> > com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueMa > nager.java:566) >> at >> com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManage >> r.java(Compiled >> Code)) >> at >> > com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager. > java:952) >> at >> > com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager > .java:1039) >> at >> com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code)) >> >> -- >> View this message in context: >> http://www.nabble.com/underscore-in-java-bean-property-tf2267661.html# >> a6293413 Sent from the iBATIS - User - Java forum at Nabble.com. >> >> > > -- View this message in context: http://www.nabble.com/underscore-in-java-bean-property-tf2267661.html#a6298315 Sent from the iBATIS - User - Java forum at Nabble.com.
