Leider bin ich mir da sicher, denn wenn ich hibernate die ID generiren lasse, ist das feld, welches ich gerne als ID hätte, nachher gefüllt.
Hier ist mal, was ich im Log finde, wenn ich hibernate seine ID verwenden lasse (er kommt da gerade vom verewigen der substruktur wieder, wenn du davor noch was brauchst, einfach melden):
Code:
...
DEBUG QueueWorker org.hibernate.event.def.DefaultSaveOrUpdateEventListener - saving transient instance
DEBUG QueueWorker org.hibernate.event.def.AbstractSaveEventListener - saving [de.arvato.repository.emi.impl.ProductImpl#<null>]
DEBUG QueueWorker org.hibernate.event.def.AbstractSaveEventListener - executing insertions
DEBUG Finalizer org.hibernate.jdbc.ConnectionManager - running Session.finalize()
DEBUG Finalizer org.hibernate.jdbc.ConnectionManager - running Session.finalize()
DEBUG Finalizer org.hibernate.jdbc.ConnectionManager - running Session.finalize()
DEBUG QueueWorker org.hibernate.engine.Cascades - processing cascade ACTION_SAVE_UPDATE for: de.arvato.repository.emi.impl.ProductImpl
DEBUG QueueWorker org.hibernate.engine.Cascades - cascading to saveOrUpdate: de.arvato.repository.emi.ProdRegional
...
DEBUG QueueWorker org.hibernate.engine.Cascades - done processing cascade ACTION_SAVE_UPDATE for: de.arvato.repository.emi.impl.ProductImpl
DEBUG QueueWorker org.hibernate.engine.Versioning - Seeding: 0
DEBUG QueueWorker org.hibernate.persister.entity.BasicEntityPersister - Inserting entity: de.arvato.repository.emi.impl.ProductImpl (native id)
DEBUG QueueWorker org.hibernate.persister.entity.BasicEntityPersister - Version: 0
DEBUG QueueWorker org.hibernate.jdbc.AbstractBatcher - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
DEBUG QueueWorker org.hibernate.SQL - insert into Product (Hjversion, Regional, DisplayArtist, PNoticeNationality, Grid, PNotice, Label, RepertoireOwner, AvailableTerritories, Contributors, Components, TotalComponents, LabelGroup, ParentalAdvisory, LocalTitle, DigitalOnly, Genre, Bundled, LocalArtist, DigitalIcpn, CNotice, TotalTracks, ProductType, Title, TotalDuration, DigitalUpc, Hjtype) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 'de.arvato.repository.emi.Product')
DEBUG QueueWorker org.hibernate.jdbc.AbstractBatcher - preparing statement
DEBUG QueueWorker org.hibernate.persister.entity.BasicEntityPersister - Dehydrating entity: [de.arvato.repository.emi.impl.ProductImpl#<null>]
DEBUG QueueWorker org.hibernate.type.LongType - binding '0' to parameter: 1
DEBUG QueueWorker org.hibernate.type.LongType - binding '1' to parameter: 2
DEBUG QueueWorker org.hibernate.type.StringType - binding 'Starsailor' to parameter: 3
DEBUG QueueWorker org.hibernate.type.StringType - binding '' to parameter: 4
DEBUG QueueWorker org.hibernate.type.StringType - binding '' to parameter: 5
DEBUG QueueWorker org.hibernate.type.StringType - binding '(P) 2005 The copyright in this sound recording is owned by EMI Records Ltd' to parameter: 6
DEBUG QueueWorker org.hibernate.type.StringType - binding 'EMI UK' to parameter: 7
DEBUG QueueWorker org.hibernate.type.StringType - binding 'EMI UK' to parameter: 8
DEBUG QueueWorker org.hibernate.type.LongType - binding '1' to parameter: 9
DEBUG QueueWorker org.hibernate.type.LongType - binding '1' to parameter: 10
DEBUG QueueWorker org.hibernate.type.LongType - binding '1' to parameter: 11
DEBUG QueueWorker org.hibernate.type.BigIntegerType - binding '1' to parameter: 12
DEBUG QueueWorker org.hibernate.type.StringType - binding 'EMI UK' to parameter: 13
DEBUG QueueWorker org.hibernate.type.StringType - binding 'No' to parameter: 14
DEBUG QueueWorker org.hibernate.type.StringType - binding '' to parameter: 15
DEBUG QueueWorker org.hibernate.type.StringType - binding 'No' to parameter: 16
DEBUG QueueWorker org.hibernate.type.StringType - binding 'Pop' to parameter: 17
DEBUG QueueWorker org.hibernate.type.StringType - binding 'No' to parameter: 18
DEBUG QueueWorker org.hibernate.type.StringType - binding '' to parameter: 19
DEBUG QueueWorker org.hibernate.type.StringType - binding '0094634227452' to parameter: 20
DEBUG QueueWorker org.hibernate.type.StringType - binding '(C) 2005 EMI Records Ltd This label copy information is the subject of copyright protection. All rights reserved. (C) 2005 EMI Records Ltd' to parameter: 21
DEBUG QueueWorker org.hibernate.type.BigIntegerType - binding '11' to parameter: 22
DEBUG QueueWorker org.hibernate.type.StringType - binding 'Album' to parameter: 23
DEBUG QueueWorker org.hibernate.type.StringType - binding 'On The Outside' to parameter: 24
DEBUG QueueWorker org.hibernate.type.StringType - binding '00:38:35' to parameter: 25
DEBUG QueueWorker org.hibernate.type.StringType - binding '094634227452' to parameter: 26
DEBUG QueueWorker org.hibernate.id.IdentifierGeneratorFactory - Natively generated identity: 1
DEBUG QueueWorker org.hibernate.jdbc.AbstractBatcher - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
DEBUG QueueWorker org.hibernate.jdbc.AbstractBatcher - closing statement
DEBUG QueueWorker org.hibernate.engine.Cascades - processing cascade ACTION_SAVE_UPDATE for: de.arvato.repository.emi.impl.ProductImpl
DEBUG QueueWorker org.hibernate.engine.Cascades - done processing cascade ACTION_SAVE_UPDATE for: de.arvato.repository.emi.impl.ProductImpl
Und so sieht es aus, wenn ich die DigitalIcpn als id verwenden möchte (die ist gefüllt, siehe parameter 20 oben)
Code:
...
DEBUG QueueWorker org.hibernate.event.def.DefaultSaveOrUpdateEventListener - saving transient instance
DEBUG QueueWorker org.hibernate.event.def.AbstractSaveEventListener - generated identifier: 0094634227452, using strategy: org.hibernate.id.Assigned
DEBUG QueueWorker org.hibernate.event.def.AbstractSaveEventListener - saving [de.arvato.repository.emi.impl.ProductImpl#0094634227452]
DEBUG QueueWorker org.hibernate.engine.Cascades - processing cascade ACTION_SAVE_UPDATE for: de.arvato.repository.emi.impl.ProductImpl
DEBUG QueueWorker org.hibernate.engine.Cascades - cascading to saveOrUpdate: de.arvato.repository.emi.ProdRegional
...
DEBUG QueueWorker org.hibernate.engine.Cascades - done processing cascade ACTION_SAVE_UPDATE for: de.arvato.repository.emi.impl.ProductImpl
DEBUG QueueWorker org.hibernate.engine.Versioning - Seeding: 0
DEBUG QueueWorker org.hibernate.engine.Cascades - processing cascade ACTION_SAVE_UPDATE for: de.arvato.repository.emi.impl.ProductImpl
DEBUG QueueWorker org.hibernate.engine.Cascades - done processing cascade ACTION_SAVE_UPDATE for: de.arvato.repository.emi.impl.ProductImpl
DEBUG QueueWorker de.arvato.repository.emi.EmiProductDataHandler - Imported product 0094634227452