RE: Select count(*) in a resultMap

2006-01-27 Thread Michael Laccetti
Thanks Ted, I switched it over to select ... from dual, and it worked quite nicely. I shall have to remember this for the future. Mike -Original Message- From: Ted Schrader [mailto:[EMAIL PROTECTED] Sent: January 27, 2006 4:11 PM To: user-java@ibatis.apache.org Subject: Re: Select coun

Getting object access to resultMap definitions

2006-01-27 Thread Eric Blue
Hi, Does anybody know if it's possible to get information about a given result map without parsing the XML configuration?  What I want to be able to do is get the property to column mapping based on the class name.  I essentially want to do validation and transformation of a pseudo-query language

Re: iBATIS objects getting into POJOs

2006-01-27 Thread Ben Munat
Note that the dynamic proxies used in that byte-code manipulation are also not serializable, so you can get NotSerializableExceptions on shutdown of the container. I turned off lazy-loading because of that. This whole issue is kind of a drag. I don't really see when I'll ever be able to use laz

RE: Incorrrect syntax near '@PO'

2006-01-27 Thread Om Narayan
Thank you. That's what I needed. From: "Niels Beekman" <[EMAIL PROTECTED]> Reply-To: user-java@ibatis.apache.org To: Subject: RE: Incorrrect syntax near '@PO' Date: Fri, 27 Jan 2006 10:36:22 +0100 Parameters are not supported by the kill-command, use kill $value$, this causes iBATIS to use t

Re: reset jdbc connection

2006-01-27 Thread Scott Zhu
It was a sqlserver database. So I think it's the "Test Reserved Connections" in weblogic to test the connection periodically, and it's not set by default. Anyone knows what's the equivalent in Websphere, and is it being set by default? Thanks. On 1/27/06, Sven Boden <[EMAIL PROTECTED]> wrote: It l

Re: Select count(*) in a resultMap

2006-01-27 Thread Ted Schrader
Hi Michael, You've got two options that I can think of off the top of my head. A. You execute each query separately, then cobble the results together "manually" in your Java code to build an instance of "ChannelCount". B. You craft a single query, assuming you have a master table for the chann

RE: Select count(*) in a resultMap

2006-01-27 Thread Michael Laccetti
Forgot about that bit. Thanks. Based on that, I've come up with this: SELECT COUNT(*) as pendingCount FROM scrimbot_pending_channels WHERE channel=#value# SELECT COUNT(*) as existingCount, channel FROM scrimbot_channels WHERE channel=#value# GROUP BY

Re: iBATIS objects getting into POJOs

2006-01-27 Thread Joe Wolf
Yes, I disabled lazy loading (I didn't know it was on by default) and it stopped behaving this way. I guess in order to support lazy loading, iBATIS does some byte code manipulation. Thanks. -Joe On January 27, 2006, Larry Meadors wrote: > Looks like an issue with lazy loading..can you try

RE: Select count(*) in a resultMap

2006-01-27 Thread Fullam, Jonathan, ALABS
You can use "value" as the alias if you want to map the count to an Integer or String resultClass. select count(*) as value from SOME_TABLE -Original Message- From: Ted Schrader [mailto:[EMAIL PROTECTED] Sent: Friday, January 27, 2006 3:10 PM To: user-java@ibatis.apache.org Subject: Re:

Re: Select count(*) in a resultMap

2006-01-27 Thread Ted Schrader
Hi Michael, Try giving the resulting column an alias: SELECT COUNT(*) AS MY_TOTAL FROM TABLE. Then, use "MY_TOTAL" in your result map configuration. Ted On 27/01/06, Michael Laccetti <[EMAIL PROTECTED]> wrote: > > > > Is it possible to do a 'select count(*) from table' and then reference that

Select count(*) in a resultMap

2006-01-27 Thread Michael Laccetti
Is it possible to do a ‘select count(*) from table’ and then reference that value in a result map?  I’ve been searching around and trying to get it to work to no avail.   Mike

Re: iBATIS objects getting into POJOs

2006-01-27 Thread Larry Meadors
Looks like an issue with lazy loading..can you try it without and see if it fixes the issue? Larry On 1/27/06, Joe Wolf <[EMAIL PROTECTED]> wrote: > > Here's some new insight into this problem. Look at how two objects of mine > get serialized by XStream: > > > true >

Re: iBATIS objects getting into POJOs

2006-01-27 Thread Joe Wolf
Here's some new insight into this problem. Look at how two objects of mine get serialized by XStream: true true It appears as IBATIS isn't creating instances of static inner classes like I would expcet. For referen

RE: reset jdbc connection

2006-01-27 Thread Sven Boden
It looks a bit like http://forums.bea.com/bea/message.jspa?messageID=200019770&tstart=0 Which database are using... sybase by any chance? Regards, Sven Brent Ryan wrote: I don't believe this is an iBatis problem since you're letting your application server manage your transaction. Your app

RE: reset jdbc connection

2006-01-27 Thread Brent Ryan
I don't believe this is an iBatis problem since you're letting your application server manage your transaction.  Your application server needs to validate the connections before handing them over so I'd check there.   Brent From: Scott Zhu [mailto:[EMAIL PROTECTED] Sent: Friday, January 27

Re: TypeHandler for java primitive

2006-01-27 Thread Larry Meadors
Messier than mapping a null value to a variable that cannot contain null values? I have to disagree. Larry On 1/27/06, Toshiaki Takashima <[EMAIL PROTECTED]> wrote: > hi, > > > Why not just use Integer? > > > I think it is a little bit messy > to calculate the numeric property > when you use In

iBATIS objects getting into POJOs

2006-01-27 Thread Joe Wolf
I have a fairly interesting problem involving iBATIS 2.1.5 and XStream 1.1.2. I have some POJOs that get created by iBATIS when I run some queries. I then serialize them to XML through XStream--however, I'm getting a StackOverflowError when doing so. Through debugging, I found that XStream i

reset jdbc connection

2006-01-27 Thread Scott Zhu
   I'm using weblogic 8.1 in this case and transaction is managed by the application server. Here's my configuration for the sql map:               If I shutdown the database and bring it back, then click on some links that requires database access, I'd get the following exception s

Re: TypeHandler for java primitive

2006-01-27 Thread Toshiaki Takashima
hi, > Why not just use Integer? I think it is a little bit messy to calculate the numeric property when you use Integer because you have to use Integer.intValue method. Don't you think so? > Why not just use Integer? > > Larry > > > On 1/27/06, Toshiaki Takashima <[EMAIL PROTECTED]>

Re: TypeHandler for java primitive

2006-01-27 Thread Larry Meadors
Why not just use Integer? Larry On 1/27/06, Toshiaki Takashima <[EMAIL PROTECTED]> wrote: > Hi, > > > > You know, when you set resultClass properties to java primitive type > such as "int", NullPointerException occures if its corresponding Table > Column value is null. > > You can suppress tho

TypeHandler for java primitive

2006-01-27 Thread Toshiaki Takashima
Hi, You know, when you set resultClass properties to java primitive type such as "int", NullPointerException occures if its corresponding Table Column value is null. You can suppress those Exception by setting "nullValue" property to each column in SQL Map xml. But, it is very messy work. S

Re: Dynamic sql statement

2006-01-27 Thread Brandon Goodin
...And actually, I'm not even certain the removeFirstPrepend="true" attribute is necessary in the isNotEmpty tag for the area property. You may want to test it with and without that attribute. Also, be sure you can see what the sql statement that is being generated by setting up logging. This alway

Re: Dynamic sql statement

2006-01-27 Thread Brandon Goodin
Building on Yusuf's suggestions... Something like the following should work: select * from cto.personinfovo id=#id# area in ('SC','EC','CC','NC','NE','SW','NW')

RE: Incorrrect syntax near '@PO'

2006-01-27 Thread Niels Beekman
Parameters are not supported by the kill-command, use kill $value$, this causes iBATIS to use the parameter directly. From: Om Narayan [mailto:[EMAIL PROTECTED] Sent: donderdag 26 januari 2006 22:34 To: user-java@ibatis.apache.org Subject: Incorrrect synt

Re: Dynamic sql statement

2006-01-27 Thread stevenlou
Dear Yusuf,   Thanks for your warm-hearted reply.   Sorry I miss the case 1, it should be:  "select * from cto.personinfovo where id=#id# and area=#area# "   So I think your statement isn't working too.   Have a nice weekend.   Thanks and Best Regards Steven   On 1/27/06, Yusuf <[EMAIL PROTECTED]>