Class Sql
java.lang.Object
com.djrapitops.plan.storage.database.sql.building.Sql
- Direct Known Subclasses:
Sql.MySQL
,Sql.SQLite
Duplicate String reducing utility class for SQL language Strings.
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
abstract String
dateToDayOfWeek
(String sql) abstract String
dateToDayStamp
(String sql) abstract String
dateToEpochSecond
(String sql) abstract String
dateToHour
(String sql) abstract String
dateToHourStamp
(String sql) abstract String
epochSecondToDate
(String sql) static String
static long
getDayEpochMs
(int day) Turn day of week to epoch ms.abstract String
static String
static String
static String
nParameters
(int n) static void
setStringOrNull
(PreparedStatement statement, int index, String value) static String
varchar
(int length)
-
Field Details
-
ID
- See Also:
-
P_UUID
- See Also:
-
INT
- See Also:
-
DOUBLE
- See Also:
-
LONG
- See Also:
-
BOOL
- See Also:
-
SELECT
- See Also:
-
DISTINCT
- See Also:
-
FROM
- See Also:
-
DELETE_FROM
- See Also:
-
WHERE
- See Also:
-
GROUP_BY
- See Also:
-
ORDER_BY
- See Also:
-
INNER_JOIN
- See Also:
-
LEFT_JOIN
- See Also:
-
UNION
- See Also:
-
UNION_ALL
- See Also:
-
AND
- See Also:
-
OR
- See Also:
-
IS_NULL
- See Also:
-
IS_NOT_NULL
- See Also:
-
LIMIT
- See Also:
-
OFFSET
- See Also:
-
TEXT
- See Also:
-
-
Constructor Details
-
Sql
public Sql()
-
-
Method Details
-
nParameters
-
varchar
-
floor
-
min
-
max
-
getDayEpochMs
public static long getDayEpochMs(int day) Turn day of week to epoch ms.1st of January 1970 (Epoch) is Thursday (-2).
- Parameters:
day
- 1 = Sunday, 2 = Monday etc.. 7 = Saturday- Returns:
- Milliseconds since epoch for this day to be given by
SimpleDateFormat
"EEEE"
-
setStringOrNull
public static void setStringOrNull(PreparedStatement statement, int index, String value) throws SQLException - Throws:
SQLException
-
concat
-
epochSecondToDate
-
dateToEpochSecond
-
dateToDayStamp
-
dateToHourStamp
-
dateToDayOfWeek
-
dateToHour
-
insertOrIgnore
-