strategy « Batch « JPA Q&A

1. Best ID generation strategy for large batch loading?

We have one table that contains consumer records. There are going to be vastly more consumers than anything else in our system (millions). We load up consumer data sometimes in batches of hundreds of thousands. Our current consumer mapping uses an id field like so: Code:

2. About batch fetching strategy

assume the relation between Item and Bid is one-to-many. I set the following code in the Item.hbm.xml: In my test code, I get three Item by calling the session.get() method, and I access the three items' bids. I think the Hibernate should load all three collections in a single SQL query, for ...