Ibatis sql question
Hi! I would like to get a parameter in my sql and by that to decide if to use prepend=OR or prepend=AND isNotEqual prepend=here to write the parameter of the query property=maxprice compareValue=0 price BETWEEN #price# AND #maxprice# /isNotEqual How can I do it? - To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org
problem with removing item from a paginated list
Hi! After deleting an item, I thought to delete it from my paginated list like this: yalkutService.deleteProduct(workingItemId); ProductData tmpData; for (int i = 0; i productsList.size(); i++) { tmpData = (ProductData) productsList.get(i); if (String.valueOf(tmpData.getMakat()).equals(workingItemId)) { productsList.remove(i); break; } } } But I get a JSP exception: ERROR [http-8080-Processor24] - Servlet.service() for servlet action threw exception javax.servlet.jsp.JspException: Exception accessing property lastPage for bean products: java.util.ConcurrentModificationException at org.apache.struts.taglib.logic.CompareTagBase.condition(CompareTagBase.java: 189) at org.apache.struts.taglib.logic.NotEqualTag.condition(NotEqualTag.java:46) at org.apache.struts.taglib.logic.ConditionalTagBase.doStartTag(ConditionalTagB ase.j how can I solve it? Thanks! - To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org
Re: problem with removing item from a paginated list
Hi, I dont think you should be removing from the list while iterating at the same time. Create a separate list (deleteProductList) and replace the productList.remove() call with deleteProductList.add(tmpData). After you finish iterating productList iterate over deleteProductList calling the productList.remove() for each entry in there. Thanks Jon
Re: Ibatis sql question
isNotEqual prepend=#parameter# property=maxprice compareValue=1 price BETWEEN #price# AND #maxprice# /isNotEqual isNotEqual prepend=#parameter# property=maxprice compareValue=0 price =#price# OR price=#maxprice# /isNotEqual 2009/7/24 Odelya YomTov ode...@jpost.com Hi! I would like to get a parameter in my sql and by that to decide if to use prepend=OR or prepend=AND isNotEqual prepend=here to write the parameter of the query property=maxprice compareValue=0 price BETWEEN #price# AND #maxprice# /isNotEqual How can I do it? - To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org
RE: Ibatis sql question
isEqual prepend=#parameter# property=maxprice compareValue=0 price =#price# OR price=#maxprice# /isEqual isEqual prepend=#parameter# property=maxprice compareValue=1 price BETWEEN #price# AND #maxprice# /isEqual That's better _ From: Sergey Livanov [mailto:sergey.liva...@gmail.com] Sent: Friday, July 24, 2009 3:32 PM To: user-java@ibatis.apache.org Subject: Re: Ibatis sql question isNotEqual prepend=#parameter# property=maxprice compareValue=1 price BETWEEN #price# AND #maxprice# /isNotEqual isNotEqual prepend=#parameter# property=maxprice compareValue=0 price =#price# OR price=#maxprice# /isNotEqual 2009/7/24 Odelya YomTov ode...@jpost.com Hi! I would like to get a parameter in my sql and by that to decide if to use prepend=OR or prepend=AND isNotEqual prepend=here to write the parameter of the query property=maxprice compareValue=0 price BETWEEN #price# AND #maxprice# /isNotEqual How can I do it? - To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org
RE: problem with removing item from a paginated list
Hi! I tried your advice, but with no solution to my problem.. I problem is when writing the paginated list to the jsp, not in the JAVA code. Thanks! From: Jon Moores [mailto:jonathan.moo...@gmail.com] Sent: Friday, July 24, 2009 1:59 PM To: user-java@ibatis.apache.org Subject: Re: problem with removing item from a paginated list Also on the assumptions thats = your ProductData class implements the equality and hashcode methods = those methods use your 'id' field = You have a ProductData constructor that takes the id field you should simply be able to do: productList.remove(new ProductData(workingItemId)); no need to iterate. Thanks Jon This footnote confirms that this email message has been scanned by PineApp Mail-SeCure for the presence of malicious code, vandals computer viruses.
RE: Ibatis sql question
Sorry. isEqual prepend=and property=maxprice compareValue=1 price BETWEEN #price# AND #maxprice# /isEqual isEqual prepend=and property=maxprice compareValue=0 price =#price# OR price=#maxprice# /isEqual _ From: Sergey Livanov [mailto:sergey.liva...@gmail.com] Sent: Friday, July 24, 2009 3:32 PM To: user-java@ibatis.apache.org Subject: Re: Ibatis sql question isNotEqual prepend=#parameter# property=maxprice compareValue=1 price BETWEEN #price# AND #maxprice# /isNotEqual isNotEqual prepend=#parameter# property=maxprice compareValue=0 price =#price# OR price=#maxprice# /isNotEqual 2009/7/24 Odelya YomTov ode...@jpost.com Hi! I would like to get a parameter in my sql and by that to decide if to use prepend=OR or prepend=AND isNotEqual prepend=here to write the parameter of the query property=maxprice compareValue=0 price BETWEEN #price# AND #maxprice# /isNotEqual How can I do it? - To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org
Re: problem with removing item from a paginated list
Don't use the PaginatedList. It's deprecated. You should just use the queryForList with the max and skip parameters. You get back a basic list. Then you can do what you want with it. If your jsp problem still exists at that point then it is something other than iBATIS. Brandon On Fri, Jul 24, 2009 at 8:03 AM, Odelya YomTov ode...@jpost.com wrote: Hi! I tried your advice, but with no solution to my problem.. I problem is when writing the paginated list to the jsp, not in the JAVA code. Thanks! *From:* Jon Moores [mailto:jonathan.moo...@gmail.com] *Sent:* Friday, July 24, 2009 1:59 PM *To:* user-java@ibatis.apache.org *Subject:* Re: problem with removing item from a paginated list Also on the assumptions thats = your ProductData class implements the equality and hashcode methods = those methods use your 'id' field = You have a ProductData constructor that takes the id field you should simply be able to do: productList.remove(new ProductData(workingItemId)); no need to iterate. Thanks Jon This footnote confirms that this email message has been scanned by PineApp Mail-SeCure for the presence of malicious code, vandals computer viruses.
Re: Questions regd ibatis best practices - need some help here
iBATIS 3 is in development and is not formally released yet. However, I can vouch that it is nearly function complete and pretty stable. You can check it out from Subversion and build it with Maven if you're interested in trying it. Here's the SVN link: http://svn.apache.org/repos/asf/ibatis/trunk/java/ibatis-3/ BTW - there's no published documentation yet - so look to the test cases to see how to use it. Jeff Butler On Fri, Jul 24, 2009 at 12:38 AM, swaroop belurswaroop.be...@gmail.com wrote: Hi Jeff This is really good. This kind of reply will really help us developers to use ibatis in correct way. I was struggling for couple of weeks to use ibatis the right way. Right now i can see the download link for ibatis 2.3.4 . May i know when ibatis 3 can be downloaded. Thanks for your time. -swaroop swaroop belur wrote: Hello all, Is there any pointer/link or document which suggests using certain features over others to achieve the same goal to improve performance for example. 1. Like for instance when executing an update query , we can either specify parameterClass or parameterMap Which one is preferred and why? 2. Related to above - The cost of reflection while marshalling results. eg. For [1] is there any relation to reflection or both are same 3. I was using ibator to generate some code today and observed by default it does NOT generate any paramterMaps Any reason for this. I hope this is the right forum to ask this question.It generates paramterClass where requied and no maps 4. Also is there any disadvantage of using java.util.Map for providing parameters instead of a Java Bean. Again any demerits over using bean? 5. Last - I am new and learning ibatis - is there any Best Practice FAQ . I did search for best practices in this forum - but was not convinced i found answers to my questions. I am trying to understand how much better from both developing and performance point will Spring-Ibatis integration be better than Spring-JDBC integration Really appreciate any response. Thanks sbelur -- View this message in context: http://www.nabble.com/Questions-regd-ibatis-best-practices---need-some-help-here-tp24606061p24638908.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
Inserting Japanese characters in database using ibatis
HiHas anyone noticed issue with inserting japanese characters in database using ibatis, i am having some issues here, i have debugged my program and found that the class which is passed to ibatis as input parameter has correct japanese characters, but in database they are not, Is there any special setup for inserting non english characters in ibatis? Ash
RE: Questions regd ibatis best practices - need some help here
Jeff, If Map parameter will be deprecated, how we can run stored procedures in 3x version ? -Original Message- From: Jeff Butler [mailto:jeffgbut...@gmail.com] Sent: Friday, July 24, 2009 7:05 PM To: user-java@ibatis.apache.org Subject: Re: Questions regd ibatis best practices - need some help here iBATIS 3 is in development and is not formally released yet. However, I can vouch that it is nearly function complete and pretty stable. You can check it out from Subversion and build it with Maven if you're interested in trying it. Here's the SVN link: http://svn.apache.org/repos/asf/ibatis/trunk/java/ibatis-3/ BTW - there's no published documentation yet - so look to the test cases to see how to use it. Jeff Butler On Fri, Jul 24, 2009 at 12:38 AM, swaroop belurswaroop.be...@gmail.com wrote: Hi Jeff This is really good. This kind of reply will really help us developers to use ibatis in correct way. I was struggling for couple of weeks to use ibatis the right way. Right now i can see the download link for ibatis 2.3.4 . May i know when ibatis 3 can be downloaded. Thanks for your time. -swaroop swaroop belur wrote: Hello all, Is there any pointer/link or document which suggests using certain features over others to achieve the same goal to improve performance for example. 1. Like for instance when executing an update query , we can either specify parameterClass or parameterMap Which one is preferred and why? 2. Related to above - The cost of reflection while marshalling results. eg. For [1] is there any relation to reflection or both are same 3. I was using ibator to generate some code today and observed by default it does NOT generate any paramterMaps Any reason for this. I hope this is the right forum to ask this question.It generates paramterClass where requied and no maps 4. Also is there any disadvantage of using java.util.Map for providing parameters instead of a Java Bean. Again any demerits over using bean? 5. Last - I am new and learning ibatis - is there any Best Practice FAQ . I did search for best practices in this forum - but was not convinced i found answers to my questions. I am trying to understand how much better from both developing and performance point will Spring-Ibatis integration be better than Spring-JDBC integration Really appreciate any response. Thanks sbelur -- View this message in context: http://www.nabble.com/Questions-regd-ibatis-best-practices---need-some-help- here-tp24606061p24638908.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 - To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org
Re: Questions regd ibatis best practices - need some help here
You don't need a parameter map for procedures in iBATIS2. This is from the developers guide, page 30: procedure id=“callProcedure” parameterClass=”com.mydomain.MyParameter” {call MyProcedure (#parm1,jdbcType=INTEGER,mode=IN#, #parm2,jdbcType=INTEGER,mode=IN#, #parm3,jdbcType=DECIMAL,mode=OUT,numericScale=2#)} /procedure Similar in iBATIS3. Jeff Butler 2009/7/24 Andrey Rogov konu...@gmail.com: Jeff, If Map parameter will be deprecated, how we can run stored procedures in 3x version ? -Original Message- From: Jeff Butler [mailto:jeffgbut...@gmail.com] Sent: Friday, July 24, 2009 7:05 PM To: user-java@ibatis.apache.org Subject: Re: Questions regd ibatis best practices - need some help here iBATIS 3 is in development and is not formally released yet. However, I can vouch that it is nearly function complete and pretty stable. You can check it out from Subversion and build it with Maven if you're interested in trying it. Here's the SVN link: http://svn.apache.org/repos/asf/ibatis/trunk/java/ibatis-3/ BTW - there's no published documentation yet - so look to the test cases to see how to use it. Jeff Butler On Fri, Jul 24, 2009 at 12:38 AM, swaroop belurswaroop.be...@gmail.com wrote: Hi Jeff This is really good. This kind of reply will really help us developers to use ibatis in correct way. I was struggling for couple of weeks to use ibatis the right way. Right now i can see the download link for ibatis 2.3.4 . May i know when ibatis 3 can be downloaded. Thanks for your time. -swaroop swaroop belur wrote: Hello all, Is there any pointer/link or document which suggests using certain features over others to achieve the same goal to improve performance for example. 1. Like for instance when executing an update query , we can either specify parameterClass or parameterMap Which one is preferred and why? 2. Related to above - The cost of reflection while marshalling results. eg. For [1] is there any relation to reflection or both are same 3. I was using ibator to generate some code today and observed by default it does NOT generate any paramterMaps Any reason for this. I hope this is the right forum to ask this question.It generates paramterClass where requied and no maps 4. Also is there any disadvantage of using java.util.Map for providing parameters instead of a Java Bean. Again any demerits over using bean? 5. Last - I am new and learning ibatis - is there any Best Practice FAQ . I did search for best practices in this forum - but was not convinced i found answers to my questions. I am trying to understand how much better from both developing and performance point will Spring-Ibatis integration be better than Spring-JDBC integration Really appreciate any response. Thanks sbelur -- View this message in context: http://www.nabble.com/Questions-regd-ibatis-best-practices---need-some-help- here-tp24606061p24638908.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 - 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
Pagination by objects
Hello, I am using in one of my projects ibatis and have a problem with pagination. For example I want to select 100 objects at a time and skip first 100 of them. I didn't find any good way of doing it and nothing exciting about scrolling too. Any suggestion how to achieve/solve my problem? Thanks John -- View this message in context: http://www.nabble.com/Pagination-by-objects-tp24652955p24652955.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
Re: Pagination by objects
You could start with the documentation...or even just your IDE code completion... :-) Look up the queryForList method signatures.. Clinton On Fri, Jul 24, 2009 at 4:39 PM, John Seer pulsph...@yahoo.com wrote: Hello, I am using in one of my projects ibatis and have a problem with pagination. For example I want to select 100 objects at a time and skip first 100 of them. I didn't find any good way of doing it and nothing exciting about scrolling too. Any suggestion how to achieve/solve my problem? Thanks John -- View this message in context: http://www.nabble.com/Pagination-by-objects-tp24652955p24652955.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
Re: Inserting Japanese characters in database using ibatis
Ibatis is most likely not the problem. The database needs to be configured to accept unicode characters. What database are you using? On Fri, Jul 24, 2009 at 12:22 PM, Ashish Kulkarni ashish.kulkarn...@gmail.com wrote: HiHas anyone noticed issue with inserting japanese characters in database using ibatis, i am having some issues here, i have debugged my program and found that the class which is passed to ibatis as input parameter has correct japanese characters, but in database they are not, Is there any special setup for inserting non english characters in ibatis? Ash