public class InsertIdentityOperation extends AbstractOperation
If you are using the Microsoft driver (i.e.
com.microsoft.jdbc.sqlserver.SQLServerDriver), you'll need to
use the SelectMethod=cursor parameter in the JDBC connection
string. Your databaseUrl would look something like the following:
jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=mydb;SelectMethod=cursor
Thanks to Jeremy Stein who has submitted multiple patches.
| Modifier and Type | Field and Description |
|---|---|
static DatabaseOperation |
CLEAN_INSERT |
static IColumnFilter |
IDENTITY_FILTER_EXTENDED
Accepts columns that have one of the remarks
GENERATED BY DEFAULT AS IDENTITY
GENERATED ALWAYS AS IDENTITY
set which is the SQL standard syntax to describe auto-generated key columns.
|
static DatabaseOperation |
INSERT |
static String |
PROPERTY_IDENTITY_COLUMN_FILTER |
static DatabaseOperation |
REFRESH |
DELETE, DELETE_ALL, NONE, TRUNCATE_TABLE, UPDATE| Constructor and Description |
|---|
InsertIdentityOperation(DatabaseOperation operation)
Creates a new InsertIdentityOperation object that decorates the
specified operation.
|
| Modifier and Type | Method and Description |
|---|---|
void |
execute(IDatabaseConnection connection,
IDataSet dataSet)
Executes this operation on the specified database using the specified
dataset contents.
|
getQualifiedNameCLOSE_CONNECTION, TRANSACTIONpublic static final String PROPERTY_IDENTITY_COLUMN_FILTER
public static final DatabaseOperation INSERT
public static final DatabaseOperation CLEAN_INSERT
public static final DatabaseOperation REFRESH
public static final IColumnFilter IDENTITY_FILTER_EXTENDED
true (note that
it does not yet have the ability to check whether the column is a primary key col).public InsertIdentityOperation(DatabaseOperation operation)
public void execute(IDatabaseConnection connection, IDataSet dataSet) throws DatabaseUnitException, SQLException
DatabaseOperationexecute in class DatabaseOperationconnection - the database connection.dataSet - the dataset to be used by this operation.DatabaseUnitExceptionSQLExceptionCopyright © 2002-2017. All Rights Reserved.