We'd like to use only annotations with MyBatis; we're really trying to avoid xml. We're trying to use an "IN" clause:
@Select("SELECT * FROM blog WHERE id IN (#{ids})")
List<Blog> selectBlogs(int[] ids);
MyBatis doesn't seem able to pick out the array of ints and put those into the resulting query. It seems to "fail softly" and we ...
Hi,
I have the following sql statement that I need to make quicker.
There are 500k rows, and I an index for 'HARDWARE_ID', but this still take up to a second to perform.
Does anyone have any ideas?
select
*
from
DEVICE_MONITOR DM
where
DM.DM_ID = (
select
max(DM_ID)
...
Hi,
I have created a table in MSSQL having following structure -
**Table Name - TestTable**
id (int) (Primary key)
name (varchar)
owner (varchar)
I have given Identity specification for column 'id' with auto increment with 1 for each new row. When I created iBatis artifacts for TestTable, the insert function is getting generated, in...
In recent times, a particular page in my web app throws the Exception Details: MySql.Data.MySqlClient.MySqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
Though I use Ibtais as persistence layer, this error occurs. I have restarted the MySql service instanc...
Hi!
While using JDBC, we can work with oracle ref cursors using CallableStatement. Can I have such functionality using iBatis?
...
My sql string looks like this. And What I'd like to do is change it into a format ibatis can use
SELECT distinct( dbo.vwChangeMgmt1.number )
FROM dbo.vwChangeMgmt1, dbo.vwChangeMgmtTask1
WHERE dbo.vwChangeMgmt1.Asgn_Group != 'WTO-AMS-NOVUS' and
dbo.vwChangeMgmtTask1.Resource_group = 'WTO-AMS-NOVUS' and
dbo.vwChang...
I am trying to come up with a manageable way to handle exceptions in a DAO. Typically a method in my DAO looks like this:
public ArrayList fetchColors (String id)
{
//call iBatis SqlMapClient
//put results in a list
//return list
}
If an error happens in the above code then everything is written to server.log and on the f...
Hi all,
I was troubleshooting the following code and was unable to find an answer, so I figured I would document my solution.
The problem was:
<iterate property="twoDimArray" prepend="and (" close=")" conjunction="or">
<iterate property="twoDimArray[]" open="(" close=")" conjunction="and">
$twoDimArray[][].columnName$ = #twoDimArray[]...
I've got following java class.
package com.org.data.dbresource;
import org.springframework.orm.ibatis.SqlMapClientTemplate;
public class DBConnectionManager {
private SqlMapClientTemplate sqlMapClientTemplate;
public void setSqlMapClientTemplate (SqlMapClientTemplate sq)
{
this.sqlMapClientTemplate = sq;
} ...
Hi Guys,
I've got a sql fragments defined in a particular namespace like:
<sqlMap namespace="firstNamespace">
.....
<sql id="fragmentOne">
and then from another namespace I'm trying to use it, but seems that IBatis is not able to find it.
Could not find SQL statement to include with refid 'firstNamespace.fragmentOne'
Now ...
How to Iterate List in Ibatis.
query is:
delete from table where (column1='tes10' and column2='NET1' and column3='ENG1') OR
(column1='TEST22' and column2='NET2' and column3='ENG2') OR
(column1='TEST21' and column2='NET3' and column3='ENG3').
I put column values in map and then i wil...
Hey,
I'm working with third party user data that may or may not fit into our database. The data needs to be truncated if it is too long.
We are using IBatis with Connector/J. If the data is too long a SQL exception is thrown. I have had two choices: either truncate the strings in Java or truncate the strings in sql using substring.
I...
Hi Guys;
I have a large chat application in the build process and i'm confused about how to solve this issue ..
i need to show the online status of 10 users on a page at a given time for which i'm using a database query and every time someone visits the page the query is executed and returns the user who are online ... problem is the on...
iBatis comes with three schema files that provide intellisense to VS.Net.
According to the iBatis help docs, the location should be this:
C:\Program Files\Microsoft Visual Studio 10.0\Common7\Packages\schemas\xml
or this if you have x64 installed:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Packages\schemas\xml
The...
hi;
I'm using ibatis and its cache model for the first time and i cant seem to figure out at what time will the cache be filled with new results, meaning whne will the query that i'm applying cache model on be executed again to fill the cache with new results.
Does it require some sort of command to get the results again or will it be d...
0 down vote favorite
hi;
I'm using ibatis and its cache model for the first time and i cant seem to figure out at what time will the cache be filled with new results, meaning whne will the query that i'm applying cache model on be executed again to fill the cache with new results. Does it require some sort of command to get the resul...
I have select query that fetch record based on a condition
Select * from Employee where EmpStatus=#EmpStatus#
The EmpStatus in the DB for each employee would either 0 or 1.
EmpID EmpName EmpStatus
***********************
1 Name1 0
2 Name2 0
3 Name4 1
4 Name5 1
When I pass EmpStatus as 1, I should get list co...
Hi,
I want to use an inline query in an annotated mapper which gets two parameters.
Can I do that? I see in debug that it tries to pass the same parameter twice.
I've added the @Param to each parameter of the inline query method but I don't know how to reference the two parameters from the parent query because the column property can ge...
Hi,
I am using Spring,ibatis. I have configured following in xml file
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName"><value>${driverClassName}</value></property>
<property name="url"><value>${url}</value></property>
<property name="u...
We are building a fairly database centric web application. We initially started off using iBatis.
At one point we thought iBatis may not be very useful for the following reasons:
1. Need for the appl. code to determine if we need to insert/update/delete from DB
2. Appl. code will deviate from being object oriented to being database ori...