ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tamilselvan Radha Krishnan" <Tamilselvan.RadhaKrish...@igate.com>
Subject YesNoTypeHandler - create problem in parameterMap
Date Sat, 18 Nov 2006 06:11:38 GMT
Hi,
I'm trying to use the YesNoBooleanTypeHandler conversion between java
boolean to jdbc CHAR (Y or N) vice versa.
I can able to retrieve the boolean values (isDeleted) into my POJO
class.  But when I do select query  using 'isDeleted', then it throws
the below exception:

Can you help me where I'm missing.

inside TestSqlMapDao.getDepartments( boolean isDeleted)...
Exception in thread "main" com.ibatis.dao.client.DaoException: Failed to
queryForList - id [Dept.getDepartmentsDeleted], parameterObject
[com.ge.cf.myaccounts.domain.Department@860d49].  Cause:
com.ibatis.common.jdbc.exception.NestedSQLException:   
--- The error occurred in com/ge/cf/persistence/sqlmapdao/Dept.xml.  
--- The error occurred while applying a parameter map.  
--- Check the Dept.deptParam.  
--- Check the statement (query failed).  
--- Cause: java.sql.SQLException: ORA-00911: invalid character

Caused by: java.sql.SQLException: ORA-00911: invalid character

	at
com.ibatis.dao.client.template.SqlMapDaoTemplate.queryForList(SqlMapDaoT
emplate.java:284)


    <parameterMap id="deptParam" class="deptObj">       
       <parameter   property="isDeleted"
typeHandler="com.ge.cf.persistence.YesNoBooleanTypeHandler"
javaType="boolean"    
                         jdbcType="VARCHAR" nullValue="N" />
    </parameterMap> 

  <resultMap id="deptResult" class="deptObj">
        <result property="llDeptNo" column="DEPTNO"/>
        <result property="deptName" column="DNAME"/>
        <result property="loc" column="LOC"/>
        <result property="sectionId" column="SECTIONID"  nullValue="0"/>
        <result property="isDeleted" column="IS_DELETED"
typeHandler="com.ge.cf.persistence.YesNoBooleanTypeHandler" />
        
    </resultMap>
	
   <select id="getDepartmentsDeleted" resultMap="deptResult"
parameterMap="deptParam">

    SELECT      		
          DEPTNO ,
          DNAME  ,
          LOC    ,
          SECTIONID ,
          IS_DELETED
    FROM DEPT    
    WHERE IS_DELETED = #isDeleted#
    
  </select>

My POJO class
  Public class Department
	private long deptNo;
	private String deptName;
	private String loc;
	private int sectionId;
	private boolean isDeleted;

		Regards,

		Tamil
		


_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Information transmitted by this EMAIL is proprietary to iGATE Group of Companies and is intended
for use only by the individual 
or entity to whom it is addressed and may contain information that is privileged, confidential,
or exempt from disclosure under 
applicable law. If you are not the intended recipient of this EMAIL immediately notify the
sender at iGATE or mailadmin@igate.com 
and delete this EMAIL including any attachments
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Mime
View raw message