org.jbundle.base.db.Record类的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(12.6k)|赞(0)|评价(0)|浏览(116)

本文整理了Java中org.jbundle.base.db.Record类的一些代码示例,展示了Record类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Record类的具体详情如下:
包路径:org.jbundle.base.db.Record
类名称:Record

Record介绍

[英]Record - Pure public recordset object.

Base object for all recordsets and queries.

The record class is roughly based on the collection interface: 
 Record Class: 
 
getTable 
 
getObjectID 
 
addNew - New empty record 
add - Add new record 
edit - lock current record 
set - Update record 
delete - Delete record 
Table class: 
move(iRelPos) - Moves relative to the current position. 
seek() - Seeks a record using this key. 
getHandle - Gets a unique record identifier. (Must be serializable). 
setHandle - Seeks a record using this unique key. 
getEditMode() - Get status of this record.

[中]记录-纯公共记录集对象。
所有记录集和查询的基本对象。

The record class is roughly based on the collection interface: 
 Record Class: 
 
getTable 
 
getObjectID 
 
addNew - New empty record 
add - Add new record 
edit - lock current record 
set - Update record 
delete - Delete record 
Table class: 
move(iRelPos) - Moves relative to the current position. 
seek() - Seeks a record using this key. 
getHandle - Gets a unique record identifier. (Must be serializable). 
setHandle - Seeks a record using this unique key. 
getEditMode() - Get status of this record.

代码示例

代码示例来源:origin: org.jbundle.base.screen/org.jbundle.base.screen.model

/**
 * Code to display a Menu.
 */
public void preSetupGrid(String strMenu)
{
  if (strMenu == null)    // Always
    strMenu = m_recDetail.getField(MenusModel.ID).toString();
  m_recDetail.setKeyArea(MenusModel.PARENT_FOLDER_ID_KEY);
  m_recDetail.addListener(new StringSubFileFilter(strMenu, m_recDetail.getField(MenusModel.PARENT_FOLDER_ID), null, null, null, null));
}
/**

代码示例来源:origin: com.tourgeek.tour/com.tourgeek.tour.request.report

/**
 * Run Method.
 */
public void run()
{
  Record recRequest = this.getMainRecord();
  try {
    recRequest.close();
    while (recRequest.hasNext())
    {
      recRequest.next();
      recRequest.edit();
      recRequest.getField(Request.PRINT_NOW).setState(true);
      recRequest.set();
    }
  } catch (DBException ex)    {
    ex.printStackTrace();
  }
}

代码示例来源:origin: org.jbundle.base/org.jbundle.base.mixed

/**
   * Called when a valid record is read from the table/query.
   * Re-read the sub-file on change.
   * @param bDisplayOption If true, display any changes.
   */
  public void recountRecords()
  {
    try   {
      Object bookmark = null;
      if (m_bRestoreCurrentRecord)
        if (m_recordSub.getEditMode() == DBConstants.EDIT_CURRENT)
          bookmark = m_recordSub.getHandle(DBConstants.BOOKMARK_HANDLE);
      m_recordSub.close();
      while (m_recordSub.hasNext())
      {   // Recount each sub-record
        m_recordSub.next();
      }
      if (bookmark != null)
        m_recordSub.setHandle(bookmark, DBConstants.BOOKMARK_HANDLE);
    } catch (DBException ex)    {
      ex.printStackTrace();
    }
  }
}

代码示例来源:origin: org.jbundle.base/org.jbundle.base.mixed

/**
   * Sync the current record's contents and status to the base record
   */
  public void syncRecordToBase(Record recBase, Record recAlt)
  {
    if ((recAlt != null) && (recBase != null))
    {
      recBase.moveFields(recAlt, null, true, DBConstants.READ_MOVE, false, false, true);
      recBase.setEditMode(recAlt.getEditMode());
    }
    if ((recBase.getEditMode() == DBConstants.EDIT_CURRENT) || (recBase.getEditMode() == DBConstants.EDIT_IN_PROGRESS))
      recBase.handleValidRecord(); // Do listeners, Display Fields
    else if (recBase.getEditMode() == DBConstants.EDIT_ADD)
      recBase.handleNewRecord(); // Do listeners, Display Fields
  }
}

代码示例来源:origin: com.tourgeek.tour/com.tourgeek.tour.request.report

/**
 * UpdateRequestDetail Method.
 */
public void updateRequestDetail(Record recRequestDetail, Record recRequestHistoryDetail)
{
  try   {
    recRequestHistoryDetail.close();
    while (recRequestHistoryDetail.hasNext())
    {
      recRequestHistoryDetail.next();
  
      recRequestDetail.addNew();
      recRequestDetail.moveFields(recRequestHistoryDetail, Record.MOVE_BY_NAME, true, DBConstants.SCREEN_MOVE, true, false, false, false);   // Move all fields to the history record
      recRequestDetail.add();  
    }
  } catch (DBException ex)    {
    ex.printStackTrace();
  }
}

代码示例来源:origin: com.tourapp.tour/com.tourapp.tour.request.report

/**
 * UpdateHistoryDetail Method.
 */
public void updateHistoryDetail(Record recRequestDetail, Record recRequestHistoryDetail, Record recRequest)
{
  try   {
    recRequestDetail.close();
    while (recRequestDetail.hasNext())
    {
      recRequestDetail.next();
      recRequestDetail.edit();
  
      recRequestHistoryDetail.addNew();
      recRequestHistoryDetail.moveFields(recRequestDetail, Record.MOVE_BY_NAME, true, DBConstants.SCREEN_MOVE, true, false, false, false);   // Move all fields to the history record
      recRequestHistoryDetail.getField(RequestHistoryDetail.PROFILE_ID).moveFieldToThis(recRequest.getField(Request.PROFILE_ID));
      recRequestHistoryDetail.add();  
  
      recRequestDetail.remove();
    }
  } catch (DBException ex)    {
    ex.printStackTrace();
  }
}

代码示例来源:origin: com.tourgeek.tour/com.tourgeek.tour.request.report

recRequestHistory.close();
while (recRequestHistory.hasNext())
  recRequestHistory.next();
  recRequestHistory.edit();
  recRequest.addNew();
  recRequest.moveFields(recRequestHistory, Record.MOVE_BY_NAME, true, DBConstants.SCREEN_MOVE, true, false, false, false);   // Move all fields to the history record
  recRequest.add();
  Object bookmark = recRequest.getLastModified(DBConstants.BOOKMARK_HANDLE);
  recRequest.setHandle(bookmark, DBConstants.BOOKMARK_HANDLE);
  recRequestHistory.getField(RequestHistory.HIST_REPRINT).setState(false);
  recRequestHistory.set();

代码示例来源:origin: com.tourapp.tour/com.tourapp.tour.genled.screen

/**
 * Add all the screen listeners.
 */
public void addListeners()
{
  super.addListeners();
  
  this.getRecord(AcctBatch.ACCT_BATCH_FILE).getField(AcctBatch.ID).addListener(new FieldReSelectHandler(this));
  this.getRecord(AcctBatchDetail.ACCT_BATCH_DETAIL_FILE).addListener(new SubCountHandler(this.getRecord(AcctBatch.ACCT_BATCH_FILE).getField(AcctBatch.BALANCE), AcctBatchDetail.AMOUNT, false, true));
  this.getRecord(AcctBatchDetail.ACCT_BATCH_DETAIL_FILE).addListener(new BatchSequenceHandler(this.getRecord(AcctBatchDetail.ACCT_BATCH_DETAIL_FILE).getField(AcctBatchDetail.SEQUENCE), this.getRecord(AcctBatch.ACCT_BATCH_FILE).getField(AcctBatch.NEXT_SEQUENCE), this.getRecord(AcctBatch.ACCT_BATCH_FILE).getField(AcctBatch.BALANCE)));
  this.getMainRecord().addListener(new AcctBatchValidateBeh(null));
}
/**

代码示例来源:origin: org.jbundle.base.db/org.jbundle.base.db

/**
 * free this listener and update/add the target record.
 */
public int writeAndRefresh()
{
  try   {
    if (m_recordToUpdate != null)
      if (m_recordToUpdate.isModified(true))
    {
      if (m_bRefreshAfterUpdate)
        m_recordToUpdate.writeAndRefresh();
      else
      {
        if (m_recordToUpdate.getEditMode() == Constants.EDIT_IN_PROGRESS)
          m_recordToUpdate.set();
        else if (m_recordToUpdate.getEditMode() == Constants.EDIT_ADD)
          m_recordToUpdate.add();
      }
    }
  } catch(DBException ex)   {
    ex.printStackTrace();
  }
  return DBConstants.NORMAL_RETURN;   // For now
}
/**

代码示例来源:origin: org.jbundle.base/org.jbundle.base.mixed

/**
 * Run Method.
 */
public void run()
{
  String strID = this.getProperty(DBParams.ID);
  if ((strID != null) && (strID.length() > 0))
  {
    Record recCalendarEntry = this.getMainRecord();
    recCalendarEntry.getCounterField().setString(strID);
    try {
      if (recCalendarEntry.seek(null))
      {
        recCalendarEntry.edit();
        boolean[] rgbEnabled = recCalendarEntry.setEnableListeners(false);  // I need to do this since a change in properties will reschedule the jobs.
        ((PropertiesField)recCalendarEntry.getField(CalendarEntry.kProperties)).setProperty(TASK_COMPLETED, DBConstants.TRUE);
        recCalendarEntry.setEnableListeners(rgbEnabled);
        recCalendarEntry.set();
      }
    } catch (DBException ex) {
      ex.printStackTrace();
    }
  }
}

代码示例来源:origin: com.tourapp.tour/com.tourapp.tour.booking.db

/**
 * Order all the components for this tour.
 */
public void orderAllComponents()
{
  if (this.getField(Tour.ORDER_COMPONENTS).getState() == false)
    return;
  BookingDetail recBookingDetail = new BookingDetail(this.findRecordOwner());
  try {
    recBookingDetail.addListener(new SubFileFilter(this));
    while (recBookingDetail.hasNext())
    {
      recBookingDetail.next();
      Record recBookingDetailCurrent = recBookingDetail.getTable().getCurrentTable().getRecord();
      recBookingDetailCurrent.edit();
      recBookingDetailCurrent.getField(BookingDetail.PRODUCT_STATUS_REQUEST).setData(Boolean.TRUE);
      if (recBookingDetailCurrent.getEditMode() == DBConstants.EDIT_IN_PROGRESS)
        recBookingDetailCurrent.set();   // Possible that the listeners re-wrote this record already.
    }
  } catch (DBException ex) {
    recBookingDetail.free();
  }
}
/**

代码示例来源:origin: org.jbundle.base/org.jbundle.base.mixed

/**
 * GetDefaultVersion Method.
 */
public String getDefaultVersion()
{
  Record recMessageVersion = ((ReferenceField)this.getRecord(MessageControl.kMessageControlFile).getField(MessageControl.kDefaultVersionID)).getReference();
  if (recMessageVersion != null)
    if ((recMessageVersion.getEditMode() == DBConstants.EDIT_CURRENT) || (recMessageVersion.getEditMode() == DBConstants.EDIT_IN_PROGRESS))
      return recMessageVersion.getField(MessageVersion.kCode).toString();
  return "2007B"; // Never
}
/**

代码示例来源:origin: org.jbundle.base/org.jbundle.base

/**
   * Mask of valid bits.
   */
  public int getBitsToCheck()
  {
    if (m_iBitsToCheck == 0)
    {
      Record record = this.makeReferenceRecord();
      try {
        record.close();
        while (record.hasNext())    // 0 = First Day -> 6 = Last Day of Week
        {
          record.next();
          int sBitPosition = (int)record.getCounterField().getValue();
          m_iBitsToCheck |= 1 << sBitPosition;
        }
      } catch (DBException e) {
        e.printStackTrace();
      }
    }
    return m_iBitsToCheck;
  }
}

代码示例来源:origin: com.tourapp.tour/com.tourapp.tour.acctrec.screen

/**
 * Remove this batch detail transaction and the distribution.
 * @return true if successful.
 */
public boolean removeDetailTrx()
{
  // Step 3 - Delete the batch (if not recurring)
  Record recBankTrxBatchDetail = this.getDetailRecord();
  Record recBankTrxBatchDist = this.getDistRecord();
  recBankTrxBatchDist.close();
  try   {
    while (recBankTrxBatchDist.hasNext())
    {
      recBankTrxBatchDist.next();
      recBankTrxBatchDist.edit();
      recBankTrxBatchDist.remove();
    }
    // Don't remove the detail trx as it is not in a batch.
  } catch (DBException ex) {
    ex.printStackTrace();
    return false;
  }
  return true;
}
/**

代码示例来源:origin: org.jbundle.base/org.jbundle.base.mixed

/**
 * Add the sub file filter (linking the header to the main file)
 * Override this if the header does not have a direct link to the detail.
 */
public void addSubFileFilter()
{
  this.getMainRecord().addListener(new CompareFileFilter(MessageProcessInfo.kMessageInfoID, (BaseField)this.getHeaderRecord().getCounterField(), DBConstants.EQUALS, null, true));
  this.getMainRecord().getField(MessageProcessInfo.kMessageInfoID).addListener(new InitFieldHandler((BaseField)this.getHeaderRecord().getCounterField(), false));
}

代码示例来源:origin: com.tourapp.tour/com.tourapp.tour.assetdr.report

/**
 * Process the command.
 * <br />Step 1 - Process the command if possible and return true if processed.
 * <br />Step 2 - If I can't process, pass to all children (with me as the source).
 * <br />Step 3 - If children didn't process, pass to parent (with me as the source).
 * <br />Note: Never pass to a parent or child that matches the source (to avoid an endless loop).
 * @param strCommand The command to process.
 * @param sourceSField The source screen field (to avoid echos).
 * @param iCommandOptions If this command creates a new screen, create in a new window?
 * @return true if success.
 */
public boolean doCommand(String strCommand, ScreenField sourceSField, int iCommandOptions)
{
  if (strCommand.equalsIgnoreCase(MenuConstants.POST))
  {
    try {
      Record recAssetDrControl = this.getRecord(AssetDrControl.ASSET_DR_CONTROL_FILE);
      recAssetDrControl.edit();
      ((DateTimeField)recAssetDrControl.getField(AssetDrControl.DATE_RECONCILED)).setDateTime(new Date(), DBConstants.DISPLAY, DBConstants.SCREEN_MOVE);
      recAssetDrControl.set();
    } catch (DBException ex) {
      ex.printStackTrace();
    }
    strCommand = DBConstants.BACK;  // Go to previous screen
  }
  return super.doCommand(strCommand, sourceSField, iCommandOptions);
}

代码示例来源:origin: org.jbundle.base.db/org.jbundle.base.db

/**
 * Export this table.
 * @record The record to export.
 * @strFileName The distination filename (deleted the old copy if this file exists).
 */
public static void exportFileToDOM(DocumentBuilder stringdb, Record record, Document doc, Element elRoot)
{
  try   {
    record.close();
    while (record.hasNext())
    {
      record.next();
      XmlUtilities.createXMLRecord(stringdb, record, doc, elRoot);
    }
    elRoot.appendChild(doc.createTextNode(NEWLINE));
  } catch (DBException ex)    {
    ex.printStackTrace();
    System.exit(0);
  }
}
/**

代码示例来源:origin: org.jbundle.base/org.jbundle.base.mixed

/**
 * SetupSFields Method.
 */
public void setupSFields()
{
  Record recContact = ((ReferenceField)this.getMainRecord().getField(MessageDetail.kPersonID)).getReferenceRecord();
  if (recContact != null)
    if (recContact.getEditMode() == DBConstants.EDIT_CURRENT)
    if (recContact instanceof Person)   // Profile
    {
      BaseField field = recContact.getField(recContact.getDefaultDisplayFieldSeq());
      field.setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY);
    }
}

代码示例来源:origin: com.tourgeek.tour/com.tourgeek.tour.acctpay.screen

/**
 * Add all the screen listeners.
 */
public void addListeners()
{
  super.addListeners();
  this.getMainRecord().setKeyArea(PaymentHistory.AP_TRX_ID_KEY);
  
  this.getHeaderRecord().getField(ApTrx.ID).addListener(new FieldReSelectHandler(this));
  
  this.setEditing(false);
}
/**

代码示例来源:origin: com.tourapp.tour/com.tourapp.tour.acctrec.screen

/**
 * (Optionally) update this detail transaction.
 * @return true if success.
 */
public boolean updateDetailTrx()
{
  Record recDetail = this.getDetailRecord();
  try {
    recDetail.edit();
    recDetail.getField(Mco.TRX_STATUS_ID).setValue(m_iTrxStatusEntered);
  } catch (DBException ex)    {
    ex.printStackTrace();
    return false;
  }
  return super.updateDetailTrx();
}
/**

相关文章

微信公众号

最新文章

更多

Record类方法