I\'m having an Entity which has a primary key / id field like the following:
@Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id;
Look for Custom Id Generator
http://blog.anorakgirl.co.uk/2009/01/custom-hibernate-sequence-generator-for-id-field/
maybe this could help.