JPetStore 5.0(iBATIS for java)ÖÐItem.xmlµÄbug
Caused by: java.sql.SQLException: ORA-00918: column ambiguously defined
Caused by: 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: ORA-00918: column ambiguously defined
change com\ibatis\jpetstore\persistence\sqlmapdao\sql\Item.xml to
ºìɫΪÐ޸ĺóµÄ£º
<select id="getItem" resultClass="item" parameterClass="string" cacheModel="quantityCache">
select
I.ITEMID,
I.LISTPRICE,
I.UNITCOST,
I.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#
</select>
Ïà¹ØÎĵµ£º
public class yzzSerialize
{
private yzzSerialize()
{ }
private static yzzCache cache = new yzzCache();
public static T GetfromXml<T>(string xmlpath, T t)
{
using (FileStream fs = new FileStream(xmlpath, FileMode.Open, FileAcces ......
ÎÊ£º
²âÊÔÐÂÊÖ£¬¸ù¾Ý×Ô¼ºÀí½âдµÄµ¥Ôª²âÊÔÓÃÀýÄ£°å£¬µ«ÊÇ¿ª·¢ÈËÔ±(JAVAÓïÑÔ)·´Ó³ÄÑÒÔʵʩ£¬²»ÖªµÀµ½µ×Ó¦¸ÃÈçºÎ¸ÄÕý£¬ÎÒÔ±¾µÄÏë·¨ÊÇÒÔÀàΪµ¥Î»£¬ÎªÈ·±£²âÊÔ¸²¸ÇÂÊ£¬ÏÈ»¿ØÖÆÁ÷ͼ£¬ÒÀ¾Ý¶ÀÁ¢Â·¾¶È·¶¨ÊäÈëÊä³ö£¬ÓÐÁËÊäÈëÊä³ö¾ÍËãÒ»¸öÓÃÀýÁË£¬µ«´ó¼Ò·´Ó³£¬Ò»ÀàΪµ¥Î»»¿ØÖÆÁ÷ͼ²»ºÃ»£¬ÀàÖпÉÄÜÉæ¼°ºÜ¶àº¯Ê ......
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
public class ConvertMapToList {
/**
* ʵÏÖ½«HashMapת»»³ÉΪArrayList£¬²¢½«mapµÄKey ¡¢Value·Ö± ......
javaÖеÄ×Ö·û´®Ò²ÊÇÒ»Á¬´®µÄ×Ö·û¡£µ«ÊÇÓëÐí¶àÆäËûµÄ¼ÆËã»úÓïÑÔ½«×Ö·û´®×÷Ϊ×Ö·ûÊý×é´¦Àí²»Í¬£¬Java½«×Ö·û´®×÷ΪStringÀàÐͶÔÏóÀ´´¦Àí¡£½«×Ö·û´®×÷ΪÄÚÖõĶÔÏó´¦ÀíÔÊÐíJavaÌṩʮ·Ö·á¸»µÄ¹¦ÄÜÌØÐÔÒÔ·½±ã´¦Àí×Ö·û´®¡£ÏÂÃæÊÇһЩʹÓÃƵÂʱȽϸߵĺ¯Êý¼°ÆäÏà¹Ø˵Ã÷¡£
substring()
ËüÓÐÁ½ÖÖÐÎʽ£¬µÚÒ»ÖÖÊÇ£ºString  ......