-->
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.  [ 3 posts ] 
Author Message
 Post subject: many-to-many relation doesn't poplulate association table
PostPosted: Wed Dec 08, 2004 4:19 am 
Newbie

Joined: Thu Dec 02, 2004 10:56 am
Posts: 3
Location: Belgium
Here is the structure of our java classes:

A sub project contains libraries (with a set). We have a many-to-many relationship between sub projects and libraries.

When we store the sub project, the sub project is created, libraries are created, but the association table is not filled.

Does somebody has a solution ?

Hibernate version: 2.1.6

Mapping documents:

For sub projects :

<set
name="libs"
table="SP_USE_LIB"
lazy="false"
inverse="false"
cascade="all"
sort="unsorted"
>

<key
column="sub_project_id"
>
</key>

<many-to-many
class="be.smalsmvm.spi.tools.report.bo.Library"
column="library_id"
outer-join="auto"
/>

</set>

For libraries :

anything about the relation.


Thanks

_________________
Oli


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 08, 2004 4:23 am 
Senior
Senior

Joined: Sat Jul 17, 2004 5:16 pm
Posts: 143
Thats weird... Here is an example of one I have that works fine. Hope it helps. Chris

Code:
     <set name="groupsFastSet" cascade="all-delete-orphan" table="fast_user_group">
        <key column="user_id"/>
        <many-to-many class="FastGroup" column="group_id"/>
      </set>


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 08, 2004 4:41 am 
Newbie

Joined: Thu Dec 02, 2004 10:56 am
Posts: 3
Location: Belgium
It does not work. Here is the log :

DEBUG *** 08/12/2004 09:30:58,642 *** [main] (Cascades.java:497) *** processing cascades for: be.smalsmvm.spi.tools.report.bo.Project
DEBUG *** 08/12/2004 09:30:58,658 *** [main] (Cascades.java:524) *** cascading to collection: be.smalsmvm.spi.tools.report.bo.Project.subProjects
DEBUG *** 08/12/2004 09:30:58,658 *** [main] (Cascades.java:113) *** cascading to saveOrUpdate()
DEBUG *** 08/12/2004 09:30:58,658 *** [main] (Cascades.java:312) *** id unsaved-value: 0
DEBUG *** 08/12/2004 09:30:58,658 *** [main] (SessionImpl.java:1387) *** saveOrUpdate() unsaved instance
DEBUG *** 08/12/2004 09:30:58,658 *** [main] (SessionImpl.java:825) *** saving [be.smalsmvm.spi.tools.report.bo.SubProject#<null>]
DEBUG *** 08/12/2004 09:30:58,658 *** [main] (SessionImpl.java:2309) *** executing insertions
DEBUG *** 08/12/2004 09:30:58,658 *** [main] (Cascades.java:497) *** processing cascades for: be.smalsmvm.spi.tools.report.bo.SubProject
DEBUG *** 08/12/2004 09:30:58,658 *** [main] (Cascades.java:506) *** done processing cascades for: be.smalsmvm.spi.tools.report.bo.SubProject
DEBUG *** 08/12/2004 09:30:58,658 *** [main] (WrapVisitor.java:81) *** Wrapped collection in role: be.smalsmvm.spi.tools.report.bo.SubProject.libs
DEBUG *** 08/12/2004 09:30:58,658 *** [main] (WrapVisitor.java:81) *** Wrapped collection in role: be.smalsmvm.spi.tools.report.bo.SubProject.dependencies
DEBUG *** 08/12/2004 09:30:58,658 *** [main] (EntityPersister.java:490) *** Inserting entity: be.smalsmvm.spi.tools.report.bo.SubProject (native id)
DEBUG *** 08/12/2004 09:30:58,658 *** [main] (BatcherImpl.java:200) *** about to open: 0 open PreparedStatements, 0 open ResultSets
DEBUG *** 08/12/2004 09:30:58,658 *** [main] (BatcherImpl.java:226) *** insert into SUB_PROJECTS (project_id, name, version, integration_server, use_junit, use_emma, use_checkstyle, use_javadoc, type) values (?, ?, ?, ?, ?, ?, ?, ?, ?)
DEBUG *** 08/12/2004 09:30:58,658 *** [main] (BatcherImpl.java:249) *** preparing statement
DEBUG *** 08/12/2004 09:30:58,658 *** [main] (EntityPersister.java:388) *** Dehydrating entity: [be.smalsmvm.spi.tools.report.bo.SubProject#<null>]
DEBUG *** 08/12/2004 09:30:58,658 *** [main] (NullableType.java:46) *** binding '1' to parameter: 1
DEBUG *** 08/12/2004 09:30:58,658 *** [main] (NullableType.java:46) *** binding 'spitools-projectsreport' to parameter: 2
DEBUG *** 08/12/2004 09:30:58,658 *** [main] (NullableType.java:46) *** binding '0.1' to parameter: 3
DEBUG *** 08/12/2004 09:30:58,673 *** [main] (NullableType.java:46) *** binding 'fv' to parameter: 4
DEBUG *** 08/12/2004 09:30:58,673 *** [main] (NullableType.java:46) *** binding 'true' to parameter: 5
DEBUG *** 08/12/2004 09:30:58,673 *** [main] (NullableType.java:46) *** binding 'true' to parameter: 6
DEBUG *** 08/12/2004 09:30:58,673 *** [main] (NullableType.java:46) *** binding 'true' to parameter: 7
DEBUG *** 08/12/2004 09:30:58,673 *** [main] (NullableType.java:46) *** binding 'true' to parameter: 8
DEBUG *** 08/12/2004 09:30:58,673 *** [main] (NullableType.java:46) *** binding '0' to parameter: 9
DEBUG *** 08/12/2004 09:30:58,673 *** [main] (AbstractEntityPersister.java:1236) *** Natively generated identity: 1
DEBUG *** 08/12/2004 09:30:58,673 *** [main] (BatcherImpl.java:207) *** done closing: 0 open PreparedStatements, 0 open ResultSets
DEBUG *** 08/12/2004 09:30:58,673 *** [main] (BatcherImpl.java:269) *** closing statement
DEBUG *** 08/12/2004 09:30:58,689 *** [main] (Cascades.java:497) *** processing cascades for: be.smalsmvm.spi.tools.report.bo.SubProject
DEBUG *** 08/12/2004 09:30:58,689 *** [main] (Cascades.java:524) *** cascading to collection: be.smalsmvm.spi.tools.report.bo.SubProject.libs
DEBUG *** 08/12/2004 09:30:58,689 *** [main] (Cascades.java:113) *** cascading to saveOrUpdate()
DEBUG *** 08/12/2004 09:30:58,689 *** [main] (Cascades.java:312) *** id unsaved-value: 0
DEBUG *** 08/12/2004 09:30:58,689 *** [main] (SessionImpl.java:1387) *** saveOrUpdate() unsaved instance
DEBUG *** 08/12/2004 09:30:58,689 *** [main] (SessionImpl.java:825) *** saving [be.smalsmvm.spi.tools.report.bo.Library#<null>]
DEBUG *** 08/12/2004 09:30:58,689 *** [main] (SessionImpl.java:2309) *** executing insertions
DEBUG *** 08/12/2004 09:30:58,689 *** [main] (Cascades.java:497) *** processing cascades for: be.smalsmvm.spi.tools.report.bo.Library
DEBUG *** 08/12/2004 09:30:58,689 *** [main] (Cascades.java:506) *** done processing cascades for: be.smalsmvm.spi.tools.report.bo.Library
DEBUG *** 08/12/2004 09:30:58,689 *** [main] (WrapVisitor.java:81) *** Wrapped collection in role: be.smalsmvm.spi.tools.report.bo.Library.reportLibraries
DEBUG *** 08/12/2004 09:30:58,689 *** [main] (EntityPersister.java:490) *** Inserting entity: be.smalsmvm.spi.tools.report.bo.Library (native id)
DEBUG *** 08/12/2004 09:30:58,689 *** [main] (BatcherImpl.java:200) *** about to open: 0 open PreparedStatements, 0 open ResultSets
DEBUG *** 08/12/2004 09:30:58,689 *** [main] (BatcherImpl.java:226) *** insert into LIBRARIES (name, provider, number_of_projects, type, maximum_reuse, minimum_reuse) values (?, ?, ?, ?, ?, ?)
DEBUG *** 08/12/2004 09:30:58,689 *** [main] (BatcherImpl.java:249) *** preparing statement
DEBUG *** 08/12/2004 09:30:58,689 *** [main] (EntityPersister.java:388) *** Dehydrating entity: [be.smalsmvm.spi.tools.report.bo.Library#<null>]
DEBUG *** 08/12/2004 09:30:58,689 *** [main] (NullableType.java:46) *** binding 'collections-3.1' to parameter: 1
DEBUG *** 08/12/2004 09:30:58,689 *** [main] (NullableType.java:46) *** binding '0' to parameter: 2
DEBUG *** 08/12/2004 09:30:58,689 *** [main] (NullableType.java:46) *** binding '0' to parameter: 3
DEBUG *** 08/12/2004 09:30:58,705 *** [main] (NullableType.java:46) *** binding '0' to parameter: 4
DEBUG *** 08/12/2004 09:30:58,705 *** [main] (NullableType.java:46) *** binding '0.0' to parameter: 5
DEBUG *** 08/12/2004 09:30:58,705 *** [main] (NullableType.java:46) *** binding '0.0' to parameter: 6
DEBUG *** 08/12/2004 09:30:58,705 *** [main] (AbstractEntityPersister.java:1236) *** Natively generated identity: 343
DEBUG *** 08/12/2004 09:30:58,705 *** [main] (BatcherImpl.java:207) *** done closing: 0 open PreparedStatements, 0 open ResultSets
DEBUG *** 08/12/2004 09:30:58,705 *** [main] (BatcherImpl.java:269) *** closing statement
DEBUG *** 08/12/2004 09:30:58,705 *** [main] (Cascades.java:497) *** processing cascades for: be.smalsmvm.spi.tools.report.bo.Library
DEBUG *** 08/12/2004 09:30:58,705 *** [main] (Cascades.java:524) *** cascading to collection: be.smalsmvm.spi.tools.report.bo.Library.reportLibraries
DEBUG *** 08/12/2004 09:30:58,705 *** [main] (Cascades.java:506) *** done processing cascades for: be.smalsmvm.spi.tools.report.bo.Library
DEBUG *** 08/12/2004 09:30:58,705 *** [main] (Cascades.java:113) *** cascading to saveOrUpdate()
DEBUG *** 08/12/2004 09:30:58,705 *** [main] (Cascades.java:312) *** id unsaved-value: 0
DEBUG *** 08/12/2004 09:30:58,720 *** [main] (SessionImpl.java:1387) *** saveOrUpdate() unsaved instance
DEBUG *** 08/12/2004 09:30:58,720 *** [main] (SessionImpl.java:825) *** saving [be.smalsmvm.spi.tools.report.bo.Library#<null>]
DEBUG *** 08/12/2004 09:30:58,720 *** [main] (SessionImpl.java:2309) *** executing insertions
DEBUG *** 08/12/2004 09:30:58,720 *** [main] (Cascades.java:497) *** processing cascades for: be.smalsmvm.spi.tools.report.bo.Library
DEBUG *** 08/12/2004 09:30:58,720 *** [main] (Cascades.java:506) *** done processing cascades for: be.smalsmvm.spi.tools.report.bo.Library
DEBUG *** 08/12/2004 09:30:58,720 *** [main] (WrapVisitor.java:81) *** Wrapped collection in role: be.smalsmvm.spi.tools.report.bo.Library.reportLibraries
DEBUG *** 08/12/2004 09:30:58,720 *** [main] (EntityPersister.java:490) *** Inserting entity: be.smalsmvm.spi.tools.report.bo.Library (native id)
DEBUG *** 08/12/2004 09:30:58,720 *** [main] (BatcherImpl.java:200) *** about to open: 0 open PreparedStatements, 0 open ResultSets
DEBUG *** 08/12/2004 09:30:58,720 *** [main] (BatcherImpl.java:226) *** insert into LIBRARIES (name, provider, number_of_projects, type, maximum_reuse, minimum_reuse) values (?, ?, ?, ?, ?, ?)
DEBUG *** 08/12/2004 09:30:58,720 *** [main] (BatcherImpl.java:249) *** preparing statement
DEBUG *** 08/12/2004 09:30:58,720 *** [main] (EntityPersister.java:388) *** Dehydrating entity: [be.smalsmvm.spi.tools.report.bo.Library#<null>]
DEBUG *** 08/12/2004 09:30:58,720 *** [main] (NullableType.java:46) *** binding 'hibernate-2.1.6' to parameter: 1
DEBUG *** 08/12/2004 09:30:58,720 *** [main] (NullableType.java:46) *** binding '0' to parameter: 2
DEBUG *** 08/12/2004 09:30:58,720 *** [main] (NullableType.java:46) *** binding '0' to parameter: 3
DEBUG *** 08/12/2004 09:30:58,720 *** [main] (NullableType.java:46) *** binding '0' to parameter: 4
DEBUG *** 08/12/2004 09:30:58,720 *** [main] (NullableType.java:46) *** binding '0.0' to parameter: 5
DEBUG *** 08/12/2004 09:30:58,720 *** [main] (NullableType.java:46) *** binding '0.0' to parameter: 6
DEBUG *** 08/12/2004 09:30:58,751 *** [main] (AbstractEntityPersister.java:1236) *** Natively generated identity: 344
DEBUG *** 08/12/2004 09:30:58,751 *** [main] (BatcherImpl.java:207) *** done closing: 0 open PreparedStatements, 0 open ResultSets
DEBUG *** 08/12/2004 09:30:58,751 *** [main] (BatcherImpl.java:269) *** closing statement
DEBUG *** 08/12/2004 09:30:58,767 *** [main] (Cascades.java:497) *** processing cascades for: be.smalsmvm.spi.tools.report.bo.Library
DEBUG *** 08/12/2004 09:30:58,767 *** [main] (Cascades.java:524) *** cascading to collection: be.smalsmvm.spi.tools.report.bo.Library.reportLibraries
DEBUG *** 08/12/2004 09:30:58,767 *** [main] (Cascades.java:506) *** done processing cascades for: be.smalsmvm.spi.tools.report.bo.Library
DEBUG *** 08/12/2004 09:30:58,767 *** [main] (Cascades.java:113) *** cascading to saveOrUpdate()
DEBUG *** 08/12/2004 09:30:58,767 *** [main] (Cascades.java:312) *** id unsaved-value: 0
DEBUG *** 08/12/2004 09:30:58,767 *** [main] (SessionImpl.java:1387) *** saveOrUpdate() unsaved instance
DEBUG *** 08/12/2004 09:30:58,767 *** [main] (SessionImpl.java:825) *** saving [be.smalsmvm.spi.tools.report.bo.Library#<null>]
DEBUG *** 08/12/2004 09:30:58,767 *** [main] (SessionImpl.java:2309) *** executing insertions
DEBUG *** 08/12/2004 09:30:58,767 *** [main] (Cascades.java:497) *** processing cascades for: be.smalsmvm.spi.tools.report.bo.Library
DEBUG *** 08/12/2004 09:30:58,767 *** [main] (Cascades.java:506) *** done processing cascades for: be.smalsmvm.spi.tools.report.bo.Library
DEBUG *** 08/12/2004 09:30:58,767 *** [main] (WrapVisitor.java:81) *** Wrapped collection in role: be.smalsmvm.spi.tools.report.bo.Library.reportLibraries
DEBUG *** 08/12/2004 09:30:58,767 *** [main] (EntityPersister.java:490) *** Inserting entity: be.smalsmvm.spi.tools.report.bo.Library (native id)
DEBUG *** 08/12/2004 09:30:58,767 *** [main] (BatcherImpl.java:200) *** about to open: 0 open PreparedStatements, 0 open ResultSets
DEBUG *** 08/12/2004 09:30:58,767 *** [main] (BatcherImpl.java:226) *** insert into LIBRARIES (name, provider, number_of_projects, type, maximum_reuse, minimum_reuse) values (?, ?, ?, ?, ?, ?)
DEBUG *** 08/12/2004 09:30:58,767 *** [main] (BatcherImpl.java:249) *** preparing statement
[...]
DEBUG *** 08/12/2004 09:30:59,156 *** [main] (EntityPersister.java:388) *** Dehydrating entity: [be.smalsmvm.spi.tools.report.bo.Library#<null>]
DEBUG *** 08/12/2004 09:30:59,156 *** [main] (NullableType.java:46) *** binding 'net-1.2.2' to parameter: 1
DEBUG *** 08/12/2004 09:30:59,156 *** [main] (NullableType.java:46) *** binding '0' to parameter: 2
DEBUG *** 08/12/2004 09:30:59,156 *** [main] (NullableType.java:46) *** binding '0' to parameter: 3
DEBUG *** 08/12/2004 09:30:59,156 *** [main] (NullableType.java:46) *** binding '0' to parameter: 4
DEBUG *** 08/12/2004 09:30:59,156 *** [main] (NullableType.java:46) *** binding '0.0' to parameter: 5
DEBUG *** 08/12/2004 09:30:59,172 *** [main] (NullableType.java:46) *** binding '0.0' to parameter: 6
DEBUG *** 08/12/2004 09:30:59,172 *** [main] (AbstractEntityPersister.java:1236) *** Natively generated identity: 353
DEBUG *** 08/12/2004 09:30:59,172 *** [main] (BatcherImpl.java:207) *** done closing: 0 open PreparedStatements, 0 open ResultSets
DEBUG *** 08/12/2004 09:30:59,172 *** [main] (BatcherImpl.java:269) *** closing statement
DEBUG *** 08/12/2004 09:30:59,172 *** [main] (Cascades.java:497) *** processing cascades for: be.smalsmvm.spi.tools.report.bo.Library
DEBUG *** 08/12/2004 09:30:59,172 *** [main] (Cascades.java:524) *** cascading to collection: be.smalsmvm.spi.tools.report.bo.Library.reportLibraries
DEBUG *** 08/12/2004 09:30:59,172 *** [main] (Cascades.java:506) *** done processing cascades for: be.smalsmvm.spi.tools.report.bo.Library
DEBUG *** 08/12/2004 09:30:59,172 *** [main] (Cascades.java:113) *** cascading to saveOrUpdate()
DEBUG *** 08/12/2004 09:30:59,172 *** [main] (Cascades.java:312) *** id unsaved-value: 0
DEBUG *** 08/12/2004 09:30:59,172 *** [main] (SessionImpl.java:1387) *** saveOrUpdate() unsaved instance
DEBUG *** 08/12/2004 09:30:59,172 *** [main] (SessionImpl.java:825) *** saving [be.smalsmvm.spi.tools.report.bo.Library#<null>]
DEBUG *** 08/12/2004 09:30:59,188 *** [main] (SessionImpl.java:2309) *** executing insertions
DEBUG *** 08/12/2004 09:30:59,188 *** [main] (Cascades.java:497) *** processing cascades for: be.smalsmvm.spi.tools.report.bo.Library
DEBUG *** 08/12/2004 09:30:59,188 *** [main] (Cascades.java:506) *** done processing cascades for: be.smalsmvm.spi.tools.report.bo.Library
DEBUG *** 08/12/2004 09:30:59,188 *** [main] (WrapVisitor.java:81) *** Wrapped collection in role: be.smalsmvm.spi.tools.report.bo.Library.reportLibraries
DEBUG *** 08/12/2004 09:30:59,188 *** [main] (EntityPersister.java:490) *** Inserting entity: be.smalsmvm.spi.tools.report.bo.Library (native id)
DEBUG *** 08/12/2004 09:30:59,188 *** [main] (BatcherImpl.java:200) *** about to open: 0 open PreparedStatements, 0 open ResultSets
DEBUG *** 08/12/2004 09:30:59,188 *** [main] (BatcherImpl.java:226) *** insert into LIBRARIES (name, provider, number_of_projects, type, maximum_reuse, minimum_reuse) values (?, ?, ?, ?, ?, ?)
DEBUG *** 08/12/2004 09:30:59,188 *** [main] (BatcherImpl.java:249) *** preparing statement
DEBUG *** 08/12/2004 09:30:59,188 *** [main] (EntityPersister.java:388) *** Dehydrating entity: [be.smalsmvm.spi.tools.report.bo.Library#<null>]
DEBUG *** 08/12/2004 09:30:59,188 *** [main] (NullableType.java:46) *** binding 'log4j-1.2.8' to parameter: 1
DEBUG *** 08/12/2004 09:30:59,188 *** [main] (NullableType.java:46) *** binding '0' to parameter: 2
DEBUG *** 08/12/2004 09:30:59,188 *** [main] (NullableType.java:46) *** binding '0' to parameter: 3
DEBUG *** 08/12/2004 09:30:59,188 *** [main] (NullableType.java:46) *** binding '0' to parameter: 4
DEBUG *** 08/12/2004 09:30:59,188 *** [main] (NullableType.java:46) *** binding '0.0' to parameter: 5
DEBUG *** 08/12/2004 09:30:59,188 *** [main] (NullableType.java:46) *** binding '0.0' to parameter: 6
DEBUG *** 08/12/2004 09:30:59,203 *** [main] (AbstractEntityPersister.java:1236) *** Natively generated identity: 354
DEBUG *** 08/12/2004 09:30:59,203 *** [main] (BatcherImpl.java:207) *** done closing: 0 open PreparedStatements, 0 open ResultSets
DEBUG *** 08/12/2004 09:30:59,203 *** [main] (BatcherImpl.java:269) *** closing statement
DEBUG *** 08/12/2004 09:30:59,203 *** [main] (Cascades.java:497) *** processing cascades for: be.smalsmvm.spi.tools.report.bo.Library
DEBUG *** 08/12/2004 09:30:59,203 *** [main] (Cascades.java:524) *** cascading to collection: be.smalsmvm.spi.tools.report.bo.Library.reportLibraries
DEBUG *** 08/12/2004 09:30:59,203 *** [main] (Cascades.java:506) *** done processing cascades for: be.smalsmvm.spi.tools.report.bo.Library
DEBUG *** 08/12/2004 09:30:59,203 *** [main] (Cascades.java:524) *** cascading to collection: be.smalsmvm.spi.tools.report.bo.SubProject.dependencies
DEBUG *** 08/12/2004 09:30:59,203 *** [main] (Cascades.java:506) *** done processing cascades for: be.smalsmvm.spi.tools.report.bo.SubProject
DEBUG *** 08/12/2004 09:30:59,203 *** [main] (Cascades.java:506) *** done processing cascades for: be.smalsmvm.spi.tools.report.bo.Project
DEBUG *** 08/12/2004 09:30:59,203 *** [main] (SessionImpl.java:1986) *** loading [be.smalsmvm.spi.tools.report.bo.Project#1]
DEBUG *** 08/12/2004 09:30:59,203 *** [main] (SessionImpl.java:2083) *** attempting to resolve [be.smalsmvm.spi.tools.report.bo.Project#1]
DEBUG *** 08/12/2004 09:30:59,203 *** [main] (SessionImpl.java:2099) *** resolved object in session cache [be.smalsmvm.spi.tools.report.bo.Project#1]

_________________
Oli


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