本文整理了Java中org.jbundle.base.db.Record.getBaseRecord
方法的一些代码示例,展示了Record.getBaseRecord
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Record.getBaseRecord
方法的具体详情如下:
包路径:org.jbundle.base.db.Record
类名称:Record
方法名:getBaseRecord
[英]Get an actual Record to add/edit/etc... Usually used in QueryRecords.
[中]获取要添加/编辑/等的实际记录。。。通常用于QueryRecords。
代码示例来源:origin: org.jbundle.base/org.jbundle.base
/**
* Get the main record of this query, to add, edit or whatever.
* @return The base record.
*/
public Record getBaseRecord()
{
return this.getRecordlistAt(0).getBaseRecord();
}
/**
代码示例来源:origin: org.jbundle.base.db/org.jbundle.base.db
/**
* Get the main record of this query, to add, edit or whatever.
* @return The base record.
*/
public Record getBaseRecord()
{
return this.getRecordlistAt(0).getBaseRecord();
}
/**
代码示例来源:origin: org.jbundle.base/org.jbundle.base.mixed
/**
* Get the main record of this query, to add, edit or whatever.
* @return The base record.
*/
public Record getBaseRecord()
{
return this.getRecordlistAt(0).getBaseRecord();
}
/**
代码示例来源:origin: org.jbundle.base/org.jbundle.base.mixed
/**
* Get the SQL 'Insert' string.
* INSERT INTO table(field1, field2) VALUES('value1', 'value2');
* @param bUseCurrentValues If true, use the current field value, otherwise, use '?'.
* @return The SQL insert string.
*/
public String getSQLInsert(boolean bUseCurrentValues)
{
String strRecordset = this.getBaseRecord().makeTableNames(false);
String strFields = this.getBaseRecord().getSQLFields(DBConstants.SQL_INSERT_TABLE_TYPE, bUseCurrentValues);
String strValues = this.getBaseRecord().getSQLFields(DBConstants.SQL_INSERT_VALUE_TYPE, bUseCurrentValues);
strRecordset = "INSERT INTO " + strRecordset + "(" + strFields + ") VALUES (" + strValues + ")";
return strRecordset;
}
/**
代码示例来源:origin: org.jbundle.base.db/org.jbundle.base.db
/**
* Get the SQL 'Insert' string.
* INSERT INTO table(field1, field2) VALUES('value1', 'value2');
* @param bUseCurrentValues If true, use the current field value, otherwise, use '?'.
* @return The SQL insert string.
*/
public String getSQLInsert(boolean bUseCurrentValues)
{
String strRecordset = this.getBaseRecord().makeTableNames(false);
String strFields = this.getBaseRecord().getSQLFields(DBConstants.SQL_INSERT_TABLE_TYPE, bUseCurrentValues);
String strValues = this.getBaseRecord().getSQLFields(DBConstants.SQL_INSERT_VALUE_TYPE, bUseCurrentValues);
strRecordset = "INSERT INTO " + strRecordset + "(" + strFields + ") VALUES (" + strValues + ")";
return strRecordset;
}
/**
代码示例来源:origin: org.jbundle.base/org.jbundle.base
/**
* Get the SQL 'Insert' string.
* INSERT INTO table(field1, field2) VALUES('value1', 'value2');
* @param bUseCurrentValues If true, use the current field value, otherwise, use '?'.
* @return The SQL insert string.
*/
public String getSQLInsert(boolean bUseCurrentValues)
{
String strRecordset = this.getBaseRecord().makeTableNames(false);
String strFields = this.getBaseRecord().getSQLFields(DBConstants.SQL_INSERT_TABLE_TYPE, bUseCurrentValues);
String strValues = this.getBaseRecord().getSQLFields(DBConstants.SQL_INSERT_VALUE_TYPE, bUseCurrentValues);
strRecordset = "INSERT INTO " + strRecordset + "(" + strFields + ") VALUES (" + strValues + ")";
return strRecordset;
}
/**
代码示例来源:origin: org.jbundle.base.db/org.jbundle.base.db
/**
* Get the SQL 'Update' string.
* UPDATE table SET field1 = 'value1', field2 = 'value2' WHERE key = 'value'
* @param bUseCurrentValues If true, use the current field value, otherwise, use '?'.
* @param vParamList The parameter list.
* @return The SQL select string.
* @return null if nothing to update.
*/
public String getSQLUpdate(boolean bUseCurrentValues)
{
String strRecordset = this.getBaseRecord().makeTableNames(false);
KeyArea keyArea = this.getBaseRecord().getKeyArea(0); // Primary index
boolean bUseCurrentKeyValues = bUseCurrentValues ? true : keyArea.isNull(DBConstants.TEMP_KEY_AREA, true);
boolean bIsQueryRecord = this.getBaseRecord().isQueryRecord();
String sFilter = keyArea.addSelectParams("=", DBConstants.TEMP_KEY_AREA, false, bIsQueryRecord, bUseCurrentKeyValues, null, true, true); // Always add!?
if (sFilter.length() > 0)
sFilter = " WHERE " + sFilter;
String strSetValues = this.getBaseRecord().getSQLFields(DBConstants.SQL_UPDATE_TYPE, bUseCurrentValues);
if (strSetValues.length() == 0)
return null; // No fields to update
strRecordset = "UPDATE " + strRecordset + " SET " + strSetValues + sFilter;
return strRecordset;
}
/**
代码示例来源:origin: org.jbundle.base/org.jbundle.base
/**
* Set the field or file that owns this listener.
* I Check to make sure that the base tables are the same first.
* @param owner My owner.
*/
public void setOwner(ListenerOwner owner)
{
super.setOwner(owner);
if (owner != null) if (m_recordToSync != null)
{
if (!m_recordToSync.getBaseRecord().getTableNames(false).equals(this.getOwner().getBaseRecord().getTableNames(false)))
{ // Must be the same base tables!
m_recordToSync = null;
return;
}
m_recordToSync.addListener(new FileRemoveBOnCloseHandler(this));
}
}
/**
代码示例来源:origin: org.jbundle.base/org.jbundle.base.mixed
/**
* Set the field or file that owns this listener.
* I Check to make sure that the base tables are the same first.
* @param owner My owner.
*/
public void setOwner(ListenerOwner owner)
{
super.setOwner(owner);
if (owner != null) if (m_recordToSync != null)
{
if (!m_recordToSync.getBaseRecord().getTableNames(false).equals(this.getOwner().getBaseRecord().getTableNames(false)))
{ // Must be the same base tables!
m_recordToSync = null;
return;
}
m_recordToSync.addListener(new FileRemoveBOnCloseHandler(this));
}
}
/**
代码示例来源:origin: org.jbundle.base.db/org.jbundle.base.db
/**
* Set the field or file that owns this listener.
* I Check to make sure that the base tables are the same first.
* @param owner My owner.
*/
public void setOwner(ListenerOwner owner)
{
super.setOwner(owner);
if (owner != null) if (m_recordToSync != null)
{
if (!m_recordToSync.getBaseRecord().getTableNames(false).equals(this.getOwner().getBaseRecord().getTableNames(false)))
{ // Must be the same base tables!
m_recordToSync = null;
return;
}
m_recordToSync.addListener(new FileRemoveBOnCloseHandler(this));
}
}
/**
代码示例来源:origin: org.jbundle.base/org.jbundle.base
/**
* Get the image for Buttons and Bitmaps and drag cursors.
* (Previously getBitmap).
* Return The bitmap for the current table.
*/
public String getBitmap()
{
if (m_recTarget != null)
{
Record recTarget = null;
if (m_recTarget.getBaseRecord().getTable().getCurrentTable() != null)
recTarget = m_recTarget.getBaseRecord().getTable().getCurrentTable().getRecord();
if (recTarget != null)
return recTarget.getBitmap(); // Bitmap for this table
}
return super.getBitmap(); // Default value
}
/**
代码示例来源:origin: org.jbundle.base/org.jbundle.base.mixed
/**
* Get the image for Buttons and Bitmaps and drag cursors.
* (Previously getBitmap).
* Return The bitmap for the current table.
*/
public String getBitmap()
{
if (m_recTarget != null)
{
Record recTarget = null;
if (m_recTarget.getBaseRecord().getTable().getCurrentTable() != null)
recTarget = m_recTarget.getBaseRecord().getTable().getCurrentTable().getRecord();
if (recTarget != null)
return recTarget.getBitmap(); // Bitmap for this table
}
return super.getBitmap(); // Default value
}
/**
代码示例来源:origin: org.jbundle.base.db/org.jbundle.base.db
/**
* Get the image for Buttons and Bitmaps and drag cursors.
* (Previously getBitmap).
* Return The bitmap for the current table.
*/
public String getBitmap()
{
if (m_recTarget != null)
{
Record recTarget = null;
if (m_recTarget.getBaseRecord().getTable().getCurrentTable() != null)
recTarget = m_recTarget.getBaseRecord().getTable().getCurrentTable().getRecord();
if (recTarget != null)
return recTarget.getBitmap(); // Bitmap for this table
}
return super.getBitmap(); // Default value
}
/**
代码示例来源:origin: org.jbundle.base/org.jbundle.base
/**
* Get the SQL 'Delete' string.
* DELETE table WHERE key=value;
* @param bUseCurrentValues If true, insert field values, if false, insert '?'
* @return The SQL delete string.
*/
public String getSQLDelete(boolean bUseCurrentValues)
{
String strRecordset = this.getBaseRecord().makeTableNames(false);
KeyArea keyArea = this.getKeyArea(0); // Primary index
boolean bIsQueryRecord = this.isQueryRecord();
boolean bUseCurrentKeyValues = bUseCurrentValues ? true : keyArea.isNull(DBConstants.TEMP_KEY_AREA, false);
String sFilter = "?";
sFilter = keyArea.addSelectParams("=", DBConstants.TEMP_KEY_AREA, false, bIsQueryRecord, bUseCurrentKeyValues, null, true, false); // Always add!?
if (sFilter.length() > 0)
sFilter = " WHERE " + sFilter;
strRecordset = "DELETE FROM " + strRecordset + sFilter;
return strRecordset;
}
/**
代码示例来源:origin: org.jbundle.base/org.jbundle.base.mixed
/**
* Get the SQL 'Delete' string.
* DELETE table WHERE key=value;
* @param bUseCurrentValues If true, insert field values, if false, insert '?'
* @return The SQL delete string.
*/
public String getSQLDelete(boolean bUseCurrentValues)
{
String strRecordset = this.getBaseRecord().makeTableNames(false);
KeyArea keyArea = this.getKeyArea(0); // Primary index
boolean bIsQueryRecord = this.isQueryRecord();
boolean bUseCurrentKeyValues = bUseCurrentValues ? true : keyArea.isNull(DBConstants.TEMP_KEY_AREA, false);
String sFilter = "?";
sFilter = keyArea.addSelectParams("=", DBConstants.TEMP_KEY_AREA, false, bIsQueryRecord, bUseCurrentKeyValues, null, true, false); // Always add!?
if (sFilter.length() > 0)
sFilter = " WHERE " + sFilter;
strRecordset = "DELETE FROM " + strRecordset + sFilter;
return strRecordset;
}
/**
代码示例来源:origin: org.jbundle.base.db/org.jbundle.base.db
/**
* Get the SQL 'Delete' string.
* DELETE table WHERE key=value;
* @param bUseCurrentValues If true, insert field values, if false, insert '?'
* @return The SQL delete string.
*/
public String getSQLDelete(boolean bUseCurrentValues)
{
String strRecordset = this.getBaseRecord().makeTableNames(false);
KeyArea keyArea = this.getKeyArea(0); // Primary index
boolean bIsQueryRecord = this.isQueryRecord();
boolean bUseCurrentKeyValues = bUseCurrentValues ? true : keyArea.isNull(DBConstants.TEMP_KEY_AREA, false);
String sFilter = "?";
sFilter = keyArea.addSelectParams("=", DBConstants.TEMP_KEY_AREA, false, bIsQueryRecord, bUseCurrentKeyValues, null, true, false); // Always add!?
if (sFilter.length() > 0)
sFilter = " WHERE " + sFilter;
strRecordset = "DELETE FROM " + strRecordset + sFilter;
return strRecordset;
}
/**
代码示例来源:origin: org.jbundle.base/org.jbundle.base.mixed
/**
* Find the sub-screen that uses this grid query and set for selection.
* When you select a new record here, you read the same record in the SelectQuery.
* @param recMaint The record which is synced on record change.
* @param bUpdateOnSelect Do I update the current record if a selection occurs.
* @return True if successful.
*/
public boolean setSelectQuery(Record recMaint, boolean bUpdateOnSelect)
{
if (recMaint == null)
return true; // BaseTable Set!
if (this.getMainRecord() != null)
if (this.getMainRecord() != recMaint)
if (this.getMainRecord().getBaseRecord().getTableNames(false).equals(recMaint.getTableNames(false)))
{ // Only trigger when the grid table sends the selection message
this.getMainRecord().addListener(new OnSelectHandler(recMaint, bUpdateOnSelect, DBConstants.USER_DEFINED_TYPE));
return true; // BaseTable Set!
}
return false;
}
/**
代码示例来源:origin: org.jbundle.base.screen/org.jbundle.base.screen.model
/**
* Find the sub-screen that uses this grid query and set for selection.
* When you select a new record here, you read the same record in the SelectQuery.
* @param recMaint The record which is synced on record change.
* @param bUpdateOnSelect Do I update the current record if a selection occurs.
* @return True if successful.
*/
public boolean setSelectQuery(Rec recMaint, boolean bUpdateOnSelect)
{
if (recMaint == null)
{
return true; // BaseTable Set!
}
if (this.getMainRecord() != null)
if (this.getMainRecord() != recMaint)
if (this.getMainRecord().getBaseRecord().getTableNames(false).equals(recMaint.getTableNames(false)))
{
this.getMainRecord().addListener(new SelectOnUpdateHandler((Record)recMaint, bUpdateOnSelect));
return true; // BaseTable Set!
}
return false;
}
/**
代码示例来源:origin: org.jbundle.base.screen/org.jbundle.base.screen.model
/**
* Find the sub-screen that uses this grid query and set for selection.
* When you select a new record here, you read the same record in the SelectQuery.
* @param recMaint The record which is synced on record change.
* @param bUpdateOnSelect Do I update the current record if a selection occurs.
* @return True if successful.
*/
public boolean setSelectQuery(Rec recMaint, boolean bUpdateOnSelect)
{
if (recMaint == null)
return true; // BaseTable Set!
if (this.getMainRecord() != null)
if (this.getMainRecord() != recMaint)
if (this.getMainRecord().getBaseRecord().getTableNames(false).equals(recMaint.getTableNames(false)))
{ // Only trigger when the grid table sends the selection message
this.getMainRecord().addListener(new OnSelectHandler((Record)recMaint, bUpdateOnSelect, DBConstants.USER_DEFINED_TYPE));
return true; // BaseTable Set!
}
return false;
}
/**
代码示例来源:origin: org.jbundle.base/org.jbundle.base.mixed
/**
* Find the sub-screen that uses this grid query and set for selection.
* When you select a new record here, you read the same record in the SelectQuery.
* @param recMaint The record which is synced on record change.
* @param bUpdateOnSelect Do I update the current record if a selection occurs.
* @return True if successful.
*/
public boolean setSelectQuery(Record recMaint, boolean bUpdateOnSelect)
{
if (recMaint == null)
{
return true; // BaseTable Set!
}
if (this.getMainRecord() != null)
if (this.getMainRecord() != recMaint)
if (this.getMainRecord().getBaseRecord().getTableNames(false).equals(recMaint.getTableNames(false)))
{
this.getMainRecord().addListener(new SelectOnUpdateHandler(recMaint, bUpdateOnSelect));
return true; // BaseTable Set!
}
return false;
}
/**
内容来源于网络,如有侵权,请联系作者删除!