So our project use PostgreSQL database and we use JPA for operating the database. We have created the entities from the database with automatic creator in Netbeans 7.1.2.
It seems you have to use the sequence generator like:
@GeneratedValue(generator="YOUR_SEQ",strategy=GenerationType.SEQUENCE)