-->
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.  [ 1 post ] 
Author Message
 Post subject: use of session.delete with a complex query
PostPosted: Thu Oct 14, 2004 10:57 am 
Newbie

Joined: Mon Feb 09, 2004 8:58 am
Posts: 4
hI,
As you cas see below I try to make a complex delete using a query
And it failed.


Hibernate version:
2.1

Mapping documents:
<hibernate-mapping>
<class name="aladin.business.intervention.InterventionForecast" table="INTERVENTIONFORECASTS">
<id type="string" name="id" column="ID" length="20" unsaved-value="null">
<generator class="aladin.basic.StampGenerator"/>
</id>

<property name="timeStamp" type="string">
<column name="TIMESTAMP" length="17"/>
</property>

....
</class>
</hibernate-mapping>

<hibernate-mapping>
<class name="aladin.business.intervention.InterventionPart" table="INTERVENTIONPARTS">
<id type="string" name="id" column="ID" length="20" unsaved-value="null">
<generator class="aladin.basic.StampGenerator"/>
</id>
<property name="timeStamp" type="string">
<column name="TIMESTAMP" length="17"/>
</property>

<property name="failureDetail" type="string">
<column name="FAILUREDETAIL" length="255"/>
</property>

<many-to-one name="nauticalObject" class="aladin.business.nauticalobject.NauticalObject">
<column name="NAUTICALOBJECT" />
</many-to-one>

<property name="nextVisit" type="date">
<column name="NEXTVISIT"/>
</property>

<property name="automaticPlanification" type="boolean">
<column name="AUTOMATICPLANIFICATION"/>
</property>

<property name="subcontractor" type="string">
<column name="SUBCONTRACTOR" length="255"/>
</property>

<property name="duration" type="float">
<column name="DURATION" />
</property>

<property name="costs" type="float">
<column name="COSTS"/>
</property>

<many-to-one name="failureReason" class="aladin.business.intervention.FailureReason">
<column name="FAILUREREASON" />
</many-to-one>

<many-to-one name="type" class="aladin.business.intervention.InterventionType">
<column name="INTERVENTIONTYPE" />
</many-to-one>

<many-to-one name="kind" class="aladin.business.intervention.InterventionKind">
<column name="INTERVENTIONKIND" />
</many-to-one>

<many-to-one name="oldEquipmentDestination" class="aladin.business.intervention.OldEquipmentDestination">
<column name="OLDEQUIPMENTDESTINATION" />
</many-to-one>

<many-to-one name="passiveEquipmentObject" class="aladin.business.equipment.PassiveEquipmentObject">
<column name="PASSIVEEQUIPMENTOBJECT" />
</many-to-one>

<many-to-one name="activeEquipmentObject" class="aladin.business.equipment.ActiveEquipmentObject">
<column name="ACTIVEEQUIPMENTOBJECT"/>
</many-to-one>

<many-to-one name="alimentationObject" class="aladin.business.equipment.AlimentationObject">
<column name="ALIMENTATIONOBJECT" />
</many-to-one>

<many-to-one name="alimentedObject" class="aladin.business.equipment.AlimentedObject">
<column name="ALIMENTEDOBJECT"/>
</many-to-one>

<set name="interventionForecasts" lazy="false">
<key column="INTERVENTIONPART_ID" />
<one-to-many class="aladin.business.intervention.InterventionForecast" />
</set>

<many-to-one name="intervention" class="aladin.business.intervention.Intervention" >
<column name="INTERVENTION_ID"/>
</many-to-one>

<property name="label" type="string">
<column name="LABEL" length="50"/>
</property>

</class>

</hibernate-mapping>

Code between sessionFactory.openSession() and session.close():
StringBuffer query = new StringBuffer("select parts, forecasts");
query.append(" from aladin.business.intervention.InterventionPart as parts");
query.append(", parts.interventionForecasts as forecasts");
query.append(" where parts.id=? ");
int value = session.delete( query.toString(),idInterventionPart,Hibernate.STRING );

Full stack trace of any exception that occurs:
net.sf.hibernate.MappingException: No persister for: [Ljava.lang.Object;
at net.sf.hibernate.impl.SessionFactoryImpl.getPersister(SessionFactoryImpl.java:344)
at net.sf.hibernate.impl.SessionImpl.getClassPersister(SessionImpl.java:2656)
at net.sf.hibernate.impl.SessionImpl.getPersister(SessionImpl.java:2663)
at net.sf.hibernate.impl.SessionImpl.delete(SessionImpl.java:1107)
at net.sf.hibernate.impl.SessionImpl.delete(SessionImpl.java:1635)
at net.sf.hibernate.impl.SessionImpl.delete(SessionImpl.java:1623)
at aladin.business.intervention.InterventionManager.removeInterventionPart(InterventionManager.java:1122)
at aladin.action.intervention.interventionpart.InterventionPartListRemoveAction.execute(InterventionPartListRemoveAction.java:145)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)


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

The generated SQL (show_sql=true):
select interventi0_.ID as ID0_, interventi1_.ID as ID1_, interventi0_.TIMESTAMP as TIMESTAMP0_,
interventi0_.FAILUREDETAIL as FAILURED3_0_, interventi0_.NAUTICALOBJECT as NAUTICAL4_0_,
interventi0_.NEXTVISIT as NEXTVISIT0_, interventi0_.AUTOMATICPLANIFICATION as AUTOMATI6_0_,
interventi0_.SUBCONTRACTOR as SUBCONTR7_0_, interventi0_.DURATION as DURATION0_,
interventi0_.COSTS as COSTS0_, interventi0_.FAILUREREASON as FAILURE10_0_,
interventi0_.INTERVENTIONTYPE as INTERVE11_0_, interventi0_.INTERVENTIONKIND as INTERVE12_0_,
interventi0_.OLDEQUIPMENTDESTINATION as OLDEQUI13_0_,
interventi0_.PASSIVEEQUIPMENTOBJECT as PASSIVE14_0_,
interventi0_.ACTIVEEQUIPMENTOBJECT as ACTIVEE15_0_,
interventi0_.ALIMENTATIONOBJECT as ALIMENT16_0_,
interventi0_.ALIMENTEDOBJECT as ALIMENT17_0_, interventi0_.INTERVENTION_ID as INTERVE18_0_,
interventi0_.LABEL as LABEL0_, interventi1_.TIMESTAMP as TIMESTAMP1_, interventi1_.NAME as NAME1_,
interventi1_.IDEQUIPMENT as IDEQUIPM4_1_, interventi1_.CONTROLPERIODICITY as CONTROLP5_1_,
interventi1_.LIFEDURATION as LIFEDURA6_1_, interventi1_.UPDATERUNNINGDATE as UPDATERU7_1_,
interventi1_.UPDATELASTCONTROLDATE as UPDATELA8_1_, interventi1_.FIXNUMBERTYPE as FIXNUMBE9_1_

from INTERVENTIONPARTS interventi0_
left outer join INTERVENTIONFORECASTS interventi1_ on
interventi0_.ID=interventi1_.INTERVENTIONPART_ID
where (interventi0_.ID=? )


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

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.