public
class WebContact implements Serializable {private String id;
public
String getId() { return id;}
public void setId(String id) { this.id = id;}
}
Despues tengo el xml de WebContacts.xml
<
resultMap id="contactSector" class="webContact"> <result property="email_adress" column="email_adress"/> <result property="comments_from_contact" column="comments_from_contact"/> <result property="sector_id" column="sector_id"/> <result property="email_sector" column="email_sector"/> <result property="id" column="id"/> </resultMap><
select id="getDatosMails" resultMap = "contactSector" resultClass = "ar.com.nextel.webcontacts.pojos.WebContact" parameterClass="java.lang.String">SELECT web_contacts.email_adress, web_contacts.comments_from_contact,
web_contacts.sector_id,
sectores_web_contacts.email_sector
FROM web_contacts, sectores_web_contacts
WHERE web_contacts.id = #id:VARCHAR# AND sectores_web_contacts.id = web_contacts.sector_id;
</select>
Y ademas en el clase WebContactsSqlMapDao.java
public
class WebContactsSqlMapDao extends BaseSqlMapDao implements WebContactsDao{public
WebContact getDatosMails(String id) throws WebContactsException {WebContact contacto =
null; try{contacto = (WebContact)
this.queryForObject("getDatosMails", id); logger.debug("El contacto fue obtenido.");}
catch(Exception e){ logger.error("Error al intentar obtener el contacto con id " + id); logger.error("Stack Trace: ", e); throw new WebContactsException(e);}
return contacto;}
}
No se lo que estoy haciendo mal que me esta tirando un error:
Stack Trace:
com.ibatis.dao.client.DaoException
: Failed to execute queryForObject - id [getDatosMails], parameterObject [206359]. Cause: com.ibatis.common.jdbc.exception.NestedSQLException:--- The error occurred in ar/com/nextel/webcontacts/dao/persistance/sqlmapdao/sql/WebContacts.xml.
--- The error occurred while applying a parameter map.
--- Check the getDatosMails-InlineParameterMap.
--- Check the statement (query failed).
--- Cause:
java.sql.SQLException: ORA-00911: invalid characterCaused by:
java.sql.SQLException: ORA-00911: invalid characterCaused by:
com.ibatis.common.jdbc.exception.NestedSQLException:--- The error occurred in ar/com/nextel/webcontacts/dao/persistance/sqlmapdao/sql/WebContacts.xml.
--- The error occurred while applying a parameter map.
--- Check the getDatosMails-InlineParameterMap.
--- Check the statement (query failed).
--- Cause:
java.sql.SQLException: ORA-00911: invalid character
SELECT web_contacts.email_adress, web_contacts.comments_from_contact,
web_contacts.sector_id,
sectores_web_contacts.email_sector
FROM web_contacts, sectores_web_contacts
WHERE web_contacts.id = #id:VARCHAR# AND sectores_web_contacts.id = web_contacts.sector_id;
--
www.JavaSOS.com
Grupo de colaboración Java/J2ee para desarrolladores de habla hispana.