diff --git a/jOOQ/src/main/java/org/jooq/tools/jdbc/MockFileDatabase.java b/jOOQ/src/main/java/org/jooq/tools/jdbc/MockFileDatabase.java index d3cb193382..0f4f9b0797 100644 --- a/jOOQ/src/main/java/org/jooq/tools/jdbc/MockFileDatabase.java +++ b/jOOQ/src/main/java/org/jooq/tools/jdbc/MockFileDatabase.java @@ -58,8 +58,56 @@ import org.jooq.tools.JooqLogger; /** * A file-based {@link MockDataProvider}. *

- * This data provider reads a database model from a text file. This - * implementation is still very experimental and not officially supported! + * This data provider reads a database model from a text file, as documented in + * the below sample file:

+ * # Comments start off with a hash
+ *
+ * # Statement strings have no prefix and should be ended with a semi-colon
+ * select 'A' from dual;
+ * # Statements may be followed by results, using >
+ * > A
+ * > -
+ * > A
+ * # Statements should be followed by "@ rows: [N]" indicating the update count
+ * @ rows: 1
+ *
+ * # New statements can be listed int his file
+ * select 'A', 'B' from dual;
+ * > A B
+ * > - -
+ * > A B
+ * @ rows: 1
+ *
+ * # Beware of the exact syntax (e.g. using quotes)
+ * select "TABLE1"."ID1", "TABLE1"."NAME1" from "TABLE1";
+ * > ID1 NAME1
+ * > --- -----
+ * > 1   X
+ * > 2   Y
+ * @ rows: 2
+ *
+ * # Statements can return several results
+ * > F1  F2  F3 is a bit more complex
+ * > --- --  ----------------------------
+ * > 1   2   and a string containing data
+ * > 1.1 x   another string
+ * @ rows: 2
+ *
+ * > A B "C D"
+ * > - - -----
+ * > x y z
+ * @ rows: 1
+ * 
+ *

+ * Results can be loaded using several techniques: + *

+ *

+ * This implementation is still very experimental and not officially supported! * * @author Lukas Eder */ @@ -98,7 +146,7 @@ public class MockFileDatabase implements MockDataProvider { private StringBuilder currentResult = new StringBuilder(); private String previousSQL = null; - public void load() throws FileNotFoundException, IOException { + private void load() throws FileNotFoundException, IOException { try { while (true) { String line = readLine();