finally get jooq and his code generation working
This commit is contained in:
parent
273968fd9d
commit
32aa5a9bb0
3 changed files with 19 additions and 3 deletions
4
pom.xml
4
pom.xml
|
|
@ -109,8 +109,10 @@
|
||||||
</jdbc>
|
</jdbc>
|
||||||
|
|
||||||
<generator>
|
<generator>
|
||||||
|
<name>org.jooq.codegen.JavaGenerator</name>
|
||||||
<database>
|
<database>
|
||||||
<includes>\*.</includes>
|
<name>org.jooq.meta.sqlite.SQLiteDatabase</name>
|
||||||
|
<includes>.*</includes>
|
||||||
<excludes>flyway_schema_history</excludes>
|
<excludes>flyway_schema_history</excludes>
|
||||||
</database>
|
</database>
|
||||||
<generate>
|
<generate>
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,14 @@ import com.mykola2312.mptv.ui.MainFrame;
|
||||||
import org.apache.commons.cli.*;
|
import org.apache.commons.cli.*;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.flywaydb.core.Flyway;
|
import org.flywaydb.core.Flyway;
|
||||||
import org.flywaydb.core.api.configuration.Configuration;
|
import static com.mykola2312.mptv.tables.Test.*;
|
||||||
|
import org.jooq.*;
|
||||||
|
import org.jooq.Record;
|
||||||
|
import org.jooq.impl.*;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.sql.Connection;
|
||||||
|
import java.sql.DriverManager;
|
||||||
|
|
||||||
public class Main {
|
public class Main {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|
@ -48,6 +53,14 @@ public class Main {
|
||||||
);
|
);
|
||||||
flyway.migrate();
|
flyway.migrate();
|
||||||
|
|
||||||
|
try (Connection conn = DriverManager.getConnection("jdbc:sqlite:mptv.db", "", "")) {
|
||||||
|
DSLContext create = DSL.using(conn, SQLDialect.SQLITE);
|
||||||
|
Result<Record> result = create.select().from(TEST).fetch();
|
||||||
|
System.out.println(result);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
Logger logger = Logger.getLogger(Main.class);
|
Logger logger = Logger.getLogger(Main.class);
|
||||||
logger.info("mptv started");
|
logger.info("mptv started");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
CREATE TABLE test (
|
CREATE TABLE test (
|
||||||
id INTEGER PRIMARY KEY AUTOINCREMENT
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
|
value TEXT NOT NULL
|
||||||
);
|
);
|
||||||
Loading…
Add table
Reference in a new issue