1 | if ( !veto ) {↵ | | |
|
2 | ↵ | | |
|
3 | persister.insert( id, state, instance, session );↵ | | |
|
4 | ↵ | | |
|
5 | EntityEntry entry = session.getPersistenceContext().getEntry( instance );↵ | | |
|
6 | if ( entry↵ | | 1 | collection = persistenceContext.useUnownedCollection( new CollectionKey(persister, key, entityMode) );↵
|
| | | 2 | ↵
|
7 | == null ) {↵ | | 3 | if ( collection == null ) {↵
|
8 | throw new AssertionFailure( "possible nonthreadsafe access to session" );↵ | | 4 | ↵
|
9 | }↵ | | |
|
10 | ↵ | | |
|
11 | entry.postInsert(↵ | | 5 | // create a new collection wrapper, to be initialized later↵
|
| | | 6 | collection = instantiate( session, persister, key );↵
|
12 | );↵ | | 7 | collection.setOwner(owner);↵
|
13 | ↵ | | 8 | ↵
|
14 | if ( persister.hasInsertGeneratedProperties() ) {↵ | | 9 | persiste↵
|
15 | persister.processInsertGeneratedProperties( id, instance, state, session );↵ | | |
|
16 | ↵ | | 10 | nceContext.addUninitializedCollection( persister, collection, key );↵
|
| | | 11 | ↵
|
| | | 12 | // some collections are not lazy:↵
|
| | | 13 | if ( initializeImmediately( entityMode ) ) {↵
|
| | | 14 | session.initializeCollection( collection, false );↵
|
| | | 15 | }↵
|
17 | if ( persister.isVersionPropertyGenerated() ) {↵ | | 16 | else if ( !persister.isLazy() ) {↵
|
18 | version = Versioning.getVersion(state, persister);↵ | | 17 | persistenceContext.addNonLazyCollection( collection );↵
|
19 | }↵ | | 18 | }↵
|
20 | ↵ | | 19 | ↵
|
21 | entry.postUpdate(in↵ | | 20 | if ( hasHolder( entityMode ) ) {↵
|
22 | stance, state, version);↵ | | 21 | session.getPersistenceContext().addCollectionHolder( collection );↵
|
23 | }↵ | | 22 | }↵
|
24 | ↵ | | 23 | ↵
|
| | | 24 | ↵
|
25 | } | | 25 | }
|