-->
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: pb with many-to-many
PostPosted: Tue Jun 28, 2005 5:01 am 
Regular
Regular

Joined: Mon Apr 25, 2005 5:36 am
Posts: 103
hi I have this :

A<->B , means a many-to-many association bidirectionnal.

A:
<class name="fr.icdc.dei.sample.dto.Ressource" table="RESSOURCE" >

<set name="Projets" table="RESSOURCE_PROJET" inverse="true" cascade="all,delete-orphan" >
<key column="ID_R" />
<many-to-many class="fr.icdc.dei.fwk.sample.dto.Projet" column="ID_P" />
</set>
</class>



B:
<class name="fr.icdc.dei.sample.dto.Projet" table="PROJET" >

<set name="Ressources" table="RESSOURCE_PROJET" cascade="all,delete-orphan" >
<key column="ID_P" />
<many-to-many class="fr.icdc.dei.fwk.sample.dto.Ressource" column="ID_R" />
</set>
</class>



=============================================
10:46:04,198 DEBUG SQL:310 - delete from HIBERNATE.RESSOURCE_PROJET where ID_P=?
Hibernate: delete from HIBERNATE.RESSOURCE_PROJET where ID_P=?
10:46:04,198 DEBUG AbstractBatcher:364 - preparing statement
10:46:04,208 DEBUG IntegerType:59 - binding '14' to parameter: 1
10:46:04,208 DEBUG AbstractBatcher:27 - Adding to batch
10:46:04,208 DEBUG AbstractCollectionPersister:821 - done deleting collection
10:46:04,218 DEBUG UpdateTimestampsCache:51 - Pre-invalidating space [HIBERNATE.RESSOURCE_PROJET]
10:46:04,218 DEBUG UpdateTimestampsCache:51 - Pre-invalidating space [HIBERNATE.RESSOURCE_PROJET]
10:46:04,218 DEBUG UpdateTimestampsCache:51 - Pre-invalidating space [HIBERNATE.RESSOURCE_PROJET]
10:46:04,228 DEBUG AbstractCollectionPersister:794 - Deleting collection: [fr.icdc.dei.fwk.sample.dto.Projet.Ressources#16]
10:46:04,228 DEBUG AbstractBatcher:152 - reusing prepared statement
10:46:04,228 DEBUG SQL:310 - delete from HIBERNATE.RESSOURCE_PROJET where ID_P=?
Hibernate: delete from HIBERNATE.RESSOURCE_PROJET where ID_P=?
10:46:04,228 DEBUG IntegerType:59 - binding '16' to parameter: 1
10:46:04,238 DEBUG AbstractBatcher:27 - Adding to batch
10:46:04,238 DEBUG AbstractCollectionPersister:821 - done deleting collection
10:46:04,238 DEBUG UpdateTimestampsCache:51 - Pre-invalidating space [HIBERNATE.RESSOURCE_PROJET]
10:46:04,238 DEBUG AbstractCollectionPersister:794 - Deleting collection: [fr.icdc.dei.fwk.sample.dto.Projet.Ressources#18]
10:46:04,238 DEBUG AbstractBatcher:152 - reusing prepared statement
10:46:04,248 DEBUG SQL:310 - delete from HIBERNATE.RESSOURCE_PROJET where ID_P=?
Hibernate: delete from HIBERNATE.RESSOURCE_PROJET where ID_P=?
10:46:04,248 DEBUG IntegerType:59 - binding '18' to parameter: 1
10:46:04,248 DEBUG AbstractBatcher:27 - Adding to batch
10:46:04,248 DEBUG AbstractCollectionPersister:821 - done deleting collection
10:46:04,258 DEBUG AbstractBatcher:54 - Executing batch size: 3
10:46:04,328 DEBUG AbstractBatcher:80 - success of batch update unknown: 0
10:46:04,328 DEBUG AbstractBatcher:80 - success of batch update unknown: 1
10:46:04,328 DEBUG AbstractBatcher:80 - success of batch update unknown: 2
10:46:04,328 DEBUG AbstractBatcher:284 - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
10:46:04,338 DEBUG AbstractBatcher:392 - closing statement
10:46:04,348 DEBUG UpdateTimestampsCache:51 - Pre-invalidating space [HIBERNATE.PROJET]
10:46:04,358 DEBUG BasicEntityPersister:2040 - Deleting entity: [fr.icdc.dei.fwk.sample.dto.Projet#18]
10:46:04,358 DEBUG BasicEntityPersister:2041 - Version: 2005-06-27 15:17:57.0
10:46:04,358 DEBUG AbstractBatcher:276 - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
10:46:04,358 DEBUG SQL:310 - delete from HIBERNATE.PROJET where ID=? and DATE_MODIF=?
Hibernate: delete from HIBERNATE.PROJET where ID=? and DATE_MODIF=?
10:46:04,358 DEBUG AbstractBatcher:364 - preparing statement
10:46:04,408 DEBUG IntegerType:59 - binding '18' to parameter: 1
10:46:04,418 DEBUG TimestampType:59 - binding '2005-06-27 15:17:57' to parameter: 2
10:46:04,448 DEBUG AbstractBatcher:284 - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
10:46:04,448 DEBUG AbstractBatcher:392 - closing statement
10:46:04,498 DEBUG UpdateTimestampsCache:51 - Pre-invalidating space [HIBERNATE.EXTERNE]
10:46:04,498 DEBUG UpdateTimestampsCache:51 - Pre-invalidating space [HIBERNATE.RESSOURCE]
10:46:04,508 DEBUG BasicEntityPersister:2040 - Deleting entity: [fr.icdc.dei.fwk.sample.dto.Externe#22]
10:46:04,508 DEBUG AbstractBatcher:276 - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
10:46:04,508 DEBUG SQL:310 - delete from HIBERNATE.EXTERNE where Id=?
Hibernate: delete from HIBERNATE.EXTERNE where Id=?
10:46:04,508 DEBUG AbstractBatcher:364 - preparing statement
10:46:04,518 DEBUG IntegerType:59 - binding '22' to parameter: 1
10:46:04,518 DEBUG AbstractBatcher:284 - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
10:46:04,528 DEBUG AbstractBatcher:392 - closing statement
10:46:04,528 DEBUG BasicEntityPersister:2040 - Deleting entity: [fr.icdc.dei.fwk.sample.dto.Externe#22]
10:46:04,538 DEBUG BasicEntityPersister:2041 - Version: 2005-06-28 10:40:26.0
10:46:04,538 DEBUG AbstractBatcher:276 - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
10:46:04,538 DEBUG SQL:310 - delete from HIBERNATE.RESSOURCE where ID=? and DATE_MODIF=?
Hibernate: delete from HIBERNATE.RESSOURCE where ID=? and DATE_MODIF=?
10:46:04,538 DEBUG AbstractBatcher:364 - preparing statement
10:46:04,569 DEBUG IntegerType:59 - binding '22' to parameter: 1
10:46:04,569 DEBUG TimestampType:59 - binding '2005-06-28 10:40:26' to parameter: 2
10:46:04,599 DEBUG AbstractBatcher:284 - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
10:46:04,599 DEBUG AbstractBatcher:392 - closing statement
10:46:04,619 DEBUG UpdateTimestampsCache:51 - Pre-invalidating space [HIBERNATE.PROJET]
10:46:04,619 DEBUG BasicEntityPersister:2040 - Deleting entity: [fr.icdc.dei.fwk.sample.dto.Projet#16]
10:46:04,629 DEBUG BasicEntityPersister:2041 - Version: 2005-06-28 10:40:26.0
10:46:04,629 DEBUG AbstractBatcher:276 - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
10:46:04,639 DEBUG SQL:310 - delete from HIBERNATE.PROJET where ID=? and DATE_MODIF=?
Hibernate: delete from HIBERNATE.PROJET where ID=? and DATE_MODIF=?
10:46:04,639 DEBUG AbstractBatcher:364 - preparing statement
10:46:04,639 DEBUG IntegerType:59 - binding '16' to parameter: 1
10:46:04,649 DEBUG TimestampType:59 - binding '2005-06-28 10:40:26' to parameter: 2
10:46:04,649 DEBUG AbstractBatcher:284 - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
10:46:04,649 DEBUG AbstractBatcher:392 - closing statement
10:46:04,679 DEBUG UpdateTimestampsCache:51 - Pre-invalidating space [HIBERNATE.RESSOURCE]
10:46:04,679 DEBUG BasicEntityPersister:2040 - Deleting entity: [fr.icdc.dei.fwk.sample.dto.Ressource#24]
10:46:04,689 DEBUG BasicEntityPersister:2041 - Version: 2005-06-27 15:30:39.0
10:46:04,689 DEBUG AbstractBatcher:276 - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
10:46:04,689 DEBUG SQL:310 - delete from HIBERNATE.RESSOURCE where ID=? and DATE_MODIF=?
Hibernate: delete from HIBERNATE.RESSOURCE where ID=? and DATE_MODIF=?
10:46:04,689 DEBUG AbstractBatcher:364 - preparing statement
10:46:04,749 DEBUG IntegerType:59 - binding '24' to parameter: 1
10:46:04,749 DEBUG TimestampType:59 - binding '2005-06-27 15:30:39' to parameter: 2
10:46:04,749 DEBUG AbstractBatcher:284 - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
10:46:04,759 DEBUG AbstractBatcher:392 - closing statement
10:46:04,759 DEBUG UpdateTimestampsCache:51 - Pre-invalidating space [HIBERNATE.PROJET]
10:46:04,759 DEBUG BasicEntityPersister:2040 - Deleting entity: [fr.icdc.dei.fwk.sample.dto.Projet#14]
10:46:04,759 DEBUG BasicEntityPersister:2041 - Version: 2005-06-28 10:37:37.0
10:46:04,779 DEBUG AbstractBatcher:276 - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
10:46:04,779 DEBUG SQL:310 - delete from HIBERNATE.PROJET where ID=? and DATE_MODIF=?
Hibernate: delete from HIBERNATE.PROJET where ID=? and DATE_MODIF=?
10:46:04,779 DEBUG AbstractBatcher:364 - preparing statement
10:46:04,799 DEBUG IntegerType:59 - binding '14' to parameter: 1
10:46:04,829 DEBUG TimestampType:59 - binding '2005-06-28 10:37:37' to parameter: 2
10:46:04,849 DEBUG AbstractBatcher:284 - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
10:46:04,849 DEBUG AbstractBatcher:392 - closing statement
10:46:04,859 DEBUG UpdateTimestampsCache:51 - Pre-invalidating space [HIBERNATE.RESSOURCE]
10:46:04,859 DEBUG BasicEntityPersister:2040 - Deleting entity: [fr.icdc.dei.fwk.sample.dto.Ressource#23]
10:46:04,859 DEBUG BasicEntityPersister:2041 - Version: 2005-06-27 15:29:39.0
10:46:04,869 DEBUG AbstractBatcher:276 - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
10:46:04,869 DEBUG SQL:310 - delete from HIBERNATE.RESSOURCE where ID=? and DATE_MODIF=?
Hibernate: delete from HIBERNATE.RESSOURCE where ID=? and DATE_MODIF=?
10:46:04,869 DEBUG AbstractBatcher:364 - preparing statement
10:46:04,869 DEBUG IntegerType:59 - binding '23' to parameter: 1
10:46:04,889 DEBUG TimestampType:59 - binding '2005-06-27 15:29:39' to parameter: 2
10:46:04,909 DEBUG AbstractBatcher:284 - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
10:46:04,909 DEBUG AbstractBatcher:392 - closing statement
10:46:04,919 DEBUG AbstractFlushingEventListener:294 - post flush
10:46:04,919 DEBUG JDBCContext:208 - before transaction completion
10:46:04,969 DEBUG SessionImpl:337 - before transaction completion
10:46:04,979 DEBUG JDBCTransaction:96 - committed JDBC Connection
10:46:04,979 DEBUG JDBCContext:213 - after transaction completion
10:46:04,979 DEBUG SessionImpl:353 - after transaction completion
10:46:04,979 DEBUG UpdateTimestampsCache:64 - Invalidating space [HIBERNATE.RESSOURCE_PROJET], timestamp: 4587308502953984
10:46:04,979 DEBUG UpdateTimestampsCache:64 - Invalidating space [HIBERNATE.RESSOURCE_PROJET], timestamp: 4587308502953985
10:46:04,979 DEBUG UpdateTimestampsCache:64 - Invalidating space [HIBERNATE.RESSOURCE_PROJET], timestamp: 4587308502953986
10:46:04,979 DEBUG UpdateTimestampsCache:64 - Invalidating space [HIBERNATE.RESSOURCE_PROJET], timestamp: 4587308502953987
10:46:04,989 DEBUG UpdateTimestampsCache:64 - Invalidating space [HIBERNATE.RESSOURCE_PROJET], timestamp: 4587308502994944
10:46:04,989 DEBUG UpdateTimestampsCache:64 - Invalidating space [HIBERNATE.RESSOURCE_PROJET], timestamp: 4587308502994945
10:46:04,989 DEBUG UpdateTimestampsCache:64 - Invalidating space [HIBERNATE.PROJET], timestamp: 4587308502994946
10:46:04,989 DEBUG UpdateTimestampsCache:64 - Invalidating space [HIBERNATE.EXTERNE], timestamp: 4587308502994947
10:46:04,989 DEBUG UpdateTimestampsCache:64 - Invalidating space [HIBERNATE.RESSOURCE], timestamp: 4587308502994947
10:46:04,989 DEBUG UpdateTimestampsCache:64 - Invalidating space [HIBERNATE.PROJET], timestamp: 4587308502994948
10:46:04,989 DEBUG UpdateTimestampsCache:64 - Invalidating space [HIBERNATE.RESSOURCE], timestamp: 4587308502994949
10:46:04,999 DEBUG UpdateTimestampsCache:64 - Invalidating space [HIBERNATE.PROJET], timestamp: 4587308503035904
10:46:04,999 DEBUG UpdateTimestampsCache:64 - Invalidating space [HIBERNATE.RESSOURCE], timestamp: 4587308503035905
la Interne avec comme ID 23 vient d'ĂȘtre supprimĂ©.
10:46:05,019 DEBUG SessionImpl:246 - closing session
10:46:05,019 DEBUG AbstractBatcher:423 - closing JDBC connection (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)
10:46:05,019 DEBUG DriverManagerConnectionProvider:129 - returning connection to pool, pool size: 1
10:46:05,109 DEBUG JDBCContext:213 - after transaction completion
10:46:05,149 DEBUG SessionImpl:353 - after transaction completion
fin du programme
=============================================

my database is :

table : RESSOURCE_PROJET (projet, ressource)

RESSOURCE_PROJET :
(14,22)
(18,22)
(14,23)
(14,24)
(16,24)

I want to delete the ressource (23), at the end of the running, all my data of this table are deleted !! why?
I just want to delete the row (14,23)


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.