title: How to generate Custom Id using hibernate while it must be primary key of table
body: <p>Here is my pojo class</p>
  
  <pre><code>@Entity
  
  public class Department {
  
  
  @Id
  @GeneratedValue(strategy=GenerationType.IDENTITY)
  
  @Column(name="Department_Id")
  
  private Integer deptId;
  
  
  @Column(name="Department_Name",unique=true,nullable=false)
  private String deptName;
  
  
  @Column(name="Department_Description")
  @NotNull
  private String deptDesc;
     //geters and setters
  </code></pre>
  
  <p>What i want is that department_id must be primary key of this Department table and entries for this key must be as DEP0001, DEP0002,DEP0003</p>