org.jbundle.base.db.Record.findRecordOwner()方法的使用及代码示例

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

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

Record.findRecordOwner介绍

[英]Get a recordowner from this record. This method does a deep search using the listeners and the database connections to find a recordowner.
[中]从该记录中获取记录所有者。此方法使用侦听器和数据库连接进行深度搜索,以查找记录所有者。

代码示例

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

public static RecordOwner findRecordOwner(Record record)
{
  return record.findRecordOwner();    // Get rid of this
}
/**

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

public BaseRecordOwner getDirectMessageTransport(Task task)
  {
    MessageTransportModel messageTransport = (MessageTransportModel)this.getOwner().findRecordOwner().getRecord(MessageTransport.MESSAGE_TRANSPORT_FILE);
    if (messageTransport == null)
      messageTransport = (MessageTransportModel)Record.makeRecordFromClassName(MessageTransportModel.THICK_CLASS, this.getOwner().findRecordOwner());
    return (BaseRecordOwner)messageTransport.createMessageTransport(MessageTransportModel.DIRECT, task);
  }
}

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

/**
 * AddTrxStatusID Method.
 */
public void addTrxStatusID(String strApTrxDesc)
{
  if (m_recTrxStatus == null)
  {
    RecordOwner recordOwner = this.getOwner().findRecordOwner();
    m_recTrxStatus = new TrxStatus(recordOwner);
    if (recordOwner != null)
      recordOwner.removeRecord(m_recTrxStatus);
  }
  this.addFilter(new Integer(m_recTrxStatus.getTrxStatusID(TransactionType.ACCTPAY, ApTrx.AP_TRX_FILE, strApTrxDesc)));
}

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

/**
 * AddTrxStatusID Method.
 */
public void addTrxStatusID(String strApTrxDesc)
{
  if (m_recTrxStatus == null)
  {
    RecordOwner recordOwner = this.getOwner().findRecordOwner();
    m_recTrxStatus = new TrxStatus(recordOwner);
    if (recordOwner != null)
      recordOwner.removeRecord(m_recTrxStatus);
  }
  this.addFilter(new Integer(m_recTrxStatus.getTrxStatusID(TransactionType.ACCTPAY, ApTrx.AP_TRX_FILE, strApTrxDesc)));
}

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

/**
 * Support method for quickly getting the A/P control file.
 */
public Record getApControl()
{
  Record recApControl = null;
  RecordOwner recordOwner = this.getOwner().findRecordOwner();
  if (recordOwner != null)
    recApControl = (Record)recordOwner.getRecord(ApControl.AP_CONTROL_FILE);
  if (recApControl == null)
  {
    recApControl = m_recApControl = new ApControl(recordOwner);
    if (recordOwner != null)
      recordOwner.removeRecord(m_recApControl);
  }
  return recApControl;
}
/**

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

/**
 * Make the record that this field references.
 * Typically, you override this method to set the referenced class if it doesn't exist.
 *<p><pre>
 * For Example:
 *  return new RecordName(screen);
 * </pre>
 * @param recordOwner The recordowner.
 * @return tour.db.Record
 */
public final Record makeReferenceRecord()
{
  if (m_recordReference != null)
    return m_recordReference;       // It already exists
  RecordOwner recordOwner = null;
  if (this.getRecord() != null)
    recordOwner = Record.findRecordOwner(this.getRecord());    // This way the record has access to the correct environment.
  this.setReferenceRecord(this.makeReferenceRecord(recordOwner));
  return m_recordReference;
}
/**

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

/**
 * GetContactType Method.
 */
public ContactType getContactType(Person recPerson)
{
  if (m_recContactType == null)
  {
    m_recContactType = (ContactType)Record.makeRecordFromClassName(ContactTypeModel.CONTACT_TYPE_FILE, this.getOwner().getRecord().findRecordOwner());
    if (((Record)m_recContactType).getRecordOwner() != null)
      ((Record)m_recContactType).getRecordOwner().removeRecord((Record)m_recContactType);
  }
  return m_recContactType.getContactType(recPerson);
}

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

/**
 * If one exists, set up the Local version of this record.
 * Do this by opening a local version of this database and attaching a ResourceTable
 * to the record.
 * @param record The record to set up.
 * @param table The table for the record.
 * @return The new locale-sensitive table that has been setup for this record.
 */
public BaseTable makeResourceTable(Record record, BaseTable table, BaseDatabase databaseBase, boolean bHierarchicalTable)
{   // Create a mirrored record in the locale database
  Record record2 = (Record)ClassServiceUtility.getClassService().makeObjectFromClassName(record.getClass().getName());
  if (record2 != null)
  {
    BaseTable table2 = databaseBase.makeTable(record2);
    record2.setTable(table2);
    RecordOwner recordOwner = Record.findRecordOwner(record);
    record2.init(recordOwner);
    recordOwner.removeRecord(record2);  // This is okay as ResourceTable will remove this table on close.
    record.setTable(table);     // This is necessary to link-up ResourceTable
    if (!bHierarchicalTable)
      table = new org.jbundle.base.db.util.ResourceTable(null, record);
    else
      table = new org.jbundle.base.db.util.HierarchicalTable(null, record);
    table.addTable(table2);
  }
  return table;
}
/**

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

/**
 * GetUserTemplate Method.
 */
public UserInfo getUserTemplate()
{
  if (userControl == null)
    userControl = new UserControl(this.getOwner().findRecordOwner());
  if (userControl != null)
    if ((userControl.getEditMode() == DBConstants.EDIT_CURRENT) || (userControl.getEditMode() == DBConstants.EDIT_IN_PROGRESS))
  {
    UserInfo userInfo = (UserInfo)((ReferenceField)userControl.getField(UserControl.TEMPLATE_USER_ID)).getReference();
    if (userInfo != null)
      if ((userInfo.getEditMode() == DBConstants.EDIT_CURRENT) || (userInfo.getEditMode() == DBConstants.EDIT_IN_PROGRESS))
        return userInfo;
  }
  return null;
}

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

/**
   * Create the sub-record.
   * Override this method to create a sub-record.
   */
  public Record createSubRecord()
  {
    Record record = (Record)ClassServiceUtility.getClassService().makeObjectFromClassName(m_strSubFile);
    if (record != null)
    {
      RecordOwner recordOwner = Record.findRecordOwner(this.getOwner());
      record.init(recordOwner);
      if (recordOwner != null)
        recordOwner.removeRecord(record);
      this.getOwner().addListener(new FreeOnFreeHandler(record));
    }
    return record;
  }
}

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

/**
 * Get the destination (history) record.
 * @return
 */
public Record getHistoryRecord()
{
  if (m_recDependent == null)
  {
    if (m_strRecHistoryClass != null)
    {
      m_recDependent = Record.makeRecordFromClassName(m_strRecHistoryClass, Record.findRecordOwner(this.getOwner()));
      if (m_recDependent != null)
      {
        m_bCloseOnFree = true;
        m_recDependent.addListener(new FileRemoveBOnCloseHandler(this));    // Being careful
        if (m_recDependent.getListener(RecordChangedHandler.class) != null)
          m_recDependent.removeListener(this.getOwner().getListener(RecordChangedHandler.class), true);  // I replace this listener
      }                    
    }
  }
  return m_recDependent;
}
/**

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

/**
 * Get the value to add (Overidden from SubCountHandler).
 * If there was a field specified, return the value, otherwise just return a count of 1.
 * @return The field value.
 */
public double getFieldValue()
{
  if (m_iStartMcoClass == 0)
  {
    if (m_recTrxStatus == null)
    {
      RecordOwner recordOwner = this.getOwner().findRecordOwner();
      m_recTrxStatus = new TrxStatus(recordOwner);
      if (recordOwner != null)
        recordOwner.removeRecord(m_recTrxStatus);
    }
    m_iStartMcoClass = (int)m_recTrxStatus.getTrxStatusID(TransactionType.ACCTREC, Mco.MCO_FILE, Mco.BATCH);
    m_iEndMcoClass = m_iStartMcoClass; //(int)recTrxStatus.getTrxStatusID(TransactionType.ACCTREC, "MCO Payment-Paid amt");
  }
  if ((this.getOwner().getField(ArTrx.TRX_STATUS_ID).getValue() >= m_iStartMcoClass)
    && (this.getOwner().getField(ArTrx.TRX_STATUS_ID).getValue() <= m_iEndMcoClass))
      return super.getFieldValue();
  return 0; // Not an MCO... Don't add
}

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

/**
 * Return the TrxStatus file.
 * @return The TrxStatus file.
 */
public TrxStatus getTrxStatus()
{
  if (m_recTrxStatus == null)
  {
    RecordOwner recordOwner = this.getOwner().findRecordOwner();
    m_recTrxStatus = new TrxStatus(recordOwner);
    if (recordOwner != null)
      recordOwner.removeRecord(m_recTrxStatus);
    m_recTrxDesc = new TrxDesc(recordOwner);
    if (recordOwner != null)
      recordOwner.removeRecord(m_recTrxDesc);
    m_recTrxDesc.getKeyArea(TrxDesc.DESC_CODE_KEY);
    m_recTrxDesc.getField(TrxDesc.DESC_CODE).setString(ApTrx.AP_TRX_FILE);
    try {
      if (m_recTrxDesc.seek("="))
      {
        m_recTrxStatus.addListener(new SubFileFilter(m_recTrxDesc));
      }
    } catch (DBException ex)    {
      ex.printStackTrace();
    }
  }
  return m_recTrxStatus;
}

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

/**
 * UpdateResourcePermissions Method.
 */
public void updateResourcePermissions()
{
  UserPermission recUserPermission = new UserPermission(this.getOwner().findRecordOwner());
  
  recUserPermission.addListener(new SubFileFilter(this.getOwner()));
  
  try {
    while (recUserPermission.hasNext())
    {
      recUserPermission.next();
      recUserPermission.edit();
      recUserPermission.getField(UserPermission.USER_RESOURCE_ID).setModified(true);   // Fake a mod, so the group permissions will be updated
      recUserPermission.set();
    }
  } catch (DBException ex) {
    ex.printStackTrace();
  }
  
  recUserPermission.free();
}

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

/**
 * FieldChanged Method.
 */
public int fieldChanged(boolean bDisplayOption, int iMoveMode)
{
  if (m_recTrxStatus == null)
  {
    RecordOwner recordOwner = this.getOwner().getRecord().findRecordOwner();
    m_recTrxStatus = new TrxStatus(recordOwner);
             if (recordOwner != null)
               recordOwner.removeRecord(m_recTrxStatus);
  }
  if (this.getOwner().getValue() < 0)
    m_recTrxStatus.getTrxStatusID(TransactionType.ACCTREC, ArTrx.AR_TRX_FILE, ArTrx.CREDIT_MEMO);
  else
    m_recTrxStatus.getTrxStatusID(TransactionType.ACCTREC, ArTrx.AR_TRX_FILE, ArTrx.DEBIT_MEMO);
  this.getOwner().getRecord().getField(ArTrx.TRX_STATUS_ID).moveFieldToThis(m_recTrxStatus.getField(TrxStatus.ID));
  return super.fieldChanged(bDisplayOption, iMoveMode);
}

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

/**
 * Return the TrxStatus file.
 * @return The TrxStatus file.
 */
public TrxStatus getTrxStatus()
{
  if (m_recTrxStatus == null)
  {
    RecordOwner recordOwner = this.getOwner().findRecordOwner();
    m_recTrxStatus = new TrxStatus(recordOwner);
    if (recordOwner != null)
      recordOwner.removeRecord(m_recTrxStatus);
    m_recTrxDesc = new TrxDesc(recordOwner);
    if (recordOwner != null)
      recordOwner.removeRecord(m_recTrxDesc);
    m_recTrxDesc.getKeyArea(TrxDesc.DESC_CODE_KEY);
    m_recTrxDesc.getField(TrxDesc.DESC_CODE).setString(ApTrx.AP_TRX_FILE);
    try {
      if (m_recTrxDesc.seek("="))
      {
        m_recTrxStatus.addListener(new SubFileFilter(m_recTrxDesc));
      }
    } catch (DBException ex)    {
      ex.printStackTrace();
    }
  }
  return m_recTrxStatus;
}

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

/**
 * Create the dist record and set up the sub-file.
 */
public BankTrxBatchDist makeDistRecord(RecordOwner recordOwner, Record recBatchDetail)
{
  RecordOwner ro = recordOwner;
  if (recordOwner == null)
    if (this.getField() != null)
      ro = ((BaseField)this.getField()).getRecord().findRecordOwner();
  CashBatchDist recCashBatchDist = this.createDistRecord(ro);
  if (recordOwner == null)
  {
    if (recCashBatchDist.getRecordOwner() != null)
      recCashBatchDist.getRecordOwner().removeRecord(recCashBatchDist);
    if (this.getField() != null)
      if (this.getField().getRecord() != null)
        ((BaseField)this.getField()).getRecord().addListener(new FreeOnFreeHandler(recCashBatchDist));
  }
  recCashBatchDist.setKeyArea(CashBatchDist.CASH_BATCH_DETAIL_ID_KEY);
  recCashBatchDist.addListener(new SubFileFilter(recBatchDetail));
  return recCashBatchDist;
}
/**

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

RecordOwner recordOwner = this.getOwner().getRecord().findRecordOwner();
m_recBankTrx = new BankTrx(recordOwner);
if (recordOwner != null)

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

/**
 * Called when a valid record is read from the table/query.
 * @param bDisplayOption If true, display any changes.
 */
public void doValidRecord(boolean bDisplayOption)
{
  super.doValidRecord(bDisplayOption);
  Record recApTrx = this.getOwner();
  if (m_iDepartureEstimate == -1)
  {
    TrxStatus recTrxStatus = new TrxStatus(this.getOwner().findRecordOwner());  // Rarely, but if it doesn't exist in the screen, add it!
    m_iDepartureEstimate = recTrxStatus.getTrxStatusID(TransactionType.ACCTPAY, ApTrx.AP_TRX_FILE, ApTrx.DEP_ESTIMATE);
    m_iDepartureEstimateManual = recTrxStatus.getTrxStatusID(TransactionType.ACCTPAY, ApTrx.AP_TRX_FILE, ApTrx.DEPARTURE_EST_MANUAL);
    recTrxStatus.free();
  }
  if ((recApTrx.getField(ApTrx.TRX_STATUS_ID).getValue() == m_iDepartureEstimate)
    || (recApTrx.getField(ApTrx.TRX_STATUS_ID).getValue() == m_iDepartureEstimateManual))
  {
    recApTrx.getField(ApTrx.INVOICE_AMOUNT).moveFieldToThis(recApTrx.getField(ApTrx.DEPARTURE_ESTIMATE));
    recApTrx.getField(ApTrx.INVOICE_BALANCE).moveFieldToThis(recApTrx.getField(ApTrx.DEPARTURE_ESTIMATE));
    recApTrx.getField(ApTrx.INVOICE_BALANCE_LOCAL).moveFieldToThis(recApTrx.getField(ApTrx.DEPARTURE_ESTIMATE_LOCAL));
  }
}

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

/**
 * Called when a valid record is read from the table/query.
 * @param bDisplayOption If true, display any changes.
 */
public void doValidRecord(boolean bDisplayOption)
{
  super.doValidRecord(bDisplayOption);
  Record recApTrx = this.getOwner();
  if (m_iDepartureEstimate == -1)
  {
    TrxStatus recTrxStatus = new TrxStatus(this.getOwner().findRecordOwner());  // Rarely, but if it doesn't exist in the screen, add it!
    m_iDepartureEstimate = recTrxStatus.getTrxStatusID(TransactionType.ACCTPAY, ApTrx.AP_TRX_FILE, ApTrx.DEP_ESTIMATE);
    m_iDepartureEstimateManual = recTrxStatus.getTrxStatusID(TransactionType.ACCTPAY, ApTrx.AP_TRX_FILE, ApTrx.DEPARTURE_EST_MANUAL);
    recTrxStatus.free();
  }
  if ((recApTrx.getField(ApTrx.TRX_STATUS_ID).getValue() == m_iDepartureEstimate)
    || (recApTrx.getField(ApTrx.TRX_STATUS_ID).getValue() == m_iDepartureEstimateManual))
  {
    recApTrx.getField(ApTrx.INVOICE_AMOUNT).moveFieldToThis(recApTrx.getField(ApTrx.DEPARTURE_ESTIMATE));
    recApTrx.getField(ApTrx.INVOICE_BALANCE).moveFieldToThis(recApTrx.getField(ApTrx.DEPARTURE_ESTIMATE));
    recApTrx.getField(ApTrx.INVOICE_BALANCE_LOCAL).moveFieldToThis(recApTrx.getField(ApTrx.DEPARTURE_ESTIMATE_LOCAL));
  }
}

相关文章

微信公众号

最新文章

更多

Record类方法