Daobab Reverse Engineering

How to create ORM classes and begin having fun with Daobab.

Prepare DataSource

    private DataSource oracleDatabase(){
        HikariConfig config = new HikariConfig();
        config.setJdbcUrl( "jdbc:oracle:thin://@IP:PORT/orcl" );
        config.setUsername( USER );
        config.setPassword( PASS );
        return new HikariDataSource( config );

Init Class Generator and set schema

ClassGenerator cg=new ClassGenerator(oracleDatabase());

Set classes location and java package


Execute generator.
Generator creates schema package with column and table packages inside. DataBaseTarget as database connector will be created as well.

Copy DataSource to created DataBaseTarget class.
DataSource conenction is your code. You should controll the behaviour, setting pooling for example (and you may choose HikariCP or CP30 for that).

Make DataBaseTarget singleton
This is framework based behaviour.

Inject DataSource and your schema tables anywhere where you want to build daobab queries