ibatis

Ibatis- couldn't get property "weapon" from Null reference

I'm quite new to Ibatis so I might be missing something, but I can't seem to be able to figure out why I'm getting this error. I'm getting this error when I try to save a Person object which has a weapon reference variable. I know the person object isn't null since I validate the object to see if the weapon reference variable isn't nul...

How to add multiple named parameters to the SQL statement?

I would like to write something like this in myBatis (using anotations instead of XML): @Insert("INSERT INTO friendships (user_id, friend_id) VALUES (#{user.id}, {friend.id})") public void insert(User user, User friend); Is this possible? How exactly? (Note, I would like to use Objects of type User for type-safty. I know that using ...

how to get colmn metdata in mybatis

Hi I need to get the list of columns in a table using mybatis/ibatis in java 1.5. ...

Code inside loops does not rollback in Spring Transaction

I'm having the following structure of code in the service class. The problem is in the event of the exception, the transaction only rollback for "insert A()". I'm using spring-ibatis. function save { insert A(); for loop_1() { insert B() insert C() insert D() } for loop_2() { insert E() insert F() --> throws R...

Specify IBatis query timeout

Hi, There is a way to specify IBatis query timeout using oracle jdbc and Java? Thanks ...

Ibatis queryWithRowHandler() still seems to fetch all rows

I'm using Ibatis 2.3.4 and Mysql 5.1.37, with mysql-java-connector 5.1.6 with java 1.6 I have query that returns very many rows from a single table. In order to do this the manual suggests to use queryWithRowHandler(). However when I call this query it internally still seems to fetch all rows (memory goes up very fast before the first h...

Mapping to a Stored Procedure using iBatis issues!

Hi I'm fairly new to ibatis and have to call a stored procedure which I need to pass in the following parameters pi_decision_id int pi_login_id uniqueidentifier pi_search_id uniqueidentifier pi_outcome_name uniqueidentifier pi_decision_log uniqueidentifier pi_test_dataset_id uniqueidentifier pi_is_default bit pi_primary_rule_id int tes...

Elegant way to implement a criteria-based search page in Hibernate

Using Hibernate how would you design and implement a search criteria page (which has multiple editable/selectable fields/drop-downs as search criteria) such that queries shouldn't clutter data accessor code. I mean no query-string concatenation based on conditionals and ultimately all the queries should go in a separate xml file. I've do...

How to use a file-resource instead of a classpath-resource in ibatis sqlMap config?

I'd like to use the same ibatis sqlMapConfig on many modules. Unfortunatly only classpath-resources seems to be allowed in the resource-attribute of my sqlMap: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE sqlMapConfig PUBLIC "-//ibatis.apache.org//DTD SQL Map Config 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-config-2.dtd"&gt; <...

Preventing SQL Injection In Ibatis

Is there anything built into Ibatis that helps prevent SQL Injection attacks? I'm not looking for a list of ways outside of Ibatis to do this, and am just wondering if Ibatis has anything to prevent SQL Injection. ...

Collections of different types inherited from a single object vs a single collection of super object

Hi, Imagine the following scenario. class Shape { // methods of Class Shape } class Circle extends Shape { // methods of Class Shape // methods of Class Circle } class Square extends Shape { // methods of Class Shape // methods of Class Square } class Canvas // This class should a bucket of objects that belong to Sq...

ibatis: improve insert performace

Hi I am using ibatis for my sql insert stmt. In my code i am parsing files line by line from a folder. Each line that matches criteria, need to be inserted into database. Total number of insert in a single run of program can be any where along 200k. SqlSession sess = null; this.sess = sf.openSession(ExecutorType.BATCH, fals...

Why should we stop using Ibatis and start using Hibernate?

Preparing a proposal for my team, I have the obvious ones. Ibatis is retired, no more fixes/enhancements. Hibernate is the de-factor standard. Hibernate has more/better documentation. What would add or take away from the proposal? Thanks ...

Help with SQL syntax

I am not very good with sqls and I am trying to understand an sql statement which I haven't seen before. We're using Oracle and the IBatis framework so this might be specific to one of those. I am not really sure. SELECT .... ,.... ,.... , PKG_LABEL.GET_LABEL_NAME('UOM',T100.CASE_DIM_UOM_CODE) AS caseDimensionsUOM , PKG_LABEL.GET_LAB...

Ibatis+Oracle: How to update a float value

I'm trying to update a float value in oracle database, but the saved value is only the integer part of the float value. I'm using the expression update TABLE SET VALUE = #value:NUMERIC# WHERE ID = #id# The Value is defined as Number(19,4) NULL ...