/**
  * setAttrInvokeAccessor: generated method. Do not modify.
  *
  * @param index the index identifying the attribute
  * @param value the value to assign to the attribute
  * @param attrDef the attribute
  * @throws Exception
  */
 protected void setAttrInvokeAccessor(int index, Object value, AttributeDefImpl attrDef)
     throws Exception {
   if ((index >= AttributesEnum.firstIndex()) && (index < AttributesEnum.count())) {
     AttributesEnum.staticValues()[index - AttributesEnum.firstIndex()].put(this, value);
     return;
   }
   super.setAttrInvokeAccessor(index, value, attrDef);
 }
  /**
   * 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 locking logic here. */
 public void lock() {
   super.lock();
 }