Is there a easy way to keep the static typing, for instance like this:

DSLContext dsl = DSL.using(datasource1, SQLDialect.MYSQL);
Result<Record> result1 = dsl.select().from(AUTHOR).fetch();
// select * from BookStore1.Author

DSLContext dsl = DSL.using(datasource2, SQLDialect.MYSQL);
Result<Record> result1 = dsl.select().from(AUTHOR).fetch();
// select * from BookStore2.Author

在 2016年7月21日星期四 UTC+8下午12:02:31,Goddamned Qu写道:

> some sharding strategy is to use number to label different db instances, 
> but each db has the same table schemas
>
> eg. has 2 BookStore db with the same table Author
>
> Create Database BookStore1;
> use BookStore1;
> CREATE TABLE `Author` (
>  `id` int NOT NULL,
>  `firstName` varchar(255) DEFAULT NULL,
>  `lastName` varchar(255) DEFAULT NULL,
>  PRIMARY KEY (`id`)
> );
>
> Create Database BookStore2;
> use BookStore2;
> CREATE TABLE `Author` (
>  `id` int NOT NULL,
>  `firstName` varchar(255) DEFAULT NULL,
>  `lastName` varchar(255) DEFAULT NULL,
>  PRIMARY KEY (`id`)
> );
>
>
>
> how could jooq deal with same table schema with different db name without 
> generate a lot of repeated code?
>

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to