ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Gill <ben.g...@ocado.com>
Subject Mapping Problem
Date Fri, 04 Feb 2005 11:57:08 GMT
Hi,

I am new to iBatis and am getting a mapping error that I cannot sort out, I
wonder if someone can help me?

My sql map:

sqlMap namespace="OffenceSQL">

    <typeAlias alias="offence"
type="com.ocado.tracker.offences.forms.OffenceForm"/>
    
	<insert id="addOffence" parameterClass="offence">
		<selectKey resultClass="offence" keyProperty="id" >
			SELECT OFFENCES_SEQ.NEXTVAL AS ID FROM DUAL
		</selectKey>

        insert into 
        OFFENCES (OFFENCE_UUID, STATUS, AUTHORITY, TICKET_NUMBER, 
		  OFFENCE, 
		  EMPLOYEE_UUID, DATETIME_OF_OFFENCE, DATETIME_OF_TICKET, 
		  SITE, FLEET_UUID, LOC_OF_OFFENCE, POSTCODE, FINE,
ORDER_NUMBER,
		  ROUTE_ID, ENTERED_BY, ASSIGNED_TO, LAST_MODIFIED_BY,
LAST_MODIFIED, 
		  CREATION_DATE) 
	values (#id#, 'new', #authority#, #ticketNumber#, #offence#,
		#employeeID#, to_date(#dateOfOffence#,'dd/mm/YYYY HH24:mi'),
		to_date(#dateOfTicket#,'dd/mm/YYYY HH24:mi'),
		#site#, #fleetID#, #locOfOffence#, #postcode#, #fine#,
		#orderNumber#, #routeID#, #enteredBy#, #assignedTo#,
sysdate, sysdate);
    </insert>
    
</sqlMap>

and my form:

public class OffenceForm extends CommonForm 
{
	private String id;

public String getId() 
	{
		return id;
	}
	public void setId(String id)
	{
		this.id=id;
	}
}

Error:

org.springframework.jdbc.UncategorizedSQLException: (SqlMapClient
operation): en
countered SQLException [
--- The error occurred in com/ocado/tracker/offences/dao/sql/OffenceSQL.xml.
--- The error occurred while applying a parameter map.
--- Check the addOffence-InlineParameterMap.
--- Check the parameter mapping for the 'id' property.
--- Cause: java.sql.SQLException: Invalid column type]; nested exception is
com.
ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/ocado/tracker/offences/dao/sql/OffenceSQL.xml.
--- The error occurred while applying a parameter map.
--- Check the addOffence-InlineParameterMap.
--- Check the parameter mapping for the 'id' property.
--- Cause: java.sql.SQLException: Invalid column type
com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/ocado/tracker/offences/dao/sql/OffenceSQL.xml.
--- The error occurred while applying a parameter map.
--- Check the addOffence-InlineParameterMap.
--- Check the parameter mapping for the 'id' property.
--- Cause: java.sql.SQLException: Invalid column type
Caused by: java.sql.SQLException: Invalid column type
        at
com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeUp
date(GeneralStatement.java:86)
        at
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.update(SqlMapExe
cutorDelegate.java:500)
        at
com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.update(SqlMapSessionI
mpl.java:89)
        at
org.springframework.orm.ibatis.SqlMapClientTemplate$10.doInSqlMapClie
nt(SqlMapClientTemplate.java:282)
        at
org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapCli
entTemplate.java:144)
        at
org.springframework.orm.ibatis.SqlMapClientTemplate.update(SqlMapClie
ntTemplate.java:280)

This message has been checked for all known viruses by the MessageLabs Virus Control Centre.

	
*********************************************************************

Notice:  This email is confidential and may contain copyright material of Ocado Limited (the
"Company"). Opinions and views expressed in this message may not necessarily reflect the opinions
and views of the Company.
If you are not the intended recipient, please notify us immediately and delete all copies
of this message. Please note that it is your responsibility to scan this message for viruses.

Company reg. no. 3875000.
Ocado Limited
Titan Court
3 Bishops Square
Hatfield Business Park
Hatfield
Herts
AL10 9NE


*********************************************************************

Mime
View raw message