Question on dynamic prepend and using multiple properties

2005-05-17 Thread Narasimha Prasad








Here is a problem that I am facing.



My parameter class has two counts, say countA and countB and
I need to use these in a HAVING clause in the sql query. Both
the values could be empty.

For eg. if they both have values, the query would look like:



Select .

--- from

where.

HAVING ( countA  5 and count B  10 )



I tried using nested dynamic clause, but looks like it is
not supported. 

dynamic prepend=HAVING

(


isNotEmpty
property=countA

 count
 #countA#

 /isNotEmpty 

 

 dynamic prepend=AND


isNotEmpty
property=countB

 count 
#countB#

 /isNotEmpty 

 /dynamic

)

/dynamic



Is there any other approach to solve this problem, other
than going thru and checking every combination of countA and countB ? Any
help/suggestion is appreciated





Thanks,

Prasad










--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.11.9 - Release Date: 5/12/2005
 


Question on parameter class

2005-04-28 Thread Narasimha Prasad








I have a parameter class which looks like



Class A

{

 String j 

 String k

 

 Instance of Class B

}







Class B

{

 String x

 String y

}





Is this supported by Ibatis ? Can I use it in the SQL
map as shown below ?



select id=selectQuery parameterClass=A

 SELECT 

 ---

 ---

 FROM 

 --

 --

 WHERE



 isNotEmpty prepend=AND property=B.x

 do something

 /isNotEmpty

isNotEmpty prepend=AND property=B.y

 do something

 /isNotEmpty



/select





Thanks,

Prasad












--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.10.3 - Release Date: 4/25/2005
 


Question about nested transactions.

2005-03-24 Thread Narasimha Prasad
Is nested transaction supported? I have a method call within a transaction
and the method in turn starts another transaction.

Example:

try
{
  startTransaction
  code.
  method(); 
 
  commitTransaction
}
finally {
  endTransaciton
}

--
public method()
{
  try
  {
startTransaction
code.. 
commitTransaction
  }
  finally 
  {
endTransaciton
  }  
}



Thanks,
Prasad
 
DBO2 Inc
650-587-0106

-Original Message-
From: Mark Alcocer Flores [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 18, 2005 9:18 AM
To: ibatis-user-java@incubator.apache.org
Subject: Question about transactions.

I have a problem. I recently upgraded from the 1.2
iBatis version to the new 2.0 iBatis version. Because
of the database I connect to, I controled transactions
manually. I use the startTransaction method to start
the transaction and commitTransaction to commit it. If
anything went wrong I used the rollbackTransaction to
leave the database in a consistent state. In this new
version os iBatis the rollbackTransaction method is
not public and instead, the endTransaction method must
be use, actually I call it always in a finally
statement. 

The thing is that when there is an error in the
database, in the old way, the connection close with
not problems and everything was alrigth, but with the
new way, the state of the database is inconsistent
sometimes and the connection remains open.

Can anyone give me an idea of what can I do? I think i
could go back to the old version, but this new version
has so many good features that i wouldn't want to
leave  them.

Thanks in advance.

Mark.

The Greatest Thing You'll Ever Learn
It's Just To Love And Be Loved In Return


-- 
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.7.3 - Release Date: 3/15/2005
 

-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.8.1 - Release Date: 3/23/2005
 



How to escape special characters (specifically '#')

2005-03-10 Thread Narasimha Prasad








Hi 



Is there a way to escape the # characters used
in iBATIS SQL maps ? The reason is ask this is that we are running into a
situation where we need to create

Temporary tables to read from, and
they use the # character. I tried enclosing the statement with ![CDATA[ . ]], but this
works only to escape special

XML characters.





Example:

--

BEGIN 

 CREATE TABLE #tempCount (id INT NOT NULL, count INT)

 

 INSERT INTO #tempCount

 (id, count)

 VALUES

 (1,2)

 SELECT * FROM #tempCount

 DROP TABLE #tempCount



END







Any suggestions welcome.



Thanks,

Prasad












--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.7.1 - Release Date: 3/9/2005
 


RE: How to escape special characters (specifically '#')

2005-03-10 Thread Narasimha Prasad
That did the trick ! 

Thanks,
Prasad
-Original Message-
From: Ron Grabowski [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 10, 2005 12:57 PM
To: ibatis-user-java@incubator.apache.org
Subject: Re: How to escape special characters (specifically '#')

Have you tried using two pound signs?

 INSERT INTO ##tempCount
 
--- Narasimha Prasad [EMAIL PROTECTED] wrote:
 Hi 
 
  
 
 Is there a way to escape the # characters used in iBATIS SQL maps ?
 The
 reason is ask this is that we are running into a situation where we
 need to
 create
 
 Temporary tables to read from, and they use the # character.  I tried
 enclosing the statement with ![CDATA[ . ]], but this works only to
 escape
 special
 
 XML characters.
 
  
 
  
 
 Example:
 


 --
 
 BEGIN 
 
   CREATE TABLE #tempCount (id INT NOT NULL, count INT)
 
   
 
   INSERT INTO #tempCount
 
   (id, count)
 
   VALUES
 
   (1,2)
 
   SELECT * FROM #tempCount
 
   DROP TABLE #tempCount
 
 END
 
  
 
  
 
 Any suggestions welcome.
 
  
 
 Thanks,
 
 Prasad

-- 
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.7.1 - Release Date: 3/9/2005
 

-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.7.1 - Release Date: 3/9/2005