title: Hibernate: Value too long for column
body: <p>For a project I am working on, we use Spring Boot JPA with H2 database to store certain objects and information. However, after testing the application a bit, I got the following error:</p>
  <pre><code>2022-04-03 17:41:19 jdbc[3]: exception
  org.h2.jdbc.JdbcSQLDataException: Value too long for column &quot;LIST_OF_PLAYERS VARBINARY(255)&quot;: &quot;X'aced0005737200136a6176612e7574696c2e41727261794c6973747881d21d99c7619d03000149000473697a6578700000000a77040000000a7372000e6a61... (262)&quot;; SQL statement:
  update lobby set host_id=?, is_public=?, is_started=?, list_of_players=?, token=? where id=? [22001-200]
  </code></pre>
  <p>So I figured that I had to change the maximum allowed number of characters and did the following:</p>
  <pre><code>@Column(name = &quot;listOfPlayers&quot;, length = 10000)
  public ArrayList&lt;Long&gt; playerIds;
  </code></pre>
  <p>It appears that the length attribute only works for VARCHAR and not for VARBINARY. Is it possible to set the maximum for VARBINARY too? If so how?</p>