@Test public void testSequence(){ Connection conn = dbResource.getConnection(); DBDatabaseDriver driver = dbResource.newDriver(); SeqDB db = new SeqDB(); db.open(driver, dbResource.getConnection()); DBSQLScript script = new DBSQLScript(); db.getCreateDDLScript(db.getDriver(), script); script.executeAll(db.getDriver(), dbResource.getConnection(), false); DBRecord data = new DBRecord(); data.create(db.DATA); data.setValue(db.DATA.VALUE, "test"); data.update(conn); final Object id = data.getLong(db.DATA.ID); DBRecord read = new DBRecord(); read.read(db.DATA, id, conn); assertEquals("test", read.getString(db.DATA.VALUE)); script = new DBSQLScript(); db.getDriver().getDDLScript(DBCmdType.DROP, db.DATA, script); script.executeAll(db.getDriver(), conn, true); }
@Override public void getDDLScript(DBCmdType type, DBObject dbo, DBSQLScript script) { if (ddlGenerator==null) ddlGenerator = new HSqlDDLGenerator(this); ddlGenerator.getDDLScript(type, dbo, script); }
DBDatabaseDriverHSql extends DBDatabaseDriver { @Override public void getDDLScript(DBCmdType type, DBObject dbo, DBSQLScript script) { if (ddlGenerator==null) ddlGenerator = new HSqlDDLGenerator(this); ddlGenerator.getDDLScript(type, dbo, script); } }
DBDatabaseDriverHSql extends DBDatabaseDriver { @Override public void getDDLScript(DBCmdType type, DBObject dbo, DBSQLScript script) { if (ddlGenerator==null) ddlGenerator = new HSqlDDLGenerator(this); ddlGenerator.getDDLScript(type, dbo, script); } DBDatabaseDriverHSql(); }
DBDatabaseDriverHSql extends DBDatabaseDriver { @Override public void getDDLScript(DBCmdType type, DBObject dbo, DBSQLScript script) { if (ddlGenerator==null) ddlGenerator = new HSqlDDLGenerator(this); ddlGenerator.getDDLScript(type, dbo, script); } DBDatabaseDriverHSql(); @Override DBCommand createCommand(DBDatabase db); @Override boolean isSupported(DBDriverFeature type); @Override String getSQLPhrase(int phrase); @Override String getConvertPhrase(DataType destType, DataType srcType, Object format); @Override Object getNextSequenceValue(DBDatabase db, String seqName, int minValue, Connection conn); @Override DBColumnExpr getNextSequenceValueExpr(DBTableColumn column); @Override java.sql.Timestamp getUpdateTimestamp(Connection conn); @Override void getDDLScript(DBCmdType type, DBObject dbo, DBSQLScript script); }
DBDatabaseDriverHSql extends DBDatabaseDriver { @Override public void getDDLScript(DBCmdType type, DBObject dbo, DBSQLScript script) { if (ddlGenerator==null) ddlGenerator = new HSqlDDLGenerator(this); ddlGenerator.getDDLScript(type, dbo, script); } DBDatabaseDriverHSql(); @Override DBCommand createCommand(DBDatabase db); @Override boolean isSupported(DBDriverFeature type); @Override String getSQLPhrase(int phrase); @Override String getConvertPhrase(DataType destType, DataType srcType, Object format); @Override Object getNextSequenceValue(DBDatabase db, String seqName, int minValue, Connection conn); @Override DBColumnExpr getNextSequenceValueExpr(DBTableColumn column); @Override java.sql.Timestamp getUpdateTimestamp(Connection conn); @Override void getDDLScript(DBCmdType type, DBObject dbo, DBSQLScript script);  }