6 Replies Latest reply: Jul 8, 2009 7:09 PM by 796440 RSS

    Using enums and datatypes? Please see.

    807588
      I am using an enum in my trade object.
      public class Trade  {
      
                    private int tradeQty;
                    private int tradePrice;
           private TradeStatus status;
           
           public enum TradeStatus
           {
               NEW,
               AUTHORISED,
               VERIFIED,
               TERMINATED,
           }
      
      
                   public Trade(){
      
                   }
      
      
                  // Trade Status.
                  public void setTradeStatus(TradeStatus status){
                this.status = status;
                  }
           
           public TradeStatus getTradeStatus(){
                return this.status;
           }
      }
      Now this trade is stored in the database,but what should the datatype of the tradestatus column be ?(store status value like NEW,VERIFIED)?
      I am using MYSQL/Hibernate and the Trade is a POJO.

      Please can anyone help?