Class CrudDSL<T,K>

java.lang.Object
org.simpleflatmapper.jdbc.CrudDSL<T,K>

public class CrudDSL<T,K> extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
    CrudDSL(org.simpleflatmapper.reflect.meta.ClassMeta<T> target, org.simpleflatmapper.reflect.meta.ClassMeta<K> keyTarget, JdbcMapperFactory jdbcMapperFactory)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Create a crud that will validate on the first interaction with a connection.
    table(String table)
    Create a crud against the specified table that will validate on the first interaction with a connection.
    table(Connection connection, String table)
    Create a crud against the specified table validating it against the specified connection.
    table(DataSource dataSource, String table)
    Create a connected crud against the specified table validating it against the specified datasource.
    to(Connection connection)
    Create a connected crud validating it against the specified connection.
    to(DataSource dataSource)
    Create a connected crud validating it against the specified datasource.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CrudDSL

      public CrudDSL(org.simpleflatmapper.reflect.meta.ClassMeta<T> target, org.simpleflatmapper.reflect.meta.ClassMeta<K> keyTarget, JdbcMapperFactory jdbcMapperFactory)
  • Method Details

    • crud

      public Crud<T,K> crud()
      Create a crud that will validate on the first interaction with a connection. The table name is derived from the jpa annotation or from the class name.
      Returns:
      a new crud instance
    • table

      public Crud<T,K> table(String table)
      Create a crud against the specified table that will validate on the first interaction with a connection.
      Parameters:
      table - the table name
      Returns:
      a new crud instance
    • table

      public Crud<T,K> table(Connection connection, String table) throws SQLException
      Create a crud against the specified table validating it against the specified connection.
      Parameters:
      connection - the connection
      table - the table
      Returns:
      a new crud instance
      Throws:
      SQLException - if an error occurred
    • table

      public ConnectedCrud<T,K> table(DataSource dataSource, String table) throws SQLException
      Create a connected crud against the specified table validating it against the specified datasource.
      Parameters:
      dataSource - the datasource
      table - the table
      Returns:
      a new crud instance
      Throws:
      SQLException - if an error occurred
    • to

      public ConnectedCrud<T,K> to(DataSource dataSource) throws SQLException
      Create a connected crud validating it against the specified datasource. The table name is derived from the jpa annotation or from the class name.
      Parameters:
      dataSource - the datasource
      Returns:
      a new crud instance
      Throws:
      SQLException - if an error occurred
    • to

      public Crud<T,K> to(Connection connection) throws SQLException
      Create a connected crud validating it against the specified connection. The table name is derived from the jpa annotation or from the class name.
      Parameters:
      connection - the connection
      Returns:
      a new crud instance
      Throws:
      SQLException - if an error occurred