Class QueryBuilder
- java.lang.Object
-
- com.github.amjadnas.sqldbmanager.utills.QueryBuilder
-
public final class QueryBuilder extends Object
Utility class used to create queries based on provided values
-
-
Method Summary
Modifier and Type Method Description static StringdeleteQuery(String tableName, String[] primary)creates update querystatic StringinsertQuery(String tableName, List<Pair<String,Object>> pairs)creates insert querystatic StringupdateQuery(String tableName, String[] primary, List<Pair<String,Object>> pairs)creates update query
-
-
-
Method Detail
-
insertQuery
public static String insertQuery(String tableName, List<Pair<String,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 String updateQuery(String tableName, String[] primary, List<Pair<String,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
-
-