-->
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.  [ 2 posts ] 
Author Message
 Post subject: Bug in select-before-update for joined subclasses
PostPosted: Fri Mar 11, 2005 11:12 am 
Newbie

Joined: Fri Mar 11, 2005 10:57 am
Posts: 2
Location: Netherlands
Read the rules before posting!
http://www.hibernate.org/ForumMailingli ... AskForHelp

The generateConcreteSelectString() method in net.sf.hibernate.persister.NormalizedEntityPersister generates a sql statement which causes a sql exception: java.sql.SQLException: ORA-00936: missing expression. The mistake in the sql statement is in the "where and". This occurs whenever I do a select-before-update in a joined subclass (see the Fermenter subclass below)

Hibernate version:
2.1.8

Mapping documents:
(only relevant class shown)
<class name="Recipe" table="recipes">
<cache usage="read-write"/>
<id name="batchNo" column="recp_batch_no">
<generator class="assigned" />
</id>

<property name="changeUser" column="change_user" />
<property name="changeType" column="change_type" />

<many-to-one name="material" column="recp_matr_material_no" class="Material" not-null="true"/>
<many-to-one name="recipeType" column="recp_rect_id" class="RecipeType" not-null="true"/>

<one-to-one name="childRelation" class="RecipeRelation" property-ref="from" />
<one-to-one name="parentRelation" class="RecipeRelation" property-ref="to" />

<component name="startDate">
<property name="date" column="recp_start_date" not-null="true"/>
</component>
<property name="closed" column="recp_ind_closed" type="yes_no" not-null="true" />
<component name="endDate">
<property name="date" column="recp_end_date" />
</component>
<property name="checkedBy" column="recp_chk_by" />
<property name="checkedByDayNo" column="recp_chk_by_day_no" />

<set name="terminations" lazy="true" inverse="true" cascade="all-delete-orphan">
<key column="rete_recp_batch_no" />
<one-to-many class="RecipeTermination"/>
</set>

<!-- Fermenters -->
<joined-subclass name="Fermenter" table="fermenters" select-before-update="true">
<key column="ferm_batch_no" />
<property name="changeUser2" column="change_user" />
<property name="changeType2" column="change_type" />

<property name="backup" column="ferm_ind_backup" type="yes_no" not-null="true" /> <!-- has default value 'N' -->
<component name="drawFillDate">
<property name="date" column="ferm_draw_fill_date" />
</component>
<property name="remarks" column="ferm_remarks" />

<set name="cellCounts" lazy="true" inverse="true" order-by="obsv_sample_date desc" >
<key column="obsv_ferm_batch_no"/>
<one-to-many class="CellCount"/>
</set>

<set name="inoculations" lazy="true" inverse="true" order-by="basw_inoc_date desc">
<key column="basw_ferm_batch_no"/>
<one-to-many class="BaySwitch"/>
</set>

<set name="freezes" lazy="true" inverse="true" order-by="frze_sample_date desc">
<key column="frze_ferm_batch_no"/>
<one-to-many class="Freeze"/>
</set>

<set name="media" lazy="true" inverse="true" order-by="mesw_switch_date desc">
<key column="mesw_ferm_batch_no"/>
<one-to-many class="Medium"/>
</set>

<set name="leakages" lazy="true" inverse="true" order-by="leak_leak_date desc">
<key column="leak_ferm_batch_no"/>
<one-to-many class="Leakage"/>
</set>

</joined-subclass>
</class>

Name and version of the database you are using:
Oracle 10g

The generated SQL (show_sql=true):
select x.ferm_batch_no, x.change_user as change_u2_2_, x.change_type as change_t3_2_, x.ferm_ind_backup as ferm_ind4_2_, x.ferm_draw_fill_date as ferm_dra5_2_, x.ferm_remarks as ferm_rem6_2_, x_1_.change_user as change_u2_0_, x_1_.change_type as change_t3_0_, x_1_.recp_matr_material_no as recp_mat4_0_, x_1_.recp_rect_id as recp_rec5_0_, x_1_.recp_start_date as recp_sta6_0_, x_1_.recp_ind_closed as recp_ind7_0_, x_1_.recp_end_date as recp_end8_0_, x_1_.recp_chk_by as recp_chk9_0_, x_1_.recp_chk_by_day_no as recp_ch10_0_ from fermenters x, recipes x_1_ where and x.ferm_batch_no=x_1_.recp_batch_nox.ferm_batch_no=?

Debug level Hibernate log excerpt:


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 11, 2005 12:23 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
If you could post a runnable test case to JIRA, this would be great.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.