But i was working on example from http://www.screaming-penguin.com/node/4441 and the table used in this example does not contain any id column . I have gone through blue prints and it says about @GeneratedValue and identity. So, i tried to use it but that too failed.
The initialValue element is pretty self-explanatory. AllocationSize
specifies by how much the sequence is incremented each time a value is generated
The default values for initialValue and allocationSize are 0 and 50, respectively.
Do these two tables should have once field in common or the sequence value directly gets stored in sequence table.
Well, these both table's have no field common. The sequence value gets directly stored in your users table.
Taking your example- (@Id was missing in your code.)
Here it means Column name seq, will have unique value, everytime we do insert in users table table.
As in your case initialValue attribute value 0 will be defaulted. And everytime , you insert value it will be incremented by 1 as per allocation size.
In your entity, you have a field called "seq", but your user table doesn't have any column called "seq". You must make one in your user table. Also, as Amandeep said, this should be declared as being the primary key of the user table, so @Id must be set to the field.
The primary key, identified by "seq", will be retrieved from your "sequence" table, and set into the "seq" field of the user entity.