Search in sources :

Example 1 with OrderService

use of com.dangdang.ddframe.rdb.sharding.example.config.spring.masterslave.service.OrderService in project sharding-jdbc by dangdangdotcom.

the class SpringNamespaceWithMasterSlaveMain method main.

// CHECKSTYLE:OFF
public static void main(final String[] args) throws SQLException {
    // CHECKSTYLE:ON
    ApplicationContext applicationContext = new ClassPathXmlApplicationContext("META-INF/applicationContextWithMasterSlave.xml");
    OrderService orderService = applicationContext.getBean(OrderService.class);
    orderService.insert();
    orderService.select();
    orderService.delete();
    orderService.select();
}
Also used : ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext) ApplicationContext(org.springframework.context.ApplicationContext) ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext) OrderService(com.dangdang.ddframe.rdb.sharding.example.config.spring.masterslave.service.OrderService)

Aggregations

OrderService (com.dangdang.ddframe.rdb.sharding.example.config.spring.masterslave.service.OrderService)1 ApplicationContext (org.springframework.context.ApplicationContext)1 ClassPathXmlApplicationContext (org.springframework.context.support.ClassPathXmlApplicationContext)1