本文整理了Java中org.jbundle.thin.base.db.FieldList.getKeyAreaCount()
方法的一些代码示例,展示了FieldList.getKeyAreaCount()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FieldList.getKeyAreaCount()
方法的具体详情如下:
包路径:org.jbundle.thin.base.db.FieldList
类名称:FieldList
方法名:getKeyAreaCount
[英]The number of key areas.
[中]关键领域的数量。
代码示例来源:origin: org.jbundle.base/org.jbundle.base.mixed
/**
* Get the seq of this key area.
* Get rid of this method.
* @return The sequence of the keyarea.
*/
public int getKeySeq()
{ // This is a dumb way to do this
int iLastIndexArea = m_record.getKeyAreaCount() - 1 + DBConstants.MAIN_KEY_AREA;
for (int nIndex = DBConstants.MAIN_KEY_AREA; nIndex <= iLastIndexArea; nIndex++)
{
KeyAreaInfo index = m_record.getKeyArea(nIndex);
if (index == null)
return -1; // Not found
if (this == index)
return nIndex; // Zero based . MAIN_FIELD based
}
return -1; // Not found
}
/**
代码示例来源:origin: org.jbundle.base/org.jbundle.base
/**
* Get the seq of this key area.
* Get rid of this method.
* @return The sequence of the keyarea.
*/
public int getKeySeq()
{ // This is a dumb way to do this
int iLastIndexArea = m_record.getKeyAreaCount() - 1 + DBConstants.MAIN_KEY_AREA;
for (int nIndex = DBConstants.MAIN_KEY_AREA; nIndex <= iLastIndexArea; nIndex++)
{
KeyAreaInfo index = m_record.getKeyArea(nIndex);
if (index == null)
return -1; // Not found
if (this == index)
return nIndex; // Zero based . MAIN_FIELD based
}
return -1; // Not found
}
/**
代码示例来源:origin: org.jbundle.base.db/org.jbundle.base.db
/**
* Get the seq of this key area.
* Get rid of this method.
* @return The sequence of the keyarea.
*/
public int getKeySeq()
{ // This is a dumb way to do this
int iLastIndexArea = m_record.getKeyAreaCount() - 1 + DBConstants.MAIN_KEY_AREA;
for (int nIndex = DBConstants.MAIN_KEY_AREA; nIndex <= iLastIndexArea; nIndex++)
{
KeyAreaInfo index = m_record.getKeyArea(nIndex);
if (index == null)
return -1; // Not found
if (this == index)
return nIndex; // Zero based . MAIN_FIELD based
}
return -1; // Not found
}
/**
代码示例来源:origin: org.jbundle.thin.base.db/org.jbundle.thin.base.db
/**
* Initialize the class.
* @param record The parent record.
* @param iKeyDup The type of key (UNIQUE/NOT_UNIQUE/SECONDARY).
* @param strKeyName The name of this key (default to first fieldnameKEY).
*/
public void init(Rec record, int iKeyDup, String strKeyName)
{
m_vKeyFieldList = new Vector<Object>();
m_record = (FieldList)record;
m_iKeyDup = iKeyDup;
m_strKeyName = strKeyName;
if (m_record != null)
m_record.addKeyArea(this);
if (strKeyName != null)
m_strKeyName = strKeyName;
else
{
if (m_record != null) if (m_record.getKeyAreaCount() == 1)
m_strKeyName = Constants.PRIMARY_KEY; // Default Primary key name
}
}
/**
代码示例来源:origin: org.jbundle.thin.base.db/org.jbundle.thin.base.db
/**
* Set up the raw data key areas.
* @param table The table.
* @exception DBException File exception.
*/
public void initKeyAreas(FieldTable table) throws DBException
{
if (m_VKeyList == null)
{
m_VKeyList = new Vector<PKeyArea>();
// Now, copy the keys
for (int iKeyArea = Constants.MAIN_KEY_AREA; iKeyArea <= table.getRecord().getKeyAreaCount() + Constants.MAIN_KEY_AREA - 1; iKeyArea++)
{
this.makePKeyArea(table);
}
}
}
/**
代码示例来源:origin: org.jbundle.thin.base.db/org.jbundle.thin.base.db
/**
* Set the default key order.
* @param String strKeyName the current index.
* @return The new default key area (null if not found).
*/
public KeyAreaInfo setKeyArea(String strKeyName)
{
KeyAreaInfo keyArea = null;
if (strKeyName == null)
strKeyName = Constants.PRIMARY_KEY;
for (m_iDefaultOrder = Constants.MAIN_KEY_AREA; m_iDefaultOrder < this.getKeyAreaCount() - Constants.MAIN_KEY_AREA; m_iDefaultOrder++)
{
keyArea = this.getKeyArea(m_iDefaultOrder);
if (keyArea.getKeyName().equals(strKeyName))
return keyArea; // Found key area
}
if (Constants.PRIMARY_KEY.equals(strKeyName))
{
m_iDefaultOrder = Constants.MAIN_KEY_AREA; // Set to default.
return this.getKeyArea(m_iDefaultOrder);
}
m_iDefaultOrder = Constants.MAIN_KEY_AREA; // Not found!!! Set to default.
return null;
}
/**
代码示例来源:origin: org.jbundle.thin.base.db/org.jbundle.thin.base.db
/**
* Save the current key value's in the user's keyinfo space, so you can retrieve them later.
* This is used primarly for updates and move()s.
* @param table The table.
* @return true if successful.
* @exception DBException File exception.
*/
public void saveCurrentKeys(FieldTable table, BaseBuffer bufferToSave, boolean bResetKeys) throws DBException
{
if (bufferToSave != null)
bufferToSave.bufferToFields(table.getRecord(), Constants.DONT_DISPLAY, Constants.READ_MOVE);
for (int iKeyArea = Constants.MAIN_KEY_AREA; iKeyArea < table.getRecord().getKeyAreaCount() + Constants.MAIN_KEY_AREA; iKeyArea++)
{ // Save the current keys
KeyAreaInfo keyArea = table.getRecord().getKeyArea(iKeyArea);
if (bResetKeys)
keyArea.zeroKeyFields(Constants.TEMP_KEY_AREA);
else
keyArea.setupKeyBuffer(null, Constants.TEMP_KEY_AREA);
}
}
/**
代码示例来源:origin: org.jbundle.thin.base.db/org.jbundle.thin.base.db
/**
* Delete this record.
* @param table The table.
* @exception DBException File exception.
*/
public synchronized void remove(FieldTable table) throws DBException
{
BaseBuffer bufferOld = (BaseBuffer)table.getDataSource(); // same as .getHandle(Constants.DATA_SOURCE_HANDLE);
for (int iKeyArea = Constants.MAIN_KEY_AREA; iKeyArea < table.getRecord().getKeyAreaCount() + Constants.MAIN_KEY_AREA; iKeyArea++)
{ // Delete the current key.
KeyAreaInfo keyArea = table.getRecord().getKeyArea(iKeyArea);
keyArea.reverseKeyBuffer(null, Constants.TEMP_KEY_AREA);
this.getPKeyArea(iKeyArea).doRemove(table, table.getRecord().getKeyArea(iKeyArea), bufferOld);
}
bufferOld.free(); // Get rid of the old one
table.setDataSource(null); // same as .doSetHandle(null, Constants.DATA_SOURCE_HANDLE);
}
/**
代码示例来源:origin: org.jbundle.thin.base.db/org.jbundle.thin.base.db
for (int iKeyArea = Constants.MAIN_KEY_AREA; iKeyArea < table.getRecord().getKeyAreaCount() + Constants.MAIN_KEY_AREA; iKeyArea++)
代码示例来源:origin: org.jbundle.thin.base.db/org.jbundle.thin.base.db
throw new DBException(Constants.INVALID_RECORD); // This record had been freed (deleted)
for (int iKeyArea = Constants.MAIN_KEY_AREA; iKeyArea < table.getRecord().getKeyAreaCount() + Constants.MAIN_KEY_AREA; iKeyArea++)
内容来源于网络,如有侵权,请联系作者删除!