-->
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: left outer join: sql command not properly ended Error
PostPosted: Tue Jan 10, 2006 7:47 pm 
Beginner
Beginner

Joined: Wed Dec 14, 2005 10:32 am
Posts: 20
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: Hibernate 3.0

Mapping documents:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>
<class
name="com.OrderSvcItemComp"
table="COMP" dynamic-insert="false"
dynamic-update="false" batch-size="10">
<id name="compId" type="long"
column="COMPONENT_ID">
<generator class="native" />
</id>

<property name="ordSvcItemNum">
<column name="ORD_SVC_ITEM_NUM" />
</property>

<property name="compSeqNum">
<column name="COMPONENT_SEQ_NUM " />
</property>

<one-to-one name="comps"
class="com.PackageComponent"
property-ref="componentId" />

</class>


<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>
<class
name="com.PackageComponent"
table="PACKAGE_COMPONENTS" lazy="false">

<composite-id>
<key-property name="packageId" type="long"
column="PACKAGE_ID" />
<key-property name="componentId" type="string"
column="COMPONENT_ID" />
<key-property name="activeDt"
column="ACTIVE_DT" />
</composite-id>

<property name="componentId" column="COMPONENT_ID" not-null="true" insert="false" update="false" />

</class>

</hibernate-mapping>
</hibernate-mapping>


Code between sessionFactory.openSession() and session.close():
List osiComps = new OrderSvcItemCompDAO().getOrderSvcItemComp(osv);


Full stack trace of any exception that occurs:
Caused by: org.hibernate.exception.GenericJDBCException: could not execute query
at org.hibernate.exception.ErrorCodeConverter.handledNonSpecificException(ErrorCodeConverter.java:92)
at org.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:80)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.loader.Loader.doList(Loader.java:1502)
at org.hibernate.loader.Loader.list(Loader.java:1482)
at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:111)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1246)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:299)
at com.telcove.phoenix.ordervalidation.dao.OrderSvcItemCompDAO.getOrderSvcItemComp(OrderSvcItemCompDAO.java:31)
at com.telcove.phoenix.ordervalidation.common.OrderValidation.checkIfPackageIsValidForOrderDetail(OrderValidation.java:115)
at Condition_18.invoke(Condition_18.java:1)
at org.drools.semantics.java.JavaCondition.isAllowed(JavaCondition.java:146)
... 11 more
Caused by: java.sql.SQLException: ORA-00933: SQL command not properly ended

at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.oci8.OCIDBAccess.check_error(OCIDBAccess.java:2321)
at oracle.jdbc.oci8.OCIDBAccess.parseExecuteDescribe(OCIDBAccess.java:1255)
at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:2391)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2672)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:589)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:527)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:107)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1183)
at org.hibernate.loader.Loader.doQuery(Loader.java:363)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:203)
at org.hibernate.loader.Loader.doList(Loader.java:1499)
... 19 more


Name and version of the database you are using: Oracle 9i

The generated SQL (show_sql=true):
SELECT this_.component_id AS component1_1_,
this_.ord_svc_item_num AS ord2_8_1_,
this_.component_seq_num AS component3_8_1_,
packagecom2_.package_id AS package1_0_,
packagecom2_.component_id AS component2_0_,
packagecom2_.active_dt AS active3_0_,
packagecom2_.component_id AS component2_9_0_
FROM OEOM_ABS_ORD_SVC_ITEM_COMP this_ LEFT OUTER JOIN package_components packagecom2_ ON this_.component_id =
packagecom2_.component_id
WHERE this_.ord_svc_item_num = ?


Debug level Hibernate log excerpt:error

Hi,

I am gettting the error as shown above. How do I remove the error? I did search the forum but could not get the answer.

Thanks in advance.

-Jam


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 11, 2006 4:30 am 
Regular
Regular

Joined: Tue Jan 03, 2006 9:52 am
Posts: 52
Location: Zurich
Don't know Oracle, but try this:
- Is your hibernate.dialect set correctly?
- Is your JDBC dirver the correct one?
Urs


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 11, 2006 11:19 am 
Beginner
Beginner

Joined: Wed Dec 14, 2005 10:32 am
Posts: 20
Hi,

I am sure I have the proper dialect configured.

Any other ideas??

Thanks,
-Ram


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 11, 2006 1:51 pm 
Senior
Senior

Joined: Wed Aug 17, 2005 12:56 pm
Posts: 136
Location: Erie, PA (USA)
Does the SQL run if you run it directly against Oracle? What Hibernate mechanism did you use to generate SQL -- Criteria, HQL, ? Please provide relavant code inside "getOrderSvcItemComp()" method.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 11, 2006 2:52 pm 
Beginner
Beginner

Joined: Wed Dec 14, 2005 10:32 am
Posts: 20
I found out the solution: It is the problem with the wrong oracle dialect. I was using the Oracle9Dialect instead of OracleDialect.

I was under the impression that we were using Oracle 9.

Thanks for the clues guyz.

-Ram


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.