Question Jairton Junior · Feb 19, 2021 Is there a "SELECT LAST_SERIAL()"? When using "IDENTITY" as my primary key, I can select the last inserted ID with SELECT LAST_IDENTITY() FROM %TSQL_sys.snf; Actually this is how Hibernate + Iris' Driver acquires the inserted ID when mapping with @GeneratedValue(strategy = GenerationType.IDENTITY) Now, considering that I am using the type "SERIAL" as my primary key instead, how can I get the last inserted ID? Note that with "SERIAL" I can forcefully insert any value for this ID, from which Iris will continue generating values... #JDBC #SQL #InterSystems IRIS 0 1 0 274
Question Jairton Junior · Feb 11, 2021 Natural Key with Generated Field and Hibernate Consider a Natural Key with an Identity (Serial) field. I cannot seem to acquire the generated value after persisting my entity. That is, the returned entity by Spring Data's "save" does not have the generated value. The value is generated by the database, and I can query it after repository.save(entity). I have done some testing and created a Github repo with it... #Databases #Java #JDBC #InterSystems IRIS 0 1 0 207