title: Specify a default value for a primary key column of type UUID in H2 Database Engine?
body: <p>This SQL:</p>
  
  <pre class="lang-sql prettyprint-override"><code>CREATE TABLE product_ ( 
      pkey_ UUID PRIMARY KEY
  ) ; 
  </code></pre>
  
  <p>…successfully creates a table. </p>
  
  <p>But I want new rows to default to a UUId generated by <a href="http://h2database.com/html/functions.html#random_uuid" rel="nofollow noreferrer"><code>RANDOM_UUID()</code></a> as shown on <a href="https://stackoverflow.com/a/41121779/642706">this Answer</a>.</p>
  
  <pre class="lang-sql prettyprint-override"><code>CREATE TABLE product_ ( 
      pkey_ UUID PRIMARY KEY DEFAULT RANDOM_UUID() 
  ) ; 
  </code></pre>
  
  <p>But this fails with an error:</p>
  
  <blockquote>
    <p>org.h2.jdbc.JdbcSQLException: Syntax error in SQL statement "CREATE TABLE PRODUCT_ ( 
      PKEY_ UUID PRIMARY KEY DEFAULT[*] RANDOM_UUID() 
    ) ;  "; expected "HASH, AUTO_INCREMENT, NOT, NULL, CHECK, REFERENCES, ,, )"; SQL statement:</p>
  </blockquote>
  
  <p>What is the cause and solution for this error?</p>