Jeff Butler wrote:
OK - we need to see the SQL map (just the update) and the two Java classes. Hopefully they are not too big :)

I'm afraid they are :-/ And to make matters worse, all the indentifiers are in 
Portuguese.
I can write some minimal code that reproduces the problem and send it to the 
list.

But, I was thinking... maybe the problem is not the inheritance. In fact, all 
the getters in this class are inherited. What is different about this getter in 
particular is that its return type in the superinterface is generic:

public interface BaseDomain<PK extends Serializable>
{
   public PK getCodigo();
}

("codigo"(pt) == "code"(en)).

Thiago

Jeff Butler

On Wed, May 14, 2008 at 3:46 PM, Thiago F. G. Albuquerque <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:

    Version 2.3.0.677.

    Jeff Butler wrote:

        What version of iBATIS are you using?  I have tests with this
        exect scenario working now.
         Jeff Butler

        On Wed, May 14, 2008 at 2:40 PM, Thiago F. G. Albuquerque
        <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
        <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>> wrote:

           Hi,

           When I have a inherited getter in the domain object and the
           corresponding attribute appears in an inline parameter map, I
        get a
           NullPointerException:

           Caused by:
        com.ibatis.common.jdbc.exception.NestedSQLException:      ---
        The error occurred in Evento.abator.sqlmap.xml.  --- The error
           occurred while applying a parameter map.  --- Check the
           Evento.abatorgenerated_updateByPrimaryKey-InlineParameterMap.
         ---
           Check the parameter mapping for the 'codigo' property.  ---
        Cause:
           java.lang.NullPointerException
                  at
com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeUpdate(GeneralStatement.java:94)
                  at
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.update(SqlMapExecutorDelegate.java:505)
                  at
com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.update(SqlMapSessionImpl.java:90)
                  at
org.springframework.orm.ibatis.SqlMapClientTemplate$10.doInSqlMapClient(SqlMapClientTemplate.java:384)
                  at
org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:194)
                  ... 56 more
           Caused by: java.lang.NullPointerException
                  at
com.ibatis.sqlmap.engine.mapping.parameter.BasicParameterMap.setParameter(BasicParameterMap.java:165)
                  at
com.ibatis.sqlmap.engine.mapping.parameter.BasicParameterMap.setParameters(BasicParameterMap.java:125)
                  at
com.ibatis.sqlmap.engine.execution.SqlExecutor.executeUpdate(SqlExecutor.java:79)
                  at
com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.sqlExecuteUpdate(GeneralStatement.java:200)
                  at
com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeUpdate(GeneralStatement.java:78)
                  ... 60 more

           Here is BasicParameterMap.java:165:

             // Set Parameter
             TypeHandler typeHandler = mapping.getTypeHandler();
             if (value != null) {
           =>    typeHandler.setParameter(ps, i + 1, value,
           mapping.getJdbcTypeName()); // <= typeHandler == null !
             } else if (typeHandler instanceof CustomTypeHandler) {
               typeHandler.setParameter(ps, i + 1, value,
           mapping.getJdbcTypeName());
             } else {

           When I overwrite the getter in the subclass, the error
        disappears.
           Maybe iBatis can't get the return type of inherited methods
        and, as
           a result, can't resolve the type handler?

           Regards,
           Thiago





Reply via email to