-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: Could not execute query:invalide column!!?~
PostPosted: Tue Jul 20, 2004 10:25 pm 
Newbie

Joined: Tue Jul 20, 2004 10:10 pm
Posts: 4
i dont know why ? when i use hibernate query other tables as "from Book as book " i can get the result, but when i use this table:goods include 54 columns, i can get nothing but errors list below.

however when i change my sql as below, it do work. anybody can tell me why?


queryString = new StringBuffer("select goods.pkid "+
// " , goods.goodsNO, goods.goodsName," +
//" goods.color, goods.hostNO, goods.selfCode, goods.codeUnitNO," +
//" goods.codeUnitName, goods.codeHighTypeNO, goods.codeHighTypeName, " +
//" goods.codeCategoryNO, goods.codeCategoryName, goods.codeBrandNO, goods.codeBrandName," +
//" goods.codeSpecNO, goods.codeSpecName, goods.typeNO, goods.typeName, goods.unitWeight," +
//" goods.weight, goods.innerVolum, goods.bottomArea, goods.goodsLength, "+
//" goods.goodsWidth, goods.goodsHeight, goods.outerWeight, goods.outerVolum,"+
//" goods.outerLength, goods.outerWidth, goods.outerHeight," +
//" goods.tubingWeight, goods.tubingLength, goods.tubingWidth," +
//" goods.tubingHeight, goods.barQuantity, goods.barPosition, " +
//" goods.barcode, goods.codePackageNO, goods.shape, goods.ucode, " +
//" goods.keepterm, goods.containerNum, goods.gradeNO, goods.safeStockMin, " +
//" goods.safeStockMax, goods.codeTypeNO, goods.superGoodsNO, goods.amount,"+
//" goods.disabledDate, goods.status, goods.remark, goods.userNO, "+
//"goods.maintainDate, goods.recordType "+
//" from Goods as goods ");


===============================
here is the error message below:

From DAOHibernateAdapter:queryString.toString()=from Goods as goods

Hibernate: select goods.PKID as PKID, goods.GOODSNO as GOODSNO, goods.GOODSNAME as GOODSNAME, goods.COLOR as COLOR, goods.HOSTNO as HOSTNO, goods.SELFCODE as SELFCODE, goods.CODE_UNITNO as CODE_UNI7_, goods.CODE_UNITNAME as CODE_UNI8_, goods.CODE_HIGHTYPENO as CODE_HIG9_, goods.CODE_HIGHTYPENAME as CODE_HI10_, goods.CODE_CATEGORYNO as CODE_CA11_, goods.CODE_CATEGORYNAME as CODE_CA12_, goods.BRANDNO as BRANDNO, goods.BRANDNAME as BRANDNAME, goods.SPECNO as SPECNO, goods.SPECNAME as SPECNAME, goods.TYPENO as TYPENO, goods.TYPENAME as TYPENAME, goods.UNITWEIGHT as UNITWEIGHT, goods.WEIGHT as WEIGHT, goods.INNERVOLUM as INNERVOLUM, goods.BOTTOMAREA as BOTTOMAREA, goods.GLONG as GLONG, goods.GWIDTH as GWIDTH, goods.GHEIGHT as GHEIGHT, goods.OUTERWEIGHT as OUTERWE26_, goods.OUTERVOLUM as OUTERVOLUM, goods.OUTERLENGTH as OUTERLE28_, goods.OUTERWIDTH as OUTERWIDTH, goods.OUTERHEIGHT as OUTERHE30_, goods.TUBINGWEIGHT as TUBINGW31_, goods.TUBINGLENGTH as TUBINGL32_, goods.TUBINGWIDTH as TUBINGW33_, goods.TUBINGHEIGHT as TUBINGH34_, goods.BARQUANTITY as BARQUAN35_, goods.BARPOSITION as BARPOSI36_, goods.BARCODE as BARCODE, goods.CODE_PACKAGENO as CODE_PA38_, goods.SHAPE as SHAPE, goods.UCODE as UCODE, goods.KEEPTERM as KEEPTERM, goods.CONTAINERNUM as CONTAIN42_, goods.GRADENO as GRADENO, goods.SAFESTOCKSMIN as SAFESTO44_, goods.SAFESTOCKSMAX as SAFESTO45_, goods.CODE_TYPENO as CODE_TY46_, goods.SUPERGNO as SUPERGNO , goods.AMOUNT as AMOUNT, goods.DISABLEDDATE as DISABLE49_, goods.STATUS as STATUS, goods.REMARK as REMARK, goods.USERNO as USERNO, goods.MAINTAINDATE as MAINTAI53_, goods.RECORDTYPE as RECORDTYPE from B_GOODS goods

DataAccessException:com.neosoft.persistent.exception.DataAccessException: net.sf.hibernate.JDBCException: Could not execute query:invalide column


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 21, 2004 7:56 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
give some info (DB, code etc, read the red banner)

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 22, 2004 1:36 am 
Newbie

Joined: Tue Jul 20, 2004 10:10 pm
Posts: 4
emmanuel wrote:
give some info (DB, code etc, read the red banner)


here is the table

CREATE TABLE B_GOODS
(
PKID NUMBER NOT NULL,
GOODSNO VARCHAR2(20 BYTE) NOT NULL,
GOODSNAME VARCHAR2(50 BYTE) NOT NULL,
COLOR VARCHAR2(10 BYTE),
HOSTNO VARCHAR2(10 BYTE),
SELFCODE VARCHAR2(30 BYTE),
CODE_UNITNO VARCHAR2(10 BYTE),
CODE_UNITNAME VARCHAR2(10 BYTE),
CODE_HIGHTYPENO VARCHAR2(10 BYTE) NOT NULL,
CODE_HIGHTYPENAME VARCHAR2(50 BYTE) NOT NULL,
CODE_CATEGORYNO VARCHAR2(10 BYTE),
CODE_CATEGORYNAME VARCHAR2(50 BYTE),
BRANDNO VARCHAR2(10 BYTE) NOT NULL,
BRANDNAME VARCHAR2(30 BYTE) NOT NULL,
SPECNO VARCHAR2(10 BYTE) NOT NULL,
SPECNAME VARCHAR2(20 BYTE) NOT NULL,
TYPENO VARCHAR2(10 BYTE) NOT NULL,
TYPENAME VARCHAR2(30 BYTE) NOT NULL,
UNITWEIGHT VARCHAR2(10 BYTE),
WEIGHT NUMBER(15,2),
INNERVOLUM NUMBER(15,2),
BOTTOMAREA NUMBER(15,2),
GLONG NUMBER(15,2),
GWIDTH NUMBER(15,2),
GHEIGHT NUMBER(15,2),
OUTERWEIGHT NUMBER(15,2),
OUTERVOLUM NUMBER(15,2),
OUTERLENGTH NUMBER(15,2),
OUTERWIDTH NUMBER(15,2),
OUTERHEIGHT NUMBER(15,2),
TUBINGWEIGHT NUMBER(15,2),
TUBINGLENGTH NUMBER(15,2),
TUBINGWIDTH NUMBER(15,2),
TUBINGHEIGHT NUMBER(15,2),
BARQUANTITY NUMBER,
BARPOSITION VARCHAR2(10 BYTE),
BARCODE VARCHAR2(20 BYTE),
CODE_PACKAGENO VARCHAR2(10 BYTE),
SHAPE VARCHAR2(20 BYTE),
UCODE VARCHAR2(20 BYTE),
KEEPTERM NUMBER,
CONTAINERNUM NUMBER,
GRADENO VARCHAR2(10 BYTE),
SAFESTOCKSMIN NUMBER,
SAFESTOCKSMAX NUMBER,
CODE_TYPENO VARCHAR2(10 BYTE),
SUPERGNO VARCHAR2(10 BYTE),
AMOUNT NUMBER,
DISABLEDDATE DATE,
STATUS NUMBER,
REMARK VARCHAR2(300 BYTE),
USERNO VARCHAR2(10 BYTE) NOT NULL,
MAINTAINDATE DATE,
RECORDTYPE NUMBER NOT NULL
)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 22, 2004 1:41 am 
Newbie

Joined: Tue Jul 20, 2004 10:10 pm
Posts: 4
emmanuel wrote:
give some info (DB, code etc, read the red banner)


here is the o/r mapping file

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="com.neosoft.logistics.persistent.customer.vo.Goods" table="B_GOODS" dynamic-update="true">
<id name="pkid" unsaved-value="null">
<column name="PKID" not-null="true"/>
<generator class="sequence">
<param name="sequence">SEQ_B_GOODS</param>
</generator>
</id>
<property name="goodsNO" column="GOODSNO"/>
<property name="goodsName" column="GOODSNAME"/>
<property name="color" column="COLOR"/>
<property name="hostNO" column="HOSTNO"/>
<property name="selfCode" column="SELFCODE"/>
<property name="codeUnitNO" column="CODE_UNITNO"/>
<property name="codeUnitName" column="CODE_UNITNAME"/>
<property name="codeHighTypeNO" column="CODE_HIGHTYPENO"/>
<property name="codeHighTypeName" column="CODE_HIGHTYPENAME"/>
<property name="codeCategoryNO" column="CODE_CATEGORYNO"/>
<property name="codeCategoryName" column="CODE_CATEGORYNAME"/>
<property name="codeBrandNO" column="BRANDNO"/>
<property name="codeBrandName" column="BRANDNAME"/>
<property name="codeSpecNO" column="SPECNO"/>
<property name="codeSpecName" column="SPECNAME"/>
<property name="typeNO" column="TYPENO"/>
<property name="typeName" column="TYPENAME"/>
<property name="unitWeight" column="UNITWEIGHT"/>
<property name="weight" column="WEIGHT"/>
<property name="innerVolum" column="INNERVOLUM"/>
<property name="bottomArea" column="BOTTOMAREA"/>
<property name="goodsLength" column="GLONG"/>
<property name="goodsWidth" column="GWIDTH"/>
<property name="goodsHeight" column="GHEIGHT"/>
<property name="outerWeight" column="OUTERWEIGHT"/>
<property name="outerVolum" column="OUTERVOLUM"/>
<property name="outerLength" column="OUTERLENGTH"/>
<property name="outerWidth" column="OUTERWIDTH"/>
<property name="outerHeight" column="OUTERHEIGHT"/>
<property name="tubingWeight" column="TUBINGWEIGHT"/>
<property name="tubingLength" column="TUBINGLENGTH"/>
<property name="tubingWidth" column="TUBINGWIDTH"/>
<property name="tubingHeight" column="TUBINGHEIGHT"/>
<property name="barQuantity" column="BARQUANTITY"/>
<property name="barPosition" column="BARPOSITION"/>
<property name="barcode" column="BARCODE"/>
<property name="codePackageNO" column="CODE_PACKAGENO"/>
<property name="shape" column="SHAPE"/>
<property name="ucode" column="UCODE"/>
<property name="keepterm" column="KEEPTERM"/>
<property name="containerNum" column="CONTAINERNUM"/>
<property name="gradeNO" column="GRADENO"/>
<property name="safeStockMin" column="SAFESTOCKSMIN"/>
<property name="safeStockMax" column="SAFESTOCKSMAX"/>
<property name="codeTypeNO" column="CODE_TYPENO"/>
<property name="superGoodsNO" column="SUPERGNO "/>
<property name="amount" column="AMOUNT"/>
<property name="disabledDate" column="DISABLEDDATE"/>
<property name="status" column="STATUS"/>
<property name="remark" column="REMARK"/>
<property name="userNO" column="USERNO"/>
<property name="maintainDate" column="MAINTAINDATE"/>
<property name="recordType" column="RECORDTYPE"/>

</class>
</hibernate-mapping>


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 22, 2004 1:49 am 
Newbie

Joined: Tue Jul 20, 2004 10:10 pm
Posts: 4
emmanuel wrote:
give some info (DB, code etc, read the red banner)


there is no special error messager.

just say one sentence list above.

i dont know how to debug the in hibernate.

any way there seemed no error in my coding.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.