// ---------------------------------------------------------------------
// ---    File generated by Oracle ADF Business Components Design Time.
// ---    Fri Jan 20 16:08:46 GMT+04:00 2012
// ---    Custom code may be added to this class.
// ---    Warning: Do not modify method signatures of generated methods.
// ---------------------------------------------------------------------
public class UniformTitleImpl extends TemplateEntityObject {
  private static EntityDefImpl mDefinitionObject;

  /** AttributesEnum: generated enum for identifying attributes and accessors. Do not modify. */
  public enum AttributesEnum {
    Labcol {
      public Object get(UniformTitleImpl obj) {
        return obj.getLabcol();
      }

      public void put(UniformTitleImpl obj, Object value) {
        obj.setLabcol((Number) value);
      }
    },
    Title {
      public Object get(UniformTitleImpl obj) {
        return obj.getTitle();
      }

      public void put(UniformTitleImpl obj, Object value) {
        obj.setTitle((String) value);
      }
    },
    ArtId {
      public Object get(UniformTitleImpl obj) {
        return obj.getArtId();
      }

      public void put(UniformTitleImpl obj, Object value) {
        obj.setArtId((DBSequence) value);
      }
    },
    ReferenceType {
      public Object get(UniformTitleImpl obj) {
        return obj.getReferenceType();
      }

      public void put(UniformTitleImpl obj, Object value) {
        obj.setReferenceType((Number) value);
      }
    },
    ReadingOrder {
      public Object get(UniformTitleImpl obj) {
        return obj.getReadingOrder();
      }

      public void put(UniformTitleImpl obj, Object value) {
        obj.setReadingOrder((Number) value);
      }
    },
    VirtualBook1 {
      public Object get(UniformTitleImpl obj) {
        return obj.getVirtualBook1();
      }

      public void put(UniformTitleImpl obj, Object value) {
        obj.setAttributeInternal(index(), value);
      }
    },
    VbookUniformTitle2 {
      public Object get(UniformTitleImpl obj) {
        return obj.getVbookUniformTitle2();
      }

      public void put(UniformTitleImpl obj, Object value) {
        obj.setAttributeInternal(index(), value);
      }
    },
    SeeUniformTitle {
      public Object get(UniformTitleImpl obj) {
        return obj.getSeeUniformTitle();
      }

      public void put(UniformTitleImpl obj, Object value) {
        obj.setSeeUniformTitle((SeeUniformTitleImpl) value);
      }
    },
    SeeAlsoUniformTitle1 {
      public Object get(UniformTitleImpl obj) {
        return obj.getSeeAlsoUniformTitle1();
      }

      public void put(UniformTitleImpl obj, Object value) {
        obj.setSeeAlsoUniformTitle1((SeeAlsoUniformTitleImpl) value);
      }
    },
    SeeAlsoUniformTitle {
      public Object get(UniformTitleImpl obj) {
        return obj.getSeeAlsoUniformTitle();
      }

      public void put(UniformTitleImpl obj, Object value) {
        obj.setAttributeInternal(index(), value);
      }
    },
    VirtualBook {
      public Object get(UniformTitleImpl obj) {
        return obj.getVirtualBook();
      }

      public void put(UniformTitleImpl obj, Object value) {
        obj.setAttributeInternal(index(), value);
      }
    },
    VbookUniformTitle1 {
      public Object get(UniformTitleImpl obj) {
        return obj.getVbookUniformTitle1();
      }

      public void put(UniformTitleImpl obj, Object value) {
        obj.setAttributeInternal(index(), value);
      }
    },
    DummyVO1 {
      public Object get(UniformTitleImpl obj) {
        return obj.getDummyVO1();
      }

      public void put(UniformTitleImpl obj, Object value) {
        obj.setAttributeInternal(index(), value);
      }
    };
    private static AttributesEnum[] vals = null;
    private static int firstIndex = 0;

    public abstract Object get(UniformTitleImpl object);

    public abstract void put(UniformTitleImpl object, Object value);

    public int index() {
      return AttributesEnum.firstIndex() + ordinal();
    }

    public static int firstIndex() {
      return firstIndex;
    }

    public static int count() {
      return AttributesEnum.firstIndex() + AttributesEnum.staticValues().length;
    }

    public static AttributesEnum[] staticValues() {
      if (vals == null) {
        vals = AttributesEnum.values();
      }
      return vals;
    }
  }

  public static final int LABCOL = AttributesEnum.Labcol.index();
  public static final int TITLE = AttributesEnum.Title.index();
  public static final int ARTID = AttributesEnum.ArtId.index();
  public static final int REFERENCETYPE = AttributesEnum.ReferenceType.index();
  public static final int READINGORDER = AttributesEnum.ReadingOrder.index();
  public static final int VIRTUALBOOK1 = AttributesEnum.VirtualBook1.index();
  public static final int VBOOKUNIFORMTITLE2 = AttributesEnum.VbookUniformTitle2.index();
  public static final int SEEUNIFORMTITLE = AttributesEnum.SeeUniformTitle.index();
  public static final int SEEALSOUNIFORMTITLE1 = AttributesEnum.SeeAlsoUniformTitle1.index();
  public static final int SEEALSOUNIFORMTITLE = AttributesEnum.SeeAlsoUniformTitle.index();
  public static final int VIRTUALBOOK = AttributesEnum.VirtualBook.index();
  public static final int VBOOKUNIFORMTITLE1 = AttributesEnum.VbookUniformTitle1.index();
  public static final int DUMMYVO1 = AttributesEnum.DummyVO1.index();

  /** This is the default constructor (do not remove). */
  public UniformTitleImpl() {}

  /** @return the definition object for this instance class. */
  public static synchronized EntityDefImpl getDefinitionObject() {
    if (mDefinitionObject == null) {
      mDefinitionObject =
          EntityDefImpl.findDefObject(
              "org.parsisys.tehranuniversity.library.model.eo.UniformTitle");
    }
    return mDefinitionObject;
  }

  /**
   * Gets the attribute value for Labcol, using the alias name Labcol.
   *
   * @return the Labcol
   */
  public Number getLabcol() {
    return (Number) getAttributeInternal(LABCOL);
  }

  /**
   * Sets <code>value</code> as the attribute value for Labcol.
   *
   * @param value value to set the Labcol
   */
  public void setLabcol(Number value) {
    setAttributeInternal(LABCOL, value);
  }

  /**
   * Gets the attribute value for Title, using the alias name Title.
   *
   * @return the Title
   */
  public String getTitle() {
    return (String) getAttributeInternal(TITLE);
  }

  /**
   * Sets <code>value</code> as the attribute value for Title.
   *
   * @param value value to set the Title
   */
  public void setTitle(String value) {
    setAttributeInternal(TITLE, value);
  }

  /**
   * Gets the attribute value for ArtId, using the alias name ArtId.
   *
   * @return the ArtId
   */
  public DBSequence getArtId() {
    return (DBSequence) getAttributeInternal(ARTID);
  }

  /**
   * Sets <code>value</code> as the attribute value for ArtId.
   *
   * @param value value to set the ArtId
   */
  public void setArtId(DBSequence value) {
    setAttributeInternal(ARTID, value);
  }

  /**
   * Gets the attribute value for ReferenceType, using the alias name ReferenceType.
   *
   * @return the ReferenceType
   */
  public Number getReferenceType() {
    return (Number) getAttributeInternal(REFERENCETYPE);
  }

  /**
   * Sets <code>value</code> as the attribute value for ReferenceType.
   *
   * @param value value to set the ReferenceType
   */
  public void setReferenceType(Number value) {
    setAttributeInternal(REFERENCETYPE, value);
  }

  /**
   * Gets the attribute value for ReadingOrder, using the alias name ReadingOrder.
   *
   * @return the ReadingOrder
   */
  public Number getReadingOrder() {
    return (Number) getAttributeInternal(READINGORDER);
  }

  /**
   * Sets <code>value</code> as the attribute value for ReadingOrder.
   *
   * @param value value to set the ReadingOrder
   */
  public void setReadingOrder(Number value) {
    setAttributeInternal(READINGORDER, value);
  }

  /**
   * getAttrInvokeAccessor: generated method. Do not modify.
   *
   * @param index the index identifying the attribute
   * @param attrDef the attribute
   * @return the attribute value
   * @throws Exception
   */
  protected Object getAttrInvokeAccessor(int index, AttributeDefImpl attrDef) throws Exception {
    if ((index >= AttributesEnum.firstIndex()) && (index < AttributesEnum.count())) {
      return AttributesEnum.staticValues()[index - AttributesEnum.firstIndex()].get(this);
    }
    return super.getAttrInvokeAccessor(index, attrDef);
  }

  /**
   * 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);
  }

  /** @return the associated entity oracle.jbo.RowIterator. */
  public RowIterator getVirtualBook1() {
    return (RowIterator) getAttributeInternal(VIRTUALBOOK1);
  }

  /** @return the associated entity oracle.jbo.RowIterator. */
  public RowIterator getVbookUniformTitle2() {
    return (RowIterator) getAttributeInternal(VBOOKUNIFORMTITLE2);
  }

  /** @return the associated entity SeeUniformTitleImpl. */
  public SeeUniformTitleImpl getSeeUniformTitle() {
    return (SeeUniformTitleImpl) getAttributeInternal(SEEUNIFORMTITLE);
  }

  /** Sets <code>value</code> as the associated entity SeeUniformTitleImpl. */
  public void setSeeUniformTitle(SeeUniformTitleImpl value) {
    setAttributeInternal(SEEUNIFORMTITLE, value);
  }

  /** @return the associated entity oracle.jbo.server.EntityImpl. */
  public SeeAlsoUniformTitleImpl getSeeAlsoUniformTitle1() {
    return (SeeAlsoUniformTitleImpl) getAttributeInternal(SEEALSOUNIFORMTITLE1);
  }

  /** Sets <code>value</code> as the associated entity oracle.jbo.server.EntityImpl. */
  public void setSeeAlsoUniformTitle1(SeeAlsoUniformTitleImpl value) {
    setAttributeInternal(SEEALSOUNIFORMTITLE1, value);
  }

  /** @return the associated entity oracle.jbo.RowIterator. */
  public RowIterator getSeeAlsoUniformTitle() {
    return (RowIterator) getAttributeInternal(SEEALSOUNIFORMTITLE);
  }

  /** @return the associated entity oracle.jbo.RowIterator. */
  public RowIterator getVirtualBook() {
    return (RowIterator) getAttributeInternal(VIRTUALBOOK);
  }

  /** @return the associated entity oracle.jbo.RowIterator. */
  public RowIterator getVbookUniformTitle1() {
    return (RowIterator) getAttributeInternal(VBOOKUNIFORMTITLE1);
  }

  /** Gets the view accessor <code>RowSet</code> DummyVO1. */
  public RowSet getDummyVO1() {
    return (RowSet) getAttributeInternal(DUMMYVO1);
  }

  /**
   * @param labcol key constituent
   * @param artId key constituent
   * @return a Key object based on given key constituents.
   */
  public static Key createPrimaryKey(Number labcol, DBSequence artId) {
    return new Key(new Object[] {labcol, artId});
  }

  /** Add locking logic here. */
  public void lock() {
    super.lock();
  }

  /**
   * 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("خطا در ذخیره کردن رکورد عنوان قراردادی");
    }
  }

  public boolean chkDup() {
    DummyVOImpl dummy = (DummyVOImpl) getDummyVO1().getViewObject();
    dummy.setQuery(
        "select art_id from uniform_title where nvl(upper(title),'0')='"
            + ParsiUtil.stringToZeroValue(getTitle()).toUpperCase().replaceAll("'", "''")
            + "' and labcol="
            + getDBTransaction().getSession().getUserData().get("labcolno"));
    dummy.executeQuery();
    return dummy.hasNext();
  }
}
// ---------------------------------------------------------------------
// ---    File generated by Oracle ADF Business Components Design Time.
// ---    Mon Apr 23 16:41:27 GMT+03:30 2012
// ---    Custom code may be added to this class.
// ---    Warning: Do not modify method signatures of generated methods.
// ---------------------------------------------------------------------
public class MemberImpl extends EntityImpl {
  private static EntityDefImpl mDefinitionObject;

  /** AttributesEnum: generated enum for identifying attributes and accessors. Do not modify. */
  public enum AttributesEnum {
    Labcol {
      public Object get(MemberImpl obj) {
        return obj.getLabcol();
      }

      public void put(MemberImpl obj, Object value) {
        obj.setLabcol((Number) value);
      }
    },
    ArtId {
      public Object get(MemberImpl obj) {
        return obj.getArtId();
      }

      public void put(MemberImpl obj, Object value) {
        obj.setArtId((Number) value);
      }
    },
    Description {
      public Object get(MemberImpl obj) {
        return obj.getDescription();
      }

      public void put(MemberImpl obj, Object value) {
        obj.setDescription((String) value);
      }
    },
    MemberExtentionHistory {
      public Object get(MemberImpl obj) {
        return obj.getMemberExtentionHistory();
      }

      public void put(MemberImpl obj, Object value) {
        obj.setAttributeInternal(index(), value);
      }
    },
    Loan {
      public Object get(MemberImpl obj) {
        return obj.getLoan();
      }

      public void put(MemberImpl obj, Object value) {
        obj.setAttributeInternal(index(), value);
      }
    },
    InitMember {
      public Object get(MemberImpl obj) {
        return obj.getInitMember();
      }

      public void put(MemberImpl obj, Object value) {
        obj.setAttributeInternal(index(), value);
      }
    },
    PublicCashPenalty {
      public Object get(MemberImpl obj) {
        return obj.getPublicCashPenalty();
      }

      public void put(MemberImpl obj, Object value) {
        obj.setAttributeInternal(index(), value);
      }
    },
    PublicNonCashPenalty {
      public Object get(MemberImpl obj) {
        return obj.getPublicNonCashPenalty();
      }

      public void put(MemberImpl obj, Object value) {
        obj.setAttributeInternal(index(), value);
      }
    },
    PenaltyPayment {
      public Object get(MemberImpl obj) {
        return obj.getPenaltyPayment();
      }

      public void put(MemberImpl obj, Object value) {
        obj.setAttributeInternal(index(), value);
      }
    },
    BookThesis {
      public Object get(MemberImpl obj) {
        return obj.getBookThesis();
      }

      public void put(MemberImpl obj, Object value) {
        obj.setAttributeInternal(index(), value);
      }
    },
    Reserve {
      public Object get(MemberImpl obj) {
        return obj.getReserve();
      }

      public void put(MemberImpl obj, Object value) {
        obj.setAttributeInternal(index(), value);
      }
    },
    Cashier {
      public Object get(MemberImpl obj) {
        return obj.getCashier();
      }

      public void put(MemberImpl obj, Object value) {
        obj.setAttributeInternal(index(), value);
      }
    };
    private static AttributesEnum[] vals = null;
    private static int firstIndex = 0;

    public abstract Object get(MemberImpl object);

    public abstract void put(MemberImpl object, Object value);

    public int index() {
      return AttributesEnum.firstIndex() + ordinal();
    }

    public static int firstIndex() {
      return firstIndex;
    }

    public static int count() {
      return AttributesEnum.firstIndex() + AttributesEnum.staticValues().length;
    }

    public static AttributesEnum[] staticValues() {
      if (vals == null) {
        vals = AttributesEnum.values();
      }
      return vals;
    }
  }

  public static final int LABCOL = AttributesEnum.Labcol.index();
  public static final int ARTID = AttributesEnum.ArtId.index();
  public static final int DESCRIPTION = AttributesEnum.Description.index();
  public static final int MEMBEREXTENTIONHISTORY = AttributesEnum.MemberExtentionHistory.index();
  public static final int LOAN = AttributesEnum.Loan.index();
  public static final int INITMEMBER = AttributesEnum.InitMember.index();
  public static final int PUBLICCASHPENALTY = AttributesEnum.PublicCashPenalty.index();
  public static final int PUBLICNONCASHPENALTY = AttributesEnum.PublicNonCashPenalty.index();
  public static final int PENALTYPAYMENT = AttributesEnum.PenaltyPayment.index();
  public static final int BOOKTHESIS = AttributesEnum.BookThesis.index();
  public static final int RESERVE = AttributesEnum.Reserve.index();
  public static final int CASHIER = AttributesEnum.Cashier.index();

  /** This is the default constructor (do not remove). */
  public MemberImpl() {}

  /** @return the definition object for this instance class. */
  public static synchronized EntityDefImpl getDefinitionObject() {
    if (mDefinitionObject == null) {
      mDefinitionObject =
          EntityDefImpl.findDefObject("org.parsisys.tehranuniversity.library.model.eo.Member");
    }
    return mDefinitionObject;
  }

  /**
   * Gets the attribute value for Labcol, using the alias name Labcol.
   *
   * @return the Labcol
   */
  public Number getLabcol() {
    return (Number) getAttributeInternal(LABCOL);
  }

  /**
   * Sets <code>value</code> as the attribute value for Labcol.
   *
   * @param value value to set the Labcol
   */
  public void setLabcol(Number value) {
    setAttributeInternal(LABCOL, value);
  }

  /**
   * Gets the attribute value for ArtId, using the alias name ArtId.
   *
   * @return the ArtId
   */
  public Number getArtId() {
    return (Number) getAttributeInternal(ARTID);
  }

  /**
   * Sets <code>value</code> as the attribute value for ArtId.
   *
   * @param value value to set the ArtId
   */
  public void setArtId(Number value) {
    setAttributeInternal(ARTID, value);
  }

  /**
   * Gets the attribute value for Description, using the alias name Description.
   *
   * @return the Description
   */
  public String getDescription() {
    return (String) getAttributeInternal(DESCRIPTION);
  }

  /**
   * Sets <code>value</code> as the attribute value for Description.
   *
   * @param value value to set the Description
   */
  public void setDescription(String value) {
    setAttributeInternal(DESCRIPTION, value);
  }

  /**
   * getAttrInvokeAccessor: generated method. Do not modify.
   *
   * @param index the index identifying the attribute
   * @param attrDef the attribute
   * @return the attribute value
   * @throws Exception
   */
  protected Object getAttrInvokeAccessor(int index, AttributeDefImpl attrDef) throws Exception {
    if ((index >= AttributesEnum.firstIndex()) && (index < AttributesEnum.count())) {
      return AttributesEnum.staticValues()[index - AttributesEnum.firstIndex()].get(this);
    }
    return super.getAttrInvokeAccessor(index, attrDef);
  }

  /**
   * 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);
  }

  /** @return the associated entity oracle.jbo.RowIterator. */
  public RowIterator getMemberExtentionHistory() {
    return (RowIterator) getAttributeInternal(MEMBEREXTENTIONHISTORY);
  }

  /** @return the associated entity oracle.jbo.RowIterator. */
  public RowIterator getLoan() {
    return (RowIterator) getAttributeInternal(LOAN);
  }

  /** @return the associated entity oracle.jbo.RowIterator. */
  public RowIterator getInitMember() {
    return (RowIterator) getAttributeInternal(INITMEMBER);
  }

  /** @return the associated entity oracle.jbo.RowIterator. */
  public RowIterator getPublicCashPenalty() {
    return (RowIterator) getAttributeInternal(PUBLICCASHPENALTY);
  }

  /** @return the associated entity oracle.jbo.RowIterator. */
  public RowIterator getPublicNonCashPenalty() {
    return (RowIterator) getAttributeInternal(PUBLICNONCASHPENALTY);
  }

  /** @return the associated entity oracle.jbo.RowIterator. */
  public RowIterator getPenaltyPayment() {
    return (RowIterator) getAttributeInternal(PENALTYPAYMENT);
  }

  /** @return the associated entity oracle.jbo.RowIterator. */
  public RowIterator getBookThesis() {
    return (RowIterator) getAttributeInternal(BOOKTHESIS);
  }

  /** @return the associated entity oracle.jbo.RowIterator. */
  public RowIterator getReserve() {
    return (RowIterator) getAttributeInternal(RESERVE);
  }

  /**
   * @param labcol key constituent
   * @param artId key constituent
   * @return a Key object based on given key constituents.
   */
  public static Key createPrimaryKey(Number labcol, Number artId) {
    return new Key(new Object[] {labcol, artId});
  }

  /** @return the associated entity oracle.jbo.RowIterator. */
  public RowIterator getCashier() {
    return (RowIterator) getAttributeInternal(CASHIER);
  }

  /**
   * 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);
  }

  /** Add entity remove logic in this method. */
  public void remove() {
    super.remove();
  }

  /** Add locking logic here. */
  public void lock() {
    super.lock();
  }

  /**
   * Custom DML update/insert/delete logic here.
   *
   * @param operation the operation type
   * @param e the transaction event
   */
  protected void doDML(int operation, TransactionEvent e) {
    super.doDML(operation, e);
  }
}
// ---------------------------------------------------------------------
// ---    File generated by Oracle ADF Business Components Design Time.
// ---    Tue May 22 13:05:30 GMT+04:00 2012
// ---    Custom code may be added to this class.
// ---    Warning: Do not modify method signatures of generated methods.
// ---------------------------------------------------------------------
public class LibUserVoRowImpl extends TemplateViewRow {
  /** AttributesEnum: generated enum for identifying attributes and accessors. Do not modify. */
  public enum AttributesEnum {
    Enable {
      public Object get(LibUserVoRowImpl obj) {
        return obj.getEnable();
      }

      public void put(LibUserVoRowImpl obj, Object value) {
        obj.setEnable((Number) value);
      }
    },
    Labcol {
      public Object get(LibUserVoRowImpl obj) {
        return obj.getLabcol();
      }

      public void put(LibUserVoRowImpl obj, Object value) {
        obj.setLabcol((Number) value);
      }
    },
    Name {
      public Object get(LibUserVoRowImpl obj) {
        return obj.getName();
      }

      public void put(LibUserVoRowImpl obj, Object value) {
        obj.setName((String) value);
      }
    },
    Password {
      public Object get(LibUserVoRowImpl obj) {
        return obj.getPassword();
      }

      public void put(LibUserVoRowImpl obj, Object value) {
        obj.setPassword((String) value);
      }
    },
    UserName {
      public Object get(LibUserVoRowImpl obj) {
        return obj.getUserName();
      }

      public void put(LibUserVoRowImpl obj, Object value) {
        obj.setUserName((String) value);
      }
    },
    LibUserRoleVo {
      public Object get(LibUserVoRowImpl obj) {
        return obj.getLibUserRoleVo();
      }

      public void put(LibUserVoRowImpl obj, Object value) {
        obj.setAttributeInternal(index(), value);
      }
    },
    Library {
      public Object get(LibUserVoRowImpl obj) {
        return obj.getLibrary();
      }

      public void put(LibUserVoRowImpl obj, Object value) {
        obj.setAttributeInternal(index(), value);
      }
    },
    LibRoleVO1 {
      public Object get(LibUserVoRowImpl obj) {
        return obj.getLibRoleVO1();
      }

      public void put(LibUserVoRowImpl obj, Object value) {
        obj.setAttributeInternal(index(), value);
      }
    },
    LibRoleVO {
      public Object get(LibUserVoRowImpl obj) {
        return obj.getLibRoleVO();
      }

      public void put(LibUserVoRowImpl obj, Object value) {
        obj.setAttributeInternal(index(), value);
      }
    },
    Library1 {
      public Object get(LibUserVoRowImpl obj) {
        return obj.getLibrary1();
      }

      public void put(LibUserVoRowImpl obj, Object value) {
        obj.setAttributeInternal(index(), value);
      }
    };
    private static AttributesEnum[] vals = null;
    private static int firstIndex = 0;

    public abstract Object get(LibUserVoRowImpl object);

    public abstract void put(LibUserVoRowImpl object, Object value);

    public int index() {
      return AttributesEnum.firstIndex() + ordinal();
    }

    public static int firstIndex() {
      return firstIndex;
    }

    public static int count() {
      return AttributesEnum.firstIndex() + AttributesEnum.staticValues().length;
    }

    public static AttributesEnum[] staticValues() {
      if (vals == null) {
        vals = AttributesEnum.values();
      }
      return vals;
    }
  }

  public static final int ENABLE = AttributesEnum.Enable.index();
  public static final int LABCOL = AttributesEnum.Labcol.index();
  public static final int NAME = AttributesEnum.Name.index();
  public static final int PASSWORD = AttributesEnum.Password.index();
  public static final int USERNAME = AttributesEnum.UserName.index();
  public static final int LIBUSERROLEVO = AttributesEnum.LibUserRoleVo.index();
  public static final int LIBRARY = AttributesEnum.Library.index();
  public static final int LIBROLEVO1 = AttributesEnum.LibRoleVO1.index();
  public static final int LIBROLEVO = AttributesEnum.LibRoleVO.index();
  public static final int LIBRARY1 = AttributesEnum.Library1.index();

  /** This is the default constructor (do not remove). */
  public LibUserVoRowImpl() {}

  /**
   * Gets LibUser entity object.
   *
   * @return the LibUser
   */
  public EntityImpl getLibUser() {
    return (EntityImpl) getEntity(0);
  }

  /**
   * Gets the attribute value for ENABLE using the alias name Enable.
   *
   * @return the ENABLE
   */
  public Number getEnable() {
    return (Number) getAttributeInternal(ENABLE);
  }

  /**
   * Sets <code>value</code> as attribute value for ENABLE using the alias name Enable.
   *
   * @param value value to set the ENABLE
   */
  public void setEnable(Number value) {
    setAttributeInternal(ENABLE, value);
  }

  /**
   * Gets the attribute value for LABCOL using the alias name Labcol.
   *
   * @return the LABCOL
   */
  public Number getLabcol() {
    return (Number) getAttributeInternal(LABCOL);
  }

  /**
   * Sets <code>value</code> as attribute value for LABCOL using the alias name Labcol.
   *
   * @param value value to set the LABCOL
   */
  public void setLabcol(Number value) {
    setAttributeInternal(LABCOL, value);
  }

  /**
   * Gets the attribute value for NAME using the alias name Name.
   *
   * @return the NAME
   */
  public String getName() {
    return (String) getAttributeInternal(NAME);
  }

  /**
   * Sets <code>value</code> as attribute value for NAME using the alias name Name.
   *
   * @param value value to set the NAME
   */
  public void setName(String value) {
    setAttributeInternal(NAME, value);
  }

  /**
   * Gets the attribute value for PASSWORD using the alias name Password.
   *
   * @return the PASSWORD
   */
  public String getPassword() {
    return (String) getAttributeInternal(PASSWORD);
  }

  /**
   * Sets <code>value</code> as attribute value for PASSWORD using the alias name Password.
   *
   * @param value value to set the PASSWORD
   */
  public void setPassword(String value) {
    setAttributeInternal(PASSWORD, value);
  }

  /**
   * Gets the attribute value for USER_NAME using the alias name UserName.
   *
   * @return the USER_NAME
   */
  public String getUserName() {
    return (String) getAttributeInternal(USERNAME);
  }

  /**
   * Sets <code>value</code> as attribute value for USER_NAME using the alias name UserName.
   *
   * @param value value to set the USER_NAME
   */
  public void setUserName(String value) {
    setAttributeInternal(USERNAME, value);
  }

  /** Gets the associated <code>RowIterator</code> using master-detail link LibUserRoleVo. */
  public RowIterator getLibUserRoleVo() {
    return (RowIterator) getAttributeInternal(LIBUSERROLEVO);
  }

  /** Gets the associated <code>RowIterator</code> using master-detail link Library. */
  public RowIterator getLibrary() {
    return (RowIterator) getAttributeInternal(LIBRARY);
  }

  /** Gets the associated <code>RowIterator</code> using master-detail link LibRoleVO1. */
  public RowIterator getLibRoleVO1() {
    return (RowIterator) getAttributeInternal(LIBROLEVO1);
  }

  /** Gets the associated <code>RowIterator</code> using master-detail link LibRoleVO. */
  public RowIterator getLibRoleVO() {
    return (RowIterator) getAttributeInternal(LIBROLEVO);
  }

  /** Gets the view accessor <code>RowSet</code> Library1. */
  public RowSet getLibrary1() {
    return (RowSet) getAttributeInternal(LIBRARY1);
  }

  /**
   * getAttrInvokeAccessor: generated method. Do not modify.
   *
   * @param index the index identifying the attribute
   * @param attrDef the attribute
   * @return the attribute value
   * @throws Exception
   */
  protected Object getAttrInvokeAccessor(int index, AttributeDefImpl attrDef) throws Exception {
    if ((index >= AttributesEnum.firstIndex()) && (index < AttributesEnum.count())) {
      return AttributesEnum.staticValues()[index - AttributesEnum.firstIndex()].get(this);
    }
    return super.getAttrInvokeAccessor(index, attrDef);
  }

  /**
   * 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);
  }
}
// ---------------------------------------------------------------------
// ---    File generated by Oracle ADF Business Components Design Time.
// ---    Tue Mar 27 12:06:02 GMT+03:30 2012
// ---    Custom code may be added to this class.
// ---    Warning: Do not modify method signatures of generated methods.
// ---------------------------------------------------------------------
public class BookBarcodeHistoryImpl extends EntityImpl {
  private static EntityDefImpl mDefinitionObject;

  /** AttributesEnum: generated enum for identifying attributes and accessors. Do not modify. */
  public enum AttributesEnum {
    Labcol {
      public Object get(BookBarcodeHistoryImpl obj) {
        return obj.getLabcol();
      }

      public void put(BookBarcodeHistoryImpl obj, Object value) {
        obj.setLabcol((Number) value);
      }
    },
    ArtId {
      public Object get(BookBarcodeHistoryImpl obj) {
        return obj.getArtId();
      }

      public void put(BookBarcodeHistoryImpl obj, Object value) {
        obj.setArtId((DBSequence) value);
      }
    },
    DayDate {
      public Object get(BookBarcodeHistoryImpl obj) {
        return obj.getDayDate();
      }

      public void put(BookBarcodeHistoryImpl obj, Object value) {
        obj.setDayDate((Number) value);
      }
    },
    Barcode {
      public Object get(BookBarcodeHistoryImpl obj) {
        return obj.getBarcode();
      }

      public void put(BookBarcodeHistoryImpl obj, Object value) {
        obj.setBarcode((String) value);
      }
    },
    PhbookArtId {
      public Object get(BookBarcodeHistoryImpl obj) {
        return obj.getPhbookArtId();
      }

      public void put(BookBarcodeHistoryImpl obj, Object value) {
        obj.setPhbookArtId((Number) value);
      }
    },
    UserName {
      public Object get(BookBarcodeHistoryImpl obj) {
        return obj.getUserName();
      }

      public void put(BookBarcodeHistoryImpl obj, Object value) {
        obj.setUserName((String) value);
      }
    },
    PhysicalBook1 {
      public Object get(BookBarcodeHistoryImpl obj) {
        return obj.getPhysicalBook1();
      }

      public void put(BookBarcodeHistoryImpl obj, Object value) {
        obj.setPhysicalBook1((PhysicalBookImpl) value);
      }
    };
    private static AttributesEnum[] vals = null;
    private static int firstIndex = 0;

    public abstract Object get(BookBarcodeHistoryImpl object);

    public abstract void put(BookBarcodeHistoryImpl object, Object value);

    public int index() {
      return AttributesEnum.firstIndex() + ordinal();
    }

    public static int firstIndex() {
      return firstIndex;
    }

    public static int count() {
      return AttributesEnum.firstIndex() + AttributesEnum.staticValues().length;
    }

    public static AttributesEnum[] staticValues() {
      if (vals == null) {
        vals = AttributesEnum.values();
      }
      return vals;
    }
  }

  public static final int LABCOL = AttributesEnum.Labcol.index();
  public static final int ARTID = AttributesEnum.ArtId.index();
  public static final int DAYDATE = AttributesEnum.DayDate.index();
  public static final int BARCODE = AttributesEnum.Barcode.index();
  public static final int PHBOOKARTID = AttributesEnum.PhbookArtId.index();
  public static final int USERNAME = AttributesEnum.UserName.index();
  public static final int PHYSICALBOOK1 = AttributesEnum.PhysicalBook1.index();

  /** This is the default constructor (do not remove). */
  public BookBarcodeHistoryImpl() {}

  /** @return the definition object for this instance class. */
  public static synchronized EntityDefImpl getDefinitionObject() {
    if (mDefinitionObject == null) {
      mDefinitionObject =
          EntityDefImpl.findDefObject(
              "org.parsisys.tehranuniversity.library.model.eo.BookBarcodeHistory");
    }
    return mDefinitionObject;
  }

  /**
   * Gets the attribute value for Labcol, using the alias name Labcol.
   *
   * @return the Labcol
   */
  public Number getLabcol() {
    return (Number) getAttributeInternal(LABCOL);
  }

  /**
   * Sets <code>value</code> as the attribute value for Labcol.
   *
   * @param value value to set the Labcol
   */
  public void setLabcol(Number value) {
    setAttributeInternal(LABCOL, value);
  }

  /**
   * Gets the attribute value for ArtId, using the alias name ArtId.
   *
   * @return the ArtId
   */
  public DBSequence getArtId() {
    return (DBSequence) getAttributeInternal(ARTID);
  }

  /**
   * Sets <code>value</code> as the attribute value for ArtId.
   *
   * @param value value to set the ArtId
   */
  public void setArtId(DBSequence value) {
    setAttributeInternal(ARTID, value);
  }

  /**
   * Gets the attribute value for DayDate, using the alias name DayDate.
   *
   * @return the DayDate
   */
  public Number getDayDate() {
    return (Number) getAttributeInternal(DAYDATE);
  }

  /**
   * Sets <code>value</code> as the attribute value for DayDate.
   *
   * @param value value to set the DayDate
   */
  public void setDayDate(Number value) {
    setAttributeInternal(DAYDATE, value);
  }

  /**
   * Gets the attribute value for Barcode, using the alias name Barcode.
   *
   * @return the Barcode
   */
  public String getBarcode() {
    return (String) getAttributeInternal(BARCODE);
  }

  /**
   * Sets <code>value</code> as the attribute value for Barcode.
   *
   * @param value value to set the Barcode
   */
  public void setBarcode(String value) {
    setAttributeInternal(BARCODE, value);
  }

  /**
   * Gets the attribute value for PhbookArtId, using the alias name PhbookArtId.
   *
   * @return the PhbookArtId
   */
  public Number getPhbookArtId() {
    return (Number) getAttributeInternal(PHBOOKARTID);
  }

  /**
   * Sets <code>value</code> as the attribute value for PhbookArtId.
   *
   * @param value value to set the PhbookArtId
   */
  public void setPhbookArtId(Number value) {
    setAttributeInternal(PHBOOKARTID, value);
  }

  /**
   * Gets the attribute value for UserName, using the alias name UserName.
   *
   * @return the UserName
   */
  public String getUserName() {
    return (String) getAttributeInternal(USERNAME);
  }

  /**
   * Sets <code>value</code> as the attribute value for UserName.
   *
   * @param value value to set the UserName
   */
  public void setUserName(String value) {
    setAttributeInternal(USERNAME, value);
  }

  /**
   * getAttrInvokeAccessor: generated method. Do not modify.
   *
   * @param index the index identifying the attribute
   * @param attrDef the attribute
   * @return the attribute value
   * @throws Exception
   */
  protected Object getAttrInvokeAccessor(int index, AttributeDefImpl attrDef) throws Exception {
    if ((index >= AttributesEnum.firstIndex()) && (index < AttributesEnum.count())) {
      return AttributesEnum.staticValues()[index - AttributesEnum.firstIndex()].get(this);
    }
    return super.getAttrInvokeAccessor(index, attrDef);
  }

  /**
   * 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);
  }

  /** @return the associated entity PhysicalBookImpl. */
  public PhysicalBookImpl getPhysicalBook1() {
    return (PhysicalBookImpl) getAttributeInternal(PHYSICALBOOK1);
  }

  /** Sets <code>value</code> as the associated entity PhysicalBookImpl. */
  public void setPhysicalBook1(PhysicalBookImpl value) {
    setAttributeInternal(PHYSICALBOOK1, value);
  }

  /**
   * @param labcol key constituent
   * @param artId key constituent
   * @return a Key object based on given key constituents.
   */
  public static Key createPrimaryKey(Number labcol, DBSequence artId) {
    return new Key(new Object[] {labcol, artId});
  }

  /** Add locking logic here. */
  public void lock() {
    super.lock();
  }

  /**
   * 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);
  }
}