createSQL += " " + strBuffer.toString();
log.debug("create sql = " + createSQL);
inputs = addMoreProperties(inputs, null);
OmniDTO returnTO =
getSqlService().execute(inputs, DataProcessorTypes.DIRECT_SQL_STATEMENT_PROCESSOR, createSQL);
int count = returnTO.getUpdatedRowCount();
if (count != 1) {
log.error("Only one record should be created, but " + count +
" objects were created instead.");
}
//populate auto-generated primary keys
if (autoPopulatePrimaryKey) {
long gpk = returnTO.getGeneratedKey();
if (gpk != -1) {
Map<String, Object> pkMap = getPrimaryKeyDataMap();
Iterator<String> it = pkMap.keySet().iterator();
if(it.hasNext()) { //only one column is allowed to be auto-generated primary key
setData((String)it.next(), Long.valueOf(gpk));