public ConnectedCrud < T , K > to ( DataSource dataSource ) throws SQLException { Connection connection = dataSource . getConnection ( ) ; try { return new ConnectedCrud < T , K > ( new DataSourceTransactionTemplate ( dataSource ) , to ( connection ) ) ; } finally { connection . close ( ) ; } }
Create a connected crud validating it against the specified datasource . The table name is derived from the jpa annotation or from the class name .