ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sven Boden <list...@pandora.be>
Subject Re: JPetstore question
Date Thu, 23 Mar 2006 21:36:31 GMT
I changed it a couple of weeks ago in SVN ;-) ... you will find some 
e-mails on it in the archives.

Regards,
Sven

Larry Meadors wrote:

>In SVN, it looks right..is this the SQL there?
>
>---
>    select
>
>      I.ITEMID,
>
>      LISTPRICE,
>
>      UNITCOST,
>
>      SUPPLIER AS supplierId,
>
>      I.PRODUCTID AS "product.productId",
>
>      NAME AS "product.name",
>
>      DESCN AS "product.description",
>
>      CATEGORY AS "product.categoryId",
>
>      STATUS,
>
>      ATTR1 AS attribute1,
>
>      ATTR2 AS attribute2,
>
>      ATTR3 AS attribute3,
>
>      ATTR4 AS attribute4,
>
>      ATTR5 AS attribute5,
>
>      QTY AS quantity
>
>    from ITEM I, INVENTORY V, PRODUCT P
>
>    where P.PRODUCTID = I.PRODUCTID
>
>      and I.ITEMID = V.ITEMID
>
>      and I.ITEMID = #value#
>---
>
>Larry
>
>
>PS: please reply to the list, so others can benefit from the discussion.
>
>
>On 3/23/06, Bruce Wexler <bwexler@massconnections.com> wrote:
>  
>
>>Hi again Larry,
>>
>>I know I'm probably pushing my luck, but I got past the last error, and now have this:
>>
>>Caused by: com.ibatis.dao.client.DaoException: Failed to execute queryForObject -
id [getItem], parameterObject [EST-16].  Cause: com.ibatis.common.jdbc.exception.NestedSQLException:
>>--- The error occurred in com/ibatis/jpetstore/persistence/sqlmapdao/sql/Item.xml.
>>--- The error occurred while applying a parameter map.
>>--- Check the getItem-InlineParameterMap.
>>--- Check the statement (query failed).
>>--- Cause: java.sql.SQLException: [DataDirect][SQLServer JDBC Driver][SQLServer]Ambiguous
column name 'itemid'.
>>Caused by: java.sql.SQLException: [DataDirect][SQLServer JDBC Driver][SQLServer]Ambiguous
column name 'itemid'.
>>Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:
>>
>>Thanks,
>>Bruce
>>
>>-----Original Message-----
>>From: larry.meadors@gmail.com [mailto:larry.meadors@gmail.com]On Behalf
>>Of Larry Meadors
>>Sent: Thursday, March 23, 2006 1:05 PM
>>To: Bruce Wexler; user-java@ibatis.apache.org
>>Subject: Re: JPetstore question
>>
>>
>>I am replying to the list Bruce, in case others have the same problem
>>later, then they can google and get it.
>>
>>My guess is that the user connecting to the database does not see the
>>product table in the default schema. You may need to either connect as
>>another user, or qualify the table name.
>>
>>Larry
>>
>>
>>On 3/23/06, Bruce Wexler <bwexler@massconnections.com> wrote:
>>    
>>
>>>Hi again Larry,
>>>
>>>OK, got past that, got another one for you:
>>>
>>>--- The error occurred in com/ibatis/jpetstore/persistence/sqlmapdao/sql/Product.xml.
>>>--- The error occurred while applying a parameter map.
>>>--- Check the getProductListByCategory-InlineParameterMap.
>>>--- Check the statement (query failed).
>>>--- Cause: java.sql.SQLException: [DataDirect][SQLServer JDBC Driver][SQLServer]Invalid
object name 'PRODUCT'.
>>>Caused by: java.sql.SQLException: [DataDirect][SQLServer JDBC Driver][SQLServer]Invalid
object name 'PRODUCT'.
>>>        at com.ibatis.dao.client.template.SqlMapDaoTemplate.queryForPaginatedList(SqlMapDaoTemplate.java:274)
>>>        at com.ibatis.jpetstore.persistence.sqlmapdao.ProductSqlMapDao.getProductListByCategory(ProductSqlMapDao.java:19)
>>>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>>        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>        at java.lang.reflect.Method.invoke(Method.java:324)
>>>        at com.ibatis.dao.engine.impl.DaoProxy.invoke(DaoProxy.java:72)
>>>        at $Proxy4.getProductListByCategory(Unknown Source)
>>>        at com.ibatis.jpetstore.service.CatalogService.getProductListByCategory(CatalogService.java:47)
>>>        at com.ibatis.jpetstore.presentation.CatalogBean.viewCategory(CatalogBean.java:126)
>>>        ... 44 more
>>>
>>>The exception says to Check the getProductListByCategory-InlineParameterMap, but
I'm not sure from looking through the docs what I'm missing. Can you tell from this snippet
what I'm missing? Or could you point me to a resource that will explain this?
>>>
>>>  <select id="getProductListByCategory" resultClass="product" parameterClass="string"
cacheModel="productCache">
>>>    SELECT
>>>      PRODUCTID,
>>>      NAME,
>>>      DESCN as description,
>>>      CATEGORY as categoryId
>>>    FROM PRODUCT
>>>    WHERE CATEGORY = #value#
>>>  </select>
>>>
>>>Thanks,
>>>Bruce
>>>
>>>
>>>      
>>>
>
>
>  
>


Mime
View raw message