diff --git a/pom.xml b/pom.xml index c00c192..2a93c53 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.example Widerhall - 0.2.2 + 0.2.3 diff --git a/src/main/java/de/srsoftware/widerhall/data/Database.java b/src/main/java/de/srsoftware/widerhall/data/Database.java index 31e143e..c7af879 100644 --- a/src/main/java/de/srsoftware/widerhall/data/Database.java +++ b/src/main/java/de/srsoftware/widerhall/data/Database.java @@ -133,7 +133,7 @@ public class Database { @Override protected Request clone() { - Request clone = new Request(sql); + Request clone = new Request(new StringBuilder(sql)); clone.where.putAll(where); clone.values.putAll(values); return clone; diff --git a/src/test/java/de/srsoftware/widerhall/data/DatabaseTest.java b/src/test/java/de/srsoftware/widerhall/data/DatabaseTest.java index 5ba1279..3d3da66 100644 --- a/src/test/java/de/srsoftware/widerhall/data/DatabaseTest.java +++ b/src/test/java/de/srsoftware/widerhall/data/DatabaseTest.java @@ -50,8 +50,8 @@ public class DatabaseTest extends TestCase { } public void testUpdate(){ - assertEquals("UPDATE Test",Database.open().update("Test").sql()); - assertEquals("UPDATE Test SET x = 5",Database.open().update("Test").set("x",5).sql()); - assertEquals("UPDATE Test SET x = 5, y = 6",Database.open().update("Test").set("x",5).set("y",6).sql()); + assertEquals("UPDATE Test",Database.open().update("Test").compile().toString()); + assertEquals("UPDATE Test SET x = 5",Database.open().update("Test").set("x",5).compile().toString()); + assertEquals("UPDATE Test SET x = 5, y = 6",Database.open().update("Test").set("x",5).set("y",6).compile().toString()); } -} \ No newline at end of file +}