From my readings of the JBoss forums, JBoss 3.0.x doesn't support auto-incrementing PK keys. I understand it's at least partially supported in 3.2.x, although I seem to recall that JBoss' handling of PostgreSQL in this respect has some peculiarities about it. Search the EJB forum instead of the CMP forum and see what you come up with. serverside.com has previously made available a free PDF version of 'EJB Design Patterns'. It contains a section on how to manage primary keys in EJBs and even includes some EJB code (in its associated download) that handles primary key generation and assignment.