Package guru.mikelue.jdut.operation
Class DefaultOperators
- java.lang.Object
-
- guru.mikelue.jdut.operation.DefaultOperators
-
public final class DefaultOperators extends Object
Defines the name of operators.
This class defines two sets for default operators,
DataGrainOperator
andDataRowOperator
.
In case you want to customize operation perDataRow
, the ones are what you want.
-
-
Field Summary
Fields Modifier and Type Field Description static String
DELETE
As the name of DELETE(delete single data by key filter).static String
DELETE_ALL
As the name of DELETE(delete all data of table).static String
INSERT
As the name of INSERT(data must not be existing).static String
NONE
As the name of NONE(do nothing).static String
REFRESH
As the name of REFRESH(data may be or may not be existing).static String
TRUNCATE
As the name of TRUNCATE(non-undo truncating of data of table).static String
UPDATE
As the name of UPDATE(data must be existing).
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DataGrain
delete(Connection conn, DataGrain dataGrain)
Default operator of removal of a row of data.static DataGrain
deleteAll(Connection conn, DataGrain dataGrain)
Default operator of removal of all data of a table.static DataRow
doDelete(Connection conn, DataRow dataRow)
Default operator of delete.static DataRow
doDeleteAll(Connection conn, DataRow dataRow)
Default operator of delete all.static DataRow
doInsert(Connection conn, DataRow dataRow)
Default operator of insertion.static DataRow
doRefresh(Connection conn, DataRow dataRow)
Default operator of refresh.static DataRow
doTruncate(Connection conn, DataRow dataRow)
Default operator of truncate.static DataRow
doUpdate(Connection conn, DataRow dataRow)
Default operator of update.static DataGrain
insert(Connection conn, DataGrain dataGrain)
Default operator of insertion.static DataGrain
none(Connection conn, DataGrain dataGrain)
Default operator of do nothing.static DataGrain
refresh(Connection conn, DataGrain dataGrain)
Default operator of refresh(insert or update).static DataGrain
truncate(Connection conn, DataGrain dataGrain)
Default operator of truncating table.static DataGrain
update(Connection conn, DataGrain dataGrain)
Default operator of update.
-
-
-
Field Detail
-
INSERT
public static final String INSERT
As the name of INSERT(data must not be existing).- See Also:
- Constant Field Values
-
UPDATE
public static final String UPDATE
As the name of UPDATE(data must be existing).- See Also:
- Constant Field Values
-
REFRESH
public static final String REFRESH
As the name of REFRESH(data may be or may not be existing).- See Also:
- Constant Field Values
-
DELETE
public static final String DELETE
As the name of DELETE(delete single data by key filter).- See Also:
- Constant Field Values
-
DELETE_ALL
public static final String DELETE_ALL
As the name of DELETE(delete all data of table).- See Also:
- Constant Field Values
-
TRUNCATE
public static final String TRUNCATE
As the name of TRUNCATE(non-undo truncating of data of table).- See Also:
- Constant Field Values
-
NONE
public static final String NONE
As the name of NONE(do nothing).- See Also:
- Constant Field Values
-
-
Method Detail
-
insert
public static DataGrain insert(Connection conn, DataGrain dataGrain) throws SQLException
Default operator of insertion. As lambda ofDataGrainOperator
.- Parameters:
conn
- The connection object of initializeddataGrain
- The data grain to be processed- Returns:
- input data grain
- Throws:
SQLException
- as the defined functional interface
-
update
public static DataGrain update(Connection conn, DataGrain dataGrain) throws SQLException
Default operator of update. As lambda ofDataGrainOperator
.- Parameters:
conn
- The connection object of initializeddataGrain
- The data grain to be processed- Returns:
- input data grain
- Throws:
SQLException
- as the defined functional interface
-
refresh
public static DataGrain refresh(Connection conn, DataGrain dataGrain) throws SQLException
Default operator of refresh(insert or update). As lambda ofDataGrainOperator
.- Parameters:
conn
- The connection object of initializeddataGrain
- The data grain to be processed- Returns:
- input data grain
- Throws:
SQLException
- as the defined functional interface
-
delete
public static DataGrain delete(Connection conn, DataGrain dataGrain) throws SQLException
Default operator of removal of a row of data. As lambda ofDataGrainOperator
.- Parameters:
conn
- The connection object of initializeddataGrain
- The data grain to be processed- Returns:
- input data grain
- Throws:
SQLException
- as the defined functional interface
-
deleteAll
public static DataGrain deleteAll(Connection conn, DataGrain dataGrain) throws SQLException
Default operator of removal of all data of a table. As lambda ofDataGrainOperator
.
This operator is wrapped by
TableBasedOperator
(not thread-safe).- Parameters:
conn
- The connection object of initializeddataGrain
- The data grain to be processed- Returns:
- input data grain
- Throws:
SQLException
- as the defined functional interface
-
truncate
public static DataGrain truncate(Connection conn, DataGrain dataGrain) throws SQLException
Default operator of truncating table. As lambda ofDataGrainOperator
.This operator is wrapped by
TableBasedOperator
(not thread-safe).- Parameters:
conn
- The connection object of initializeddataGrain
- The data grain to be processed- Returns:
- input data grain
- Throws:
SQLException
- as the defined functional interface
-
none
public static DataGrain none(Connection conn, DataGrain dataGrain) throws SQLException
Default operator of do nothing. As lambda ofDataGrainOperator
.- Parameters:
conn
- The connection object of initializeddataGrain
- The data grain to be processed- Returns:
- input data grain
- Throws:
SQLException
- as the defined functional interface
-
doInsert
public static DataRow doInsert(Connection conn, DataRow dataRow) throws SQLException
Default operator of insertion. As lambda ofDataRowOperator
.- Parameters:
conn
- The connection object of initializeddataRow
- The data row to be processed- Returns:
- input data row
- Throws:
SQLException
- as the defined functional interface
-
doUpdate
public static DataRow doUpdate(Connection conn, DataRow dataRow) throws SQLException
Default operator of update. As lambda ofDataRowOperator
.- Parameters:
conn
- The connection object of initializeddataRow
- The data row to be processed- Returns:
- input data row
- Throws:
SQLException
- as the defined functional interface
-
doRefresh
public static DataRow doRefresh(Connection conn, DataRow dataRow) throws SQLException
Default operator of refresh. As lambda ofDataRowOperator
.- Parameters:
conn
- The connection object of initializeddataRow
- The data row to be processed- Returns:
- input data row
- Throws:
SQLException
- as the defined functional interface
-
doDelete
public static DataRow doDelete(Connection conn, DataRow dataRow) throws SQLException
Default operator of delete. As lambda ofDataRowOperator
.- Parameters:
conn
- The connection object of initializeddataRow
- The data row to be processed- Returns:
- input data row
- Throws:
SQLException
- as the defined functional interface
-
doDeleteAll
public static DataRow doDeleteAll(Connection conn, DataRow dataRow) throws SQLException
Default operator of delete all. As lambda ofDataRowOperator
.- Parameters:
conn
- The connection object of initializeddataRow
- The data row to be processed- Returns:
- input data row
- Throws:
SQLException
- as the defined functional interface- See Also:
TableBasedOperator
-
doTruncate
public static DataRow doTruncate(Connection conn, DataRow dataRow) throws SQLException
Default operator of truncate. As lambda ofDataRowOperator
.- Parameters:
conn
- The connection object of initializeddataRow
- The data row to be processed- Returns:
- input data row
- Throws:
SQLException
- as the defined functional interface- See Also:
TableBasedOperator
-
-