application specific seed data population

Posted by user339108 on Stack Overflow See other posts from Stack Overflow or by user339108
Published on 2010-06-11T04:36:11Z Indexed on 2010/06/11 4:42 UTC
Read the original article Hit count: 216

Filed under:
|
|

Env: JBoss, (h2, MySQl, postgres), JPA, Hibernate 3.3.x

@Id
@GeneratedValue(strategy = IDENTITY)
private Integer key;
  1. Currently our primary keys are created using the above annotation. We expect to support a large number of users (~million users), what key should be used. Should it be Integer or Long or should I use the unsigned versions of the above declarations.

  2. We have a j2ee application which needs to be populated with some seed data on installation. On purchase, the customer creates his own data on top of the application. We just want to make sure that there is enough room to ship, modify or add data for future releases. What would be the best mechanism to support this, we had looked at starting all table identifiers from a certain id (say 1000) but this mandates modifying primary key generation to have table or sequence based generators and we have around ~100 tables. We are not sure if this is the right strategy for this.

If we use a signed integer approach for the key, would it make sense to have the seed data as everything starting from 0 and below (i.e -ve numbers), so that all customer specific data will be available on 0 and above (i.e. +ve numbers)

© Stack Overflow or respective owner

Related posts about hibernate

Related posts about database-design