Has anyone experienced class attributes that are silently not written to?
I have a super class called:
Now when in my sqlmap file I haveCode:public class BaseSystem { protected String rowid; public void setRowId(String rowId) { this.rowid = rowId; } public String getRowId() { return this.rowId; } } public class Company extends BaseSystem implements Serializable { private String companyName; public void setCompanyName(String name) { this.companyName = name; } public String getCompanyName() { return this.companyName; } }
In my DAO implementation I haveCode:<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd"> <sqlMap namespace="Company"> <insert id="addCompany"> insert into company (rowid, name) values (#rowId#, #companyName#) </insert> </sqlMap>
However when I try to read/write the rowid I always get a null. I can read/write the company name, but the rowid seems to always be null. Is this configuration unsupported? Does my Company object need to explicitly specify the rowid instead of inheriting it from Base??Code:public class SqlMapCompanyDao extends SqlMapClientDaoSupport implements CompanyDao { public void addCompany(Company company) { getSqlMapClientTemplate().insert("addCompany", company); } }
Any help would be appreciated.


Reply With Quote