I want to see the sequence number when I save an object into db using jpa.
Code:
@Id
@GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ")
@SequenceGenerator(name = "SEQ", sequenceName = "Temp_SEQ")
Property:
logging.level.org.hibernate.SQL=DEBUG
logging.level.org.hibernate.type=TRACE
I see the output as below,
insert into employee (emp_number, acquire, reason) values (null, ?, ?)
2017-12-12 14:36:20.634 TRACE 21048 --- [nio-8080-exec-8] o.h.type.descriptor.sql.BasicBinder : binding parameter [1] as [VARCHAR] - [YES]
2017-12-12 14:36:20.635 TRACE 21048 --- [nio-8080-exec-8] o.h.type.descriptor.sql.BasicBinder : binding parameter [2] as [VARCHAR] - [asdf]
but I am expecting the sequence number too as,
insert into case_selection (case_number, acquire, reason) values (null, ?, ?)
binding parameter [1] as [Long] - [1]
binding parameter [1] as [VARCHAR] - [YES]
binding parameter [1] as [VARCHAR] - [asdf]
Is there anyway I can get sequence number printed in case of hibernate or JPA?