@Test public void getCustomLockCreateSchemaStatements() { customizeStatements(); String[] expectedCreateSchemaStmts = new String[] { "CREATE TABLE test.LOCK_TABLE (MOMENT NUMBER(20), NODE VARCHAR2(30))", "INSERT INTO test.LOCK_TABLE (MOMENT, NODE) VALUES (2, 'node_1')"}; assertArrayEquals(expectedCreateSchemaStmts, statements.getLockCreateSchemaStatements(2)); }
public String[] getLockCreateSchemaStatements(long moment) { if (lockCreateSchemaStatements == null) { lockCreateSchemaStatements = new String[] { "CREATE TABLE " + getFullLockTableName() + " (MOMENT " + getMomentColumnDataType() + ", NODE " + getNodeColumnDataType() + ")", "INSERT INTO " + getFullLockTableName() + " (MOMENT, NODE) VALUES (" + moment + ", '" + getNodeName() + "')", }; } return lockCreateSchemaStatements; }
Statements { public String[] getLockCreateSchemaStatements(long moment) { if (lockCreateSchemaStatements == null) { lockCreateSchemaStatements = new String[] { "CREATE TABLE " + getFullLockTableName() + " (MOMENT " + getMomentColumnDataType() + ", NODE " + getNodeColumnDataType() + ")", "INSERT INTO " + getFullLockTableName() + " (MOMENT, NODE) VALUES (" + moment + ", '" + getNodeName() + "')", }; } return lockCreateSchemaStatements; } }
Statements { public String[] getLockCreateSchemaStatements(long moment) { if (lockCreateSchemaStatements == null) { lockCreateSchemaStatements = new String[] { "CREATE TABLE " + getFullLockTableName() + " (MOMENT " + getMomentColumnDataType() + ", NODE " + getNodeColumnDataType() + ")", "INSERT INTO " + getFullLockTableName() + " (MOMENT, NODE) VALUES (" + moment + ", '" + getNodeName() + "')", }; } return lockCreateSchemaStatements; }  }
Statements { public String[] getLockCreateSchemaStatements(long moment) { if (lockCreateSchemaStatements == null) { lockCreateSchemaStatements = new String[] { "CREATE TABLE " + getFullLockTableName() + " (MOMENT " + getMomentColumnDataType() + ", NODE " + getNodeColumnDataType() + ")", "INSERT INTO " + getFullLockTableName() + " (MOMENT, NODE) VALUES (" + moment + ", '" + getNodeName() + "')", }; } return lockCreateSchemaStatements; }  String[] getLockCreateSchemaStatements(long moment); void setLockCreateSchemaStatements(String[] lockCreateSchemaStatements); String getLockCreateStatement(); void setLockCreateStatement(String lockCreateStatement); String getLockUpdateStatement(long moment); void setLockUpdateStatement(String lockUpdateStatement); void setLockVerifySelectionNotEmptyStatement(String lockVerifySelectionNotEmptyStatement); String getLockVerifySelectionNotEmptyStatement(); String getFullLockTableName(); void setMomentColumnDataType(String momentColumnDataType); String getMomentColumnDataType(); String getNodeName(); void setNodeName(String nodeName); String getNodeColumnDataType(); void setNodeColumnDataType(String nodeColumnDataType); String getTablePrefix(); void setTablePrefix(String tablePrefix); String getTableName(); void setTableName(String tableName); }
Statements { public String[] getLockCreateSchemaStatements(long moment) { if (lockCreateSchemaStatements == null) { lockCreateSchemaStatements = new String[] { "CREATE TABLE " + getFullLockTableName() + " (MOMENT " + getMomentColumnDataType() + ", NODE " + getNodeColumnDataType() + ")", "INSERT INTO " + getFullLockTableName() + " (MOMENT, NODE) VALUES (" + moment + ", '" + getNodeName() + "')", }; } return lockCreateSchemaStatements; }  String[] getLockCreateSchemaStatements(long moment); void setLockCreateSchemaStatements(String[] lockCreateSchemaStatements); String getLockCreateStatement(); void setLockCreateStatement(String lockCreateStatement); String getLockUpdateStatement(long moment); void setLockUpdateStatement(String lockUpdateStatement); void setLockVerifySelectionNotEmptyStatement(String lockVerifySelectionNotEmptyStatement); String getLockVerifySelectionNotEmptyStatement(); String getFullLockTableName(); void setMomentColumnDataType(String momentColumnDataType); String getMomentColumnDataType(); String getNodeName(); void setNodeName(String nodeName); String getNodeColumnDataType(); void setNodeColumnDataType(String nodeColumnDataType); String getTablePrefix(); void setTablePrefix(String tablePrefix); String getTableName(); void setTableName(String tableName);  }