| 1 |
/* |
| 2 |
* Copyright 2004-2023 H2 Group. Multiple-Licensed under the MPL 2.0, |
| 3 |
* and the EPL 1.0 (https://h2database.com/html/license.html). |
| 4 |
* Initial Developer: H2 Group |
| 5 |
*/ |
| 6 |
package org.h2.command.dml; |
| 7 |
|
| 8 |
import java.util.ArrayList; |
| 9 |
|
| 10 |
import org.h2.engine.SessionLocal; |
| 11 |
import org.h2.expression.Expression; |
| 12 |
import org.h2.util.Utils; |
| 13 |
|
| 14 |
/** |
| 15 |
* Command that supports VALUES clause. |
| 16 |
*/ |
| 17 |
public abstract class CommandWithValues extends DataChangeStatement { |
| 18 |
|
| 19 |
/** |
| 20 |
* Expression data for the VALUES clause. |
| 21 |
*/ |
| 22 |
protected final ArrayList<Expression[]> valuesExpressionList = Utils.newSmallArrayList(); |
| 23 |
|
| 24 |
/** |
| 25 |
* Creates new instance of command with VALUES clause. |
| 26 |
* |
| 27 |
* @param session |
| 28 |
* the session |
| 29 |
*/ |
| 30 |
protected CommandWithValues(SessionLocal session) { |
| 31 |
super(session); |
| 32 |
} |
| 33 |
|
| 34 |
/** |
| 35 |
* Add a row to this command. |
| 36 |
* |
| 37 |
* @param expr |
| 38 |
* the list of values |
| 39 |
*/ |
| 40 |
public void addRow(Expression[] expr) { |
| 41 |
valuesExpressionList.add(expr); |
| 42 |
} |
| 43 |
|
| 44 |
} |