title: How to write enum column in java pojo class?
body: <p><a href="https://i.stack.imgur.com/7TLPB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7TLPB.png" alt="enter image description here"></a>In my database, I have a column of enum datatype. Below is the table structure.</p>
  
  <pre><code>CREATE TYPE STATUSENUM AS ENUM('Published','Draft','Expire');
  CREATE TABLE IF NOT EXISTS T_COMMODITY_INSIGHT(
      ID integer NOT NULL,
      COMMODITY_ID integer NOT NULL,
      CREATED_DATE date NOT NULL,
      MODIFIED_DATE date NOT NULL,
      STATUS STATUSENUM DEFAULT 'Draft',
      CONSTRAINT "T_COMMODITY_INSIGHT_pkey" PRIMARY KEY (ID)
  );
  </code></pre>
  
  <p>In my POJO class, How do I write enum column with getter &amp; setter method along with the parametrized constructor which accepts the value entered by the user &amp; How do I make sure that entered value of enum column has to be the one defined in the database?</p>
  
  <p>I am using Hibernate.</p>
  
  <p>Please let me know if additional information is required.</p>