title: How to generate an alphanumeric ID in java?
body: <p>I have a table named GROUPS which has a column <strong>GROUP_ID</strong> whose values are </p>
  
  <blockquote>
    <p>GRP001, GRP002, GRP003</p>
  </blockquote>
  
  <p>and so on. Now every time I insert a new row I have to insert it with a
   (current) GROUP_ID= (highest)GROUP_ID+ 1 , for example if highest GROUP_ID= GRP003 I have to generate a new GROUP_ID GRP004 when I insert a new row.</p>
  
  <p>How can I do this using java?</p>
  
  <p>I am currently using Hibernate along with Struts 2 in my program</p>
  
  <p>Is there any way to deal with this using hibernate? Or will I have to write additional code to lock the table, check the db for max Id (and then increment it) and finally release the lock? </p>