本文整理了Java中org.jbundle.base.db.Record.getKeyName
方法的一些代码示例,展示了Record.getKeyName
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Record.getKeyName
方法的具体详情如下:
包路径:org.jbundle.base.db.Record
类名称:Record
方法名:getKeyName
暂无
代码示例来源:origin: org.jbundle.base/org.jbundle.base.mixed
/**
* Called when a new blank record is required for the table/query.
* @param bDisplayOption If true, display any changes.
*/
public void doNewRecord(boolean bDisplayOption)
{
super.doNewRecord(bDisplayOption);
if (this.getOwner().isOpen()) // Don't do first time!
{
String strUserID = ((BaseApplication)this.getOwner().getRecordOwner().getTask().getApplication()).getUserID();
int iUserID = -1;
if ((strUserID != null) && (strUserID.length() > 0))
iUserID = Integer.parseInt(strUserID);
this.getOwner().getField(UserInfo.kID).setValue(iUserID);
String strOldKey = this.getOwner().getKeyName();
try {
this.getOwner().setKeyArea(UserInfo.kIDKey);
if (!this.getOwner().seek("="))
{
this.getOwner().addNew(); // Make a new one
}
} catch (DBException ex) {
ex.printStackTrace();
} finally {
this.getOwner().setKeyArea(strOldKey);
}
}
}
/**
代码示例来源:origin: org.jbundle.main/org.jbundle.main.db
/**
* Called when a new blank record is required for the table/query.
* @param bDisplayOption If true, display any changes.
*/
public void doNewRecord(boolean bDisplayOption)
{
super.doNewRecord(bDisplayOption);
if (this.getOwner().isOpen()) // Don't do first time!
{
String strUserID = ((BaseApplication)this.getOwner().getRecordOwner().getTask().getApplication()).getUserID();
int iUserID = -1;
if ((strUserID != null) && (strUserID.length() > 0))
iUserID = Integer.parseInt(strUserID);
this.getOwner().getField(UserInfo.ID).setValue(iUserID);
String strOldKey = this.getOwner().getKeyName();
try {
this.getOwner().setKeyArea(UserInfo.ID_KEY);
if (!this.getOwner().seek("="))
{
this.getOwner().addNew(); // Make a new one
}
} catch (DBException ex) {
ex.printStackTrace();
} finally {
this.getOwner().setKeyArea(strOldKey);
}
}
}
/**
内容来源于网络,如有侵权,请联系作者删除!