/**
   * Custom DML update/insert/delete logic here.
   *
   * @param i the operation type
   * @param e the transaction event
   */
  protected void doDML(int i, TransactionEvent e) {

    if (i == DML_INSERT) {
      SequenceImpl si = new SequenceImpl("SEQ_BK_BARCODE_HISTORY_ID", getDBTransaction());
      setArtId(new DBSequence(si.getSequenceNumber()));
    }
    super.doDML(i, e);
  }
  /**
   * Custom DML update/insert/delete logic here.
   *
   * @param operation the operation type
   * @param e the transaction event
   */
  protected void doDML(int operation, TransactionEvent e) {
    try {
      if (operation != DML_DELETE) {
        setTitle(ParsiUtil.clearString(getTitle()));
      }

      if (operation == DML_INSERT) {
        if (chkDup()) throw new ParsiException("عنوان قراردادی تکراری است.");
        SequenceImpl si = new SequenceImpl("LIBRARY.SEQ_UNIFORM_TITLE_ART_ID", getDBTransaction());
        setArtId(new DBSequence(si.getSequenceNumber()));

      } else if (operation == DML_UPDATE) {
        if (!ParsiUtil.stringToZeroValue(getTitle()).equals(getPostedAttribute(TITLE))) {
          if (chkDup()) throw new ParsiException("عنوان قراردادی تکراری است.");
        }
      }
      super.doDML(operation, e);
    } catch (Exception ex) {
      if (ex instanceof ParsiException) {
        throw new JboException(((ParsiException) ex).getMessage());
      } else throw new JboException("خطا در ذخیره کردن رکورد عنوان قراردادی");
    }
  }
 /**
  * Add attribute defaulting logic in this method.
  *
  * @param attributeList list of attribute names/values to initialize the row
  */
 protected void create(AttributeList attributeList) {
   super.create(attributeList);
   SequenceImpl sequenceImpl = new SequenceImpl("CAP_SND_TO_GRP_S01", getDBTransaction());
   setId(sequenceImpl.getSequenceNumber());
 }
 /**
  * Add attribute defaulting logic in this method.
  *
  * @param attributeList list of attribute names/values to initialize the row
  */
 protected void create(AttributeList attributeList) {
   super.create(attributeList);
   SequenceImpl si = new SequenceImpl("cms_book_export_html_s", this.getDBTransaction());
   this.setExportId(si.getSequenceNumber());
 }