Example #1
0
 synchronized Row getNullRow() {
   if (nullRow == null) {
     nullRow = new Row(new Value[columns.length], 1);
     for (int i = 0; i < columns.length; i++) {
       nullRow.setValue(i, ValueNull.INSTANCE);
     }
   }
   return nullRow;
 }
Example #2
0
 protected Row createRow(Value[] values) {
   Row newRow = table.getTemplateRow();
   for (int j = 0; j < columns.length; j++) {
     Column c = columns[j];
     int index = c.getColumnId();
     Value v = c.convert(values[j]);
     newRow.setValue(index, v);
   }
   return newRow;
 }
Example #3
0
 /**
  * Validate all values in this row, convert the values if required, and update the sequence values
  * if required. This call will also set the default values if required and set the computed column
  * if there are any.
  *
  * @param session the session
  * @param row the row
  */
 public void validateConvertUpdateSequence(Session session, Row row) {
   for (int i = 0; i < columns.length; i++) {
     Value value = row.getValue(i);
     Column column = columns[i];
     Value v2;
     if (column.getComputed()) {
       // force updating the value
       value = null;
       v2 = column.computeValue(session, row);
     }
     v2 = column.validateConvertUpdateSequence(session, value);
     if (v2 != value) {
       row.setValue(i, v2);
     }
   }
 }
Example #4
0
 protected Row createRow(Expression[] expr, int rowId) {
   Row newRow = table.getTemplateRow();
   for (int i = 0, len = columns.length; i < len; i++) {
     Column c = columns[i];
     int index = c.getColumnId();
     Expression e = expr[i];
     if (e != null) {
       // e can be null (DEFAULT)
       try {
         Value v = c.convert(e.getValue(session));
         newRow.setValue(index, v);
       } catch (DbException ex) {
         throw setRow(ex, rowId, getSQL(expr));
       }
     }
   }
   return newRow;
 }