You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Mike Wilson <mw...@yahoo.com> on 2006/03/27 20:46:20 UTC

JPetStore - Using billState property in Cart.java

Hello, 
 
In the Cart.java I'm trying to grab the users' billState value (in Order.java) so I can use it as a qualifier for which tax rate is applied.
 
I am trying to set the account.billState value in Order.java that I can use in the Cart.java. This is so I can calc different tax rates based on different states and display the result on the checkout pages. However, it doesn't seem like I can do this. I've tried several things besides this, adding a reference to account.billState in the Cart.java or adding an initCart method and grabbing the account.billState that way (like the initOrder in Order.java). Seems like unless I hard code a value in my totalTax method in Cart.java, I get a null pointer exception. Hope this makes sense and someone can help. 
 
Thanks in advance,
MW
		
---------------------------------
New Yahoo! Messenger with Voice. Call regular phones from your PC for low, low rates.

Re: JPetStore - Using billState property in Cart.java

Posted by Sven Boden <li...@pandora.be>.
If I understand you correctly, this has been discussed before. It's 
because of "nesting statements". Hard to explain, but you use 1 query to 
fill in a bean in order to run a query to fill in another bean, and that 
doesn't work. I'm sure someone else can give a better explanation for it.
If I recall correctly the solution is to use a second instance of the 
SqlMapClient.

Else show us the simplest form of what you want to do... preferably 
using hsql, but Oracle will also do ;-)

Regards,
Sven

Mike Wilson wrote:

>Hello, 
> 
>In the Cart.java I'm trying to grab the users' billState value (in Order.java) so I can use it as a qualifier for which tax rate is applied.
> 
>I am trying to set the account.billState value in Order.java that I can use in the Cart.java. This is so I can calc different tax rates based on different states and display the result on the checkout pages. However, it doesn't seem like I can do this. I've tried several things besides this, adding a reference to account.billState in the Cart.java or adding an initCart method and grabbing the account.billState that way (like the initOrder in Order.java). Seems like unless I hard code a value in my totalTax method in Cart.java, I get a null pointer exception. Hope this makes sense and someone can help. 
> 
>Thanks in advance,
>MW
>		
>---------------------------------
>New Yahoo! Messenger with Voice. Call regular phones from your PC for low, low rates.
>  
>


Re: JPetStore - Using billState property in Cart.java

Posted by Clinton Begin <cl...@gmail.com>.
Just a quick question:

What are you doing with JPetStore?  The reason I ask is that as a moderator
of the forum, I can't let the iBATIS user list be bothered with JPetStore
customization questions....

We'll support JPetStore as an example for iBATIS, but we won't support it if
you're trying to modify it for your own use and I'll have to ask that such
questions be taken to some other forum.

Please correct me if I'm misunderstanding the conversations from the last
few days.

Thanks,
Clinton Begin


On 3/27/06, Mike Wilson <mw9378@yahoo.com > wrote:
>
> Hello,
>
> In the Cart.java I'm trying to grab the users' billState value (in
> Order.java) so I can use it as a qualifier for which tax rate is applied.
>
> I am trying to set the account.billState value in Order.java that I can
> use in the Cart.java. This is so I can calc different tax rates based on
> different states and display the result on the checkout pages. However, it
> doesn't seem like I can do this. I've tried several things besides this,
> adding a reference to account.billState in the Cart.java or adding an
> initCart method and grabbing the account.billState that way (like the
> initOrder in Order.java). Seems like unless I hard code a value in my
> totalTax method in Cart.java, I get a null pointer exception. Hope this
> makes sense and someone can help.
>
> Thanks in advance,
> MW
>
> ------------------------------
> New Yahoo! Messenger with Voice.
> <http://us.rd.yahoo.com/mail_us/taglines/postman4/*http://us.rd.yahoo.com/evt=39666/*http://beta.messenger.yahoo.com>Call regular phones from your PC for low, low rates.
>
>