Here's a fuller debug log. As you can see, it's reading the identity value out of the One insert correctly. It's just not putting that value in the Many insert.
Code:
[java] Mar 17, 2005 3:10:42 PM org.hibernate.transaction.JDBCTransaction begin
[java] FINE: begin
[java] Mar 17, 2005 3:10:42 PM org.hibernate.jdbc.AbstractBatcher openConnection
[java] FINE: opening JDBC connection
[java] Mar 17, 2005 3:10:42 PM org.hibernate.connection.DriverManagerConnectionProvider getConnection
[java] FINEST: total checked-out connections: 0
[java] Mar 17, 2005 3:10:42 PM org.hibernate.connection.DriverManagerConnectionProvider getConnection
[java] FINEST: using pooled JDBC connection, pool size: 0
[java] Mar 17, 2005 3:10:42 PM org.hibernate.transaction.JDBCTransaction begin
[java] FINE: current autocommit status: false
[java] Mar 17, 2005 3:10:42 PM org.hibernate.engine.Cascades$IdentifierValue isUnsaved
[java] FINEST: id unsaved-value: 0
[java] Mar 17, 2005 3:10:42 PM org.hibernate.event.def.AbstractSaveEventListener getEntityState
[java] FINEST: transient instance of: test.One
[java] Mar 17, 2005 3:10:42 PM org.hibernate.event.def.DefaultPersistEventListener entityIsTransient
[java] FINEST: saving transient instance
[java] Mar 17, 2005 3:10:42 PM org.hibernate.event.def.AbstractSaveEventListener saveWithGeneratedId
[java] FINE: generated identifier: , using strategy: org.hibernate.id.IdentityGenerator
[java] Mar 17, 2005 3:10:42 PM org.hibernate.event.def.AbstractSaveEventListener performSave
[java] FINEST: saving [test.One#<null>]
[java] Mar 17, 2005 3:10:42 PM org.hibernate.event.def.AbstractSaveEventListener performSaveOrReplicate
[java] FINEST: executing insertions
[java] Mar 17, 2005 3:10:42 PM org.hibernate.engine.Cascades cascade
[java] FINEST: processing cascade ACTION_PERSIST for: test.One
[java] Mar 17, 2005 3:10:42 PM org.hibernate.engine.Cascades cascade
[java] FINEST: done processing cascade ACTION_PERSIST for: test.One
[java] Mar 17, 2005 3:10:42 PM org.hibernate.event.def.WrapVisitor processArrayOrNewCollection
[java] FINEST: Wrapped collection in role: test.One.many
[java] Mar 17, 2005 3:10:42 PM org.hibernate.persister.entity.BasicEntityPersister insert
[java] FINEST: Inserting entity: test.One (native id)
[java] Mar 17, 2005 3:10:42 PM org.hibernate.jdbc.AbstractBatcher logOpenPreparedStatement
[java] FINE: about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
[java] Mar 17, 2005 3:10:42 PM org.hibernate.jdbc.AbstractBatcher log
[java] FINE: insert into One values ( )
[java] Mar 17, 2005 3:10:42 PM org.hibernate.jdbc.AbstractBatcher getPreparedStatement
[java] FINEST: preparing statement
[java] Mar 17, 2005 3:10:42 PM org.hibernate.persister.entity.BasicEntityPersister dehydrate
[java] FINEST: Dehydrating entity: [test.One#<null>]
[java] Mar 17, 2005 3:10:42 PM org.hibernate.id.IdentifierGeneratorFactory getGeneratedIdentity
[java] FINE: Natively generated identity: 3
[java] Mar 17, 2005 3:10:42 PM org.hibernate.jdbc.AbstractBatcher logClosePreparedStatement
[java] FINE: about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
[java] Mar 17, 2005 3:10:42 PM org.hibernate.jdbc.AbstractBatcher closePreparedStatement
[java] FINEST: closing statement
[java] Mar 17, 2005 3:10:42 PM org.hibernate.engine.Cascades cascade
[java] FINEST: processing cascade ACTION_PERSIST for: test.One
[java] Mar 17, 2005 3:10:42 PM org.hibernate.engine.Cascades cascadeCollection
[java] FINEST: cascade ACTION_PERSIST for collection: test.One.many
[java] Mar 17, 2005 3:10:42 PM org.hibernate.engine.Cascades$8 cascade
[java] FINEST: cascading to persist: test.Many
[java] Mar 17, 2005 3:10:42 PM org.hibernate.engine.Cascades$IdentifierValue isUnsaved
[java] FINEST: id unsaved-value: 0
[java] Mar 17, 2005 3:10:42 PM org.hibernate.event.def.AbstractSaveEventListener getEntityState
[java] FINEST: transient instance of: test.Many
[java] Mar 17, 2005 3:10:42 PM org.hibernate.event.def.DefaultPersistEventListener entityIsTransient
[java] FINEST: saving transient instance
[java] Mar 17, 2005 3:10:42 PM org.hibernate.event.def.AbstractSaveEventListener saveWithGeneratedId
[java] FINE: generated identifier: , using strategy: org.hibernate.id.IdentityGenerator
[java] Mar 17, 2005 3:10:42 PM org.hibernate.event.def.AbstractSaveEventListener performSave
[java] FINEST: saving [test.Many#<null>]
[java] Mar 17, 2005 3:10:42 PM org.hibernate.event.def.AbstractSaveEventListener performSaveOrReplicate
[java] FINEST: executing insertions
[java] Mar 17, 2005 3:10:42 PM org.hibernate.persister.entity.BasicEntityPersister insert
[java] FINEST: Inserting entity: test.Many (native id)
[java] Mar 17, 2005 3:10:42 PM org.hibernate.jdbc.AbstractBatcher logOpenPreparedStatement
[java] FINE: about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
[java] Mar 17, 2005 3:10:42 PM org.hibernate.jdbc.AbstractBatcher log
[java] FINE: insert into Many (oneId) values (?)
[java] Mar 17, 2005 3:10:42 PM org.hibernate.jdbc.AbstractBatcher getPreparedStatement
[java] FINEST: preparing statement
[java] Mar 17, 2005 3:10:42 PM org.hibernate.persister.entity.BasicEntityPersister dehydrate
[java] FINEST: Dehydrating entity: [test.Many#<null>]
[java] Mar 17, 2005 3:10:42 PM org.hibernate.type.NullableType nullSafeSet
[java] FINEST: binding null to parameter: 1
[java] Mar 17, 2005 3:10:42 PM org.hibernate.id.IdentifierGeneratorFactory getGeneratedIdentity
[java] FINE: Natively generated identity: 3
[java] Mar 17, 2005 3:10:42 PM org.hibernate.jdbc.AbstractBatcher logClosePreparedStatement
[java] FINE: about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
[java] Mar 17, 2005 3:10:42 PM org.hibernate.jdbc.AbstractBatcher closePreparedStatement
[java] FINEST: closing statement
[java] Mar 17, 2005 3:10:42 PM org.hibernate.engine.Cascades cascadeCollection
[java] FINEST: done cascade ACTION_PERSIST for collection: test.One.many
[java] Mar 17, 2005 3:10:42 PM org.hibernate.engine.Cascades cascade
[java] FINEST: done processing cascade ACTION_PERSIST for: test.One
[java] Mar 17, 2005 3:10:42 PM org.hibernate.transaction.JDBCTransaction commit
[java] FINE: commit
[java] Mar 17, 2005 3:10:42 PM org.hibernate.impl.SessionImpl managedFlush
[java] FINEST: automatically flushing session
[java] Mar 17, 2005 3:10:42 PM org.hibernate.event.def.AbstractFlushingEventListener flushEverythingToExecutions
[java] FINEST: flushing session
[java] Mar 17, 2005 3:10:42 PM org.hibernate.event.def.AbstractFlushingEventListener prepareEntityFlushes
[java] FINE: processing flush-time cascades
[java] Mar 17, 2005 3:10:42 PM org.hibernate.engine.Cascades cascade
[java] FINEST: processing cascade ACTION_SAVE_UPDATE for: test.One
[java] Mar 17, 2005 3:10:42 PM org.hibernate.engine.Cascades cascadeCollection
[java] FINEST: cascade ACTION_SAVE_UPDATE for collection: test.One.many
[java] Mar 17, 2005 3:10:42 PM org.hibernate.engine.Cascades$5 cascade
[java] FINEST: cascading to saveOrUpdate: test.Many
[java] Mar 17, 2005 3:10:42 PM org.hibernate.event.def.AbstractSaveEventListener getEntityState
[java] FINEST: persistent instance of: test.Many
[java] Mar 17, 2005 3:10:42 PM org.hibernate.event.def.DefaultSaveOrUpdateEventListener entityIsPersistent
[java] FINEST: ignoring persistent instance
[java] Mar 17, 2005 3:10:42 PM org.hibernate.event.def.DefaultSaveOrUpdateEventListener entityIsPersistent
[java] FINEST: object already associated with session: [test.Many#3]
[java] Mar 17, 2005 3:10:42 PM org.hibernate.engine.Cascades cascadeCollection
[java] FINEST: done cascade ACTION_SAVE_UPDATE for collection: test.One.many
[java] Mar 17, 2005 3:10:42 PM org.hibernate.engine.Cascades cascade
[java] FINEST: done processing cascade ACTION_SAVE_UPDATE for: test.One
[java] Mar 17, 2005 3:10:42 PM org.hibernate.event.def.AbstractFlushingEventListener prepareCollectionFlushes
[java] FINE: dirty checking collections
[java] Mar 17, 2005 3:10:42 PM org.hibernate.event.def.AbstractFlushingEventListener flushEntities
[java] FINEST: Flushing entities and processing referenced collections
[java] Mar 17, 2005 3:10:43 PM org.hibernate.engine.Collections updateReachableCollection
[java] FINE: Collection found: [test.One.many#3], was: [<unreferenced>] (initialized)
[java] Mar 17, 2005 3:10:43 PM org.hibernate.event.def.AbstractFlushingEventListener flushCollections
[java] FINEST: Processing unreferenced collections
[java] Mar 17, 2005 3:10:43 PM org.hibernate.event.def.AbstractFlushingEventListener flushCollections
[java] FINEST: Scheduling collection removes/(re)creates/updates
[java] Mar 17, 2005 3:10:43 PM org.hibernate.event.def.AbstractFlushingEventListener flushEverythingToExecutions
[java] FINE: Flushed: 0 insertions, 0 updates, 0 deletions to 2 objects
[java] Mar 17, 2005 3:10:43 PM org.hibernate.event.def.AbstractFlushingEventListener flushEverythingToExecutions
[java] FINE: Flushed: 1 (re)creations, 0 updates, 0 removals to 1 collections
[java] Mar 17, 2005 3:10:43 PM org.hibernate.pretty.Printer toString
[java] FINE: listing entities:
[java] Mar 17, 2005 3:10:43 PM org.hibernate.pretty.Printer toString
[java] FINE: test.Many{one=null, id=3}
[java] Mar 17, 2005 3:10:43 PM org.hibernate.pretty.Printer toString
[java] FINE: test.One{many=[test.Many#3], id=3}
[java] Mar 17, 2005 3:10:43 PM org.hibernate.event.def.AbstractFlushingEventListener performExecutions
[java] FINEST: executing flush
[java] Mar 17, 2005 3:10:43 PM org.hibernate.event.def.AbstractFlushingEventListener postFlush
[java] FINEST: post flush
[java] Mar 17, 2005 3:10:43 PM org.hibernate.jdbc.JDBCContext beforeTransactionCompletion
[java] FINEST: before transaction completion
[java] Mar 17, 2005 3:10:43 PM org.hibernate.impl.SessionImpl beforeTransactionCompletion
[java] FINEST: before transaction completion
[java] Mar 17, 2005 3:10:43 PM org.hibernate.transaction.JDBCTransaction commit
[java] FINE: committed JDBC Connection
[java] Mar 17, 2005 3:10:43 PM org.hibernate.jdbc.JDBCContext afterTransactionCompletion
[java] FINEST: after transaction completion
[java] Mar 17, 2005 3:10:43 PM org.hibernate.impl.SessionImpl afterTransactionCompletion
[java] FINEST: after transaction completion
[java] Mar 17, 2005 3:10:43 PM org.hibernate.impl.SessionImpl close
[java] FINEST: closing session
[java] Mar 17, 2005 3:10:43 PM org.hibernate.jdbc.AbstractBatcher closeConnection
[java] FINE: closing JDBC connection (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)
[java] Mar 17, 2005 3:10:43 PM org.hibernate.connection.DriverManagerConnectionProvider closeConnection
[java] FINEST: returning connection to pool, pool size: 1
[java] Mar 17, 2005 3:10:43 PM org.hibernate.jdbc.JDBCContext afterTransactionCompletion
[java] FINEST: after transaction completion
[java] Mar 17, 2005 3:10:43 PM org.hibernate.impl.SessionImpl afterTransactionCompletion
[java] FINEST: after transaction completion