Skip to content

JpoRx Configuration With Vertx3

Francesco edited this page Jul 13, 2015 · 2 revisions

Even if JpoRx can be used without it, it has been developed to be used mainly used with the Vert.x 3 reactive framework. In this case, each Jpo operation is performed in the Vert.x context.

There are two ways of using Jpo with Vert.x. The first way is using a common JDBC dataSource; the second mode uses the Vertx JDBC client (still in development).

Configuration with Vertx and JDBC DataSource

import javax.sql.DataSource;
import com.jporm.rx.JpoRx;
import com.jporm.rx.vertx.session.vertx3.JpoRxVertxBuilder;
import io.vertx.core.Vertx;

public JpoRx newInstance(DataSource dataSource, Vertx vertx) {
	// Use the JpoRxDataSourceBuilder to create a new instance of JPO.
	return new JpoRxVertxBuilder().build(dataSource, vertx);

}

JPO basics

JPO-RX

  • Configuration
  • Simple CRUD action
    • Prepare the beans
    • CRUD
  • Complex queries
    • Select
      • Join
    • Update
    • Save
    • Delete

JPO-RM

  • Configuration
  • Simple CRUD action
    • Prepare the beans
    • CRUD
  • Complex queries
    • Select
      • Join
    • Update
    • Save
    • Delete
Clone this wiki locally