Class QueryBuilder
- java.lang.Object
-
- com.github.amjadnas.sqldbmanager.utills.QueryBuilder
-
public final class QueryBuilder extends java.lang.Object
Utility class used to create queries based on provided values
-
-
Method Summary
Modifier and Type Method Description static java.lang.String
deleteQuery(java.lang.String tableName, java.lang.String[] primary)
creates update querystatic java.lang.String
insertQuery(java.lang.String tableName, java.util.List<Pair<java.lang.String,java.lang.Object>> pairs)
creates insert querystatic java.lang.String
updateQuery(java.lang.String tableName, java.lang.String[] primary, java.util.List<Pair<java.lang.String,java.lang.Object>> pairs)
creates update query
-
-
-
Method Detail
-
insertQuery
public static java.lang.String insertQuery(java.lang.String tableName, java.util.List<Pair<java.lang.String,java.lang.Object>> pairs)
creates insert query- Parameters:
tableName
- the name of table in the databasepairs
- pairs of key column names and their values- Returns:
- string of the insert query
-
updateQuery
public static java.lang.String updateQuery(java.lang.String tableName, java.lang.String[] primary, java.util.List<Pair<java.lang.String,java.lang.Object>> pairs)
creates update query- Parameters:
tableName
- the name of table in the databaseprimary
- array of strings that represent the primary key of the tablepairs
- pairs of key column names and their values- Returns:
- string of the update query
-
deleteQuery
public static java.lang.String deleteQuery(java.lang.String tableName, java.lang.String[] primary)
creates update query- Parameters:
tableName
- the name of table in the databaseprimary
- array of strings that represent the primary key of the table- Returns:
- string of the delete query
-
-