I am getting unsufficient privilages error while generating sequence.
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "eventId_seq")
@SequenceGenerator(name = "eventId_seq", sequenceName = "Event_seq",allocationSize = 1)
private int eventId ;
grant usage on sequence XYZ.eventId_seq to XYZ
If sequence is in XYZ schema you don't need any grant to use it. But you may need grant to create sequence to user utilised to connect database (I guess it is XYZ):
grant create sequence to XYZ;