-->
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: Error with delete batch update... bug ?
PostPosted: Mon Jul 11, 2005 12:35 pm 
Beginner
Beginner

Joined: Wed Aug 18, 2004 10:03 am
Posts: 28
Hi,
I have a problem with my application whit migration to Hibernate 3.0. Can you help me ?

regards
epsino

Hibernate version:

3.0.5

Mapping documents:

Code:
<hibernate-mapping>

    <class name="com.maiasoft.uy.pml.User" table="USERS" lazy="false">
   
        <id name="id" column="user_uid">
            <generator class="uuid.hex"/>
        </id>

        <property name="name"/>
        <property name="edad"/>
         
        <set name="events" table="USER_EVENT" cascade="delete">
            <key column="user_uid"/>
            <many-to-many column="event_uid" class="com.maiasoft.uy.pml.Event"/>
        </set>
       
    </class>
   
</hibernate-mapping>

<hibernate-mapping>

    <class name="com.maiasoft.uy.pml.Event" table="EVENT" lazy="false">

        <id name="id" column="uid">
            <generator class="uuid.hex"/>
        </id>
 
        <property name="date" type="com.maiasoft.uy.pml.hibernate.DateOnlyType"/>
        <property name="time" type="com.maiasoft.uy.pml.hibernate.TimeOnlyType"/>
        <!-- <property name="cost"/> -->
        <property name="title"/>
      
      <set name="users" table="USER_EVENT" inverse="true">
           <key column="event_uid"/>
            <many-to-many column="user_uid" class="com.maiasoft.uy.pml.User"/>
        </set>
       
    </class>

</hibernate-mapping>



Code between sessionFactory.openSession() and session.close():

Code:
        try {
            session.createQuery("delete from Event").executeUpdate();
        } catch (HibernateException e) {
            e.printStackTrace();
        }



Full stack trace of any exception that occurs:

java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.RangeCheck(ArrayList.java:547)
at java.util.ArrayList.get(ArrayList.java:322)
at org.hibernate.hql.ast.HqlSqlWalker.postProcessDelete(HqlSqlWalker.java:418)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:175)
at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:189)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:130)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:83)
at org.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:427)
at org.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:884)
at org.hibernate.impl.SessionImpl.executeUpdate(SessionImpl.java:865)
at org.hibernate.impl.QueryImpl.executeUpdate(QueryImpl.java:89)
at com.maiasoft.uy.pml.hibernate.DSHibernate.removeAll(DSHibernate.java:800)
at com.maiasoft.uy.pml.PersitenceTest.testRemoveAll(PersitenceTest.java:287)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

Name and version of the database you are using:

HSQLDB 1.7.3_3 serie

The generated SQL (show_sql=true):

Nothing.
But is writing into Log this: ERROR - *** ERROR: Events is not mapped.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 11, 2005 12:41 pm 
Beginner
Beginner

Joined: Wed Aug 18, 2004 10:03 am
Posts: 28
I found the problem, i put "delete from Events" and is "delete from Event" without s...

Sorry by the noise...

regards
epsino


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.