本文整理了Java中org.jbundle.base.db.Record.add
方法的一些代码示例,展示了Record.add
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Record.add
方法的具体详情如下:
包路径:org.jbundle.base.db.Record
类名称:Record
方法名:add
[英]Add this record.
For new records: The new record is added to the table, sometimes in the correct order, sometimes at the end of the table. Leaves the current position unchanged.
[中]添加此记录。
对于新记录:新记录被添加到表中,有时按正确的顺序,有时在表的末尾。保持当前位置不变。
代码示例来源: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: 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: com.tourapp.tour/com.tourapp.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.misc
/**
* Same as onAdd, but don't clear the record, so I can redisplay it.
*/
public boolean onAdd()
{
Record record = this.getMainRecord();
try
{
if (record.isModified(false))
{
if (record.getEditMode() == Constants.EDIT_IN_PROGRESS)
record.set();
else if (record.getEditMode() == Constants.EDIT_ADD)
record.add();
}
//x record.addNew();
}
catch(DBException e)
{
this.displayError(e);
}
return true;
}
/**
代码示例来源:origin: org.jbundle.base/org.jbundle.base.mixed
/**
* Add/update this summary record.
* @param recSummary The destination summary record.
* @param mxKeyFields The key fields map.
* @param mxDataFields The data fields map.
*/
public void addSummary(Record recSummary, BaseField[][] mxKeyFields, BaseField[][] mxDataFields)
{
try {
recSummary.addNew();
// First move the key to see if a record exists
this.setupSummaryKey(mxKeyFields);
boolean bSuccess = recSummary.seek("=");
if (bSuccess)
recSummary.edit();
else
{
recSummary.addNew();
this.setupSummaryKey(mxKeyFields);
}
this.addSummaryData(mxDataFields);
if (bSuccess)
recSummary.set();
else
recSummary.add();
} catch (DBException ex) {
ex.printStackTrace();
}
}
/**
代码示例来源:origin: org.jbundle.base/org.jbundle.base.mixed
/**
* 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.screen/org.jbundle.base.screen.model
/**
* Add/update this summary record.
* @param recSummary The destination summary record.
* @param mxKeyFields The key fields map.
* @param mxDataFields The data fields map.
*/
public void addSummary(Record recSummary, BaseField[][] mxKeyFields, BaseField[][] mxDataFields)
{
try {
recSummary.addNew();
// First move the key to see if a record exists
this.setupSummaryKey(mxKeyFields);
boolean bSuccess = recSummary.seek("=");
if (bSuccess)
recSummary.edit();
else
{
recSummary.addNew();
this.setupSummaryKey(mxKeyFields);
}
this.addSummaryData(mxDataFields);
if (bSuccess)
recSummary.set();
else
recSummary.add();
} catch (DBException ex) {
ex.printStackTrace();
}
}
/**
代码示例来源:origin: org.jbundle.base/org.jbundle.base
/**
* 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();
}
}
if (fieldToUpdate != null)
{
fieldToUpdate.setModified(true);
//?result = fieldToUpdate.getRecord().handleRecordChange(m_fldTarget, DBConstants.FIELD_CHANGED_TYPE, bDisplayOption); // Tell table that I'm getting changed (if not locked)
}
} catch(DBException ex) {
ex.printStackTrace();
}
return DBConstants.NORMAL_RETURN; // For now
}
/**
代码示例来源:origin: org.jbundle.base/org.jbundle.base.mixed
recPropertiesInput.add();
代码示例来源:origin: org.jbundle.base/org.jbundle.base
recUserInfo.add();
else
recUserInfo.set();
代码示例来源:origin: org.jbundle.base.screen/org.jbundle.base.screen.model
/**
* Process the "Add" toolbar command.
* @return true If command was handled
*/
public boolean onAdd()
{
Record record = this.getMainRecord();
if (record == null)
return false;
try {
if (record.isModified(false))
{
if (record.getEditMode() == Constants.EDIT_IN_PROGRESS)
record.set();
else if (record.getEditMode() == Constants.EDIT_ADD)
record.add();
}
record.addNew();
this.clearStatusText();
} catch(DBException ex) {
this.displayError(ex);
return false;
}
return true;
}
/**
代码示例来源:origin: org.jbundle.base/org.jbundle.base.mixed
recUserInfo.add();
else
recUserInfo.set();
代码示例来源:origin: org.jbundle.base/org.jbundle.base.mixed
/**
* Process the "Add" toolbar command.
* @return true If command was handled
*/
public boolean onAdd()
{
Record record = this.getMainRecord();
if (record == null)
return false;
try {
if (record.isModified(false))
{
if (record.getEditMode() == Constants.EDIT_IN_PROGRESS)
record.set();
else if (record.getEditMode() == Constants.EDIT_ADD)
record.add();
}
record.addNew();
this.clearStatusText();
} catch(DBException ex) {
this.displayError(ex);
return false;
}
return true;
}
/**
代码示例来源:origin: com.tourgeek.tour/com.tourgeek.tour.booking.db
Record recBookingDetail = this.getTable().getCurrentTable().getRecord();
if (recBookingDetail.getEditMode() == DBConstants.EDIT_ADD)
recBookingDetail.add();
else if (recBookingDetail.getEditMode() == DBConstants.EDIT_IN_PROGRESS)
代码示例来源: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
/**
* 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.tourapp.tour/com.tourapp.tour.request.report
recRequest.add();
Object bookmark = recRequest.getLastModified(DBConstants.BOOKMARK_HANDLE);
recRequest.setHandle(bookmark, DBConstants.BOOKMARK_HANDLE);
代码示例来源:origin: com.tourgeek.tour/com.tourgeek.tour.request.report
recRequest.add();
Object bookmark = recRequest.getLastModified(DBConstants.BOOKMARK_HANDLE);
recRequest.setHandle(bookmark, DBConstants.BOOKMARK_HANDLE);
代码示例来源:origin: com.tourapp.tour/com.tourapp.tour.request.report
recRequestHistory.add();
Object bookmark = recRequestHistory.getLastModified(DBConstants.BOOKMARK_HANDLE);
recRequestHistory.setHandle(bookmark, DBConstants.BOOKMARK_HANDLE);
代码示例来源:origin: com.tourgeek.tour/com.tourgeek.tour.request.report
recRequestHistory.add();
Object bookmark = recRequestHistory.getLastModified(DBConstants.BOOKMARK_HANDLE);
recRequestHistory.setHandle(bookmark, DBConstants.BOOKMARK_HANDLE);
内容来源于网络,如有侵权,请联系作者删除!