Insert into h2 table if not exists
The merge statement should allow you to achieve what you want. I'm no expert on H2, but I've used the MERGE
statement in SQL Server several times and from the looks of that website it should do the trick.
From the website:
Updates existing rows, and insert rows that don't exist. If no key column is specified, the primary key columns are used to find the row.