| 101 | * Interface : [browser:branches/private/tsachev/paragraphs/modules/org.sophie2.server.core/src/main/java/org/sophie2/server/core/persistence/db/jdbc/RowMapper.java RowMapper<T>] -> Used to map a row of data selected from the database to an object or list of objects. |
| 102 | * Public methods: |
| 103 | * {{{public T mapRow(int rowNum, ResultSet rs) throws SQLException}}} -> Maps a specified row of the passed ResultSet (JDBC API) to an object or list of objects. |
| 104 | * Implementations: |
| 105 | * [browser:branches/private/tsachev/paragraphs/modules/org.sophie2.server.core/src/main/java/org/sophie2/server/core/persistence/db/LongRowMapper.java LongRowMapper] -> Maps the first cell in a row to a Long value. |
| 106 | * [browser:branches/private/tsachev/paragraphs/modules/org.sophie2.server.core/src/main/java/org/sophie2/server/core/persistence/db/StringRowMapper.java StringRowMapper] -> Maps the first cell to a String value. |
| 107 | * Interface : [browser:branches/private/tsachev/paragraphs/modules/org.sophie2.server.core/src/main/java/org/sophie2/server/core/persistence/db/jdbc/ResultSetMapper.java ResultSetMapper<T>] -> Maps a ResultSet (JDBC API, contains a result from query) to an Object or list of objects, its implementations often use RowMappers to iterate over the ResultSets. |
| 108 | * Public methods: |
| 109 | * {{{public void mapRow(int rowNum, ResultSet resSet) throws SQLException}}} -> Maps a row from the ResultSet to a value. |
| 110 | * {{{public T getResult()}}} -> Getter for the result of the mapping. Ususally the implementator will iterate through a ResultSet and for each of its rows will call mapRow ot the mapper, then after all the rows are iterated will retrieve the result with this method. OFten the implementations use RowMappers to map the columns of a given row. |
| 111 | * Implementations: |
| 112 | * [browser:branches/private/tsachev/paragraphs/modules/org.sophie2.server.core/src/main/java/org/sophie2/server/core/persistence/db/KeyMapper.java KeyMapper] -> Maps a result to pair keypath and its id in the database. |
| 113 | * [browser:branches/private/tsachev/paragraphs/modules/org.sophie2.server.core/src/main/java/org/sophie2/server/core/persistence/db/jdbc/ListMapper.java ListMapper<T>] -> Maps a result to a list of objects, uses RowMapper to map the separate rows. |
| 114 | * [browser:branches/private/tsachev/paragraphs/modules/org.sophie2.server.core/src/main/java/org/sophie2/server/core/persistence/db/jdbc/SingleResultMapper.java SingleResultMapper<T>] -> Maps a result to a single object, used with select queries that return only one row. |
| 115 | * Interface : [browser:branches/private/tsachev/paragraphs/modules/org.sophie2.server.core/src/main/java/org/sophie2/server/core/persistence/db/jdbc/ParametersSetter.java ParameterSetter<T>] -> Manages setting the parameters to a PreparedStatement (JDBC API) |
| 116 | * Public methods: |
| 117 | * {{{public void setParameters(int batchIndex, PreparedStatement stmnt) throws SQLException}}} -> Sets parameters to a specified statement, it can set different parameters to one statement and its first parameter means which batch of parameters will be set. |
| 118 | * {{{public int getBatchesCount()}}} -> The number of the batches of the parameters of the setter. |
| 119 | * Implementations: |
| 120 | * [browser:branches/private/tsachev/paragraphs/modules/org.sophie2.server.core/src/main/java/org/sophie2/server/core/persistence/db/jdbc/DefaultParameterSetter.java DefaultParameterSetter] -> Manages setting the parameters to a given statement. It is constructed with its parameters, represented as an array of objects for every batch. All the batches are contained in a Collection. |
| 121 | |
| 122 | |