001package io.ebean.service;
002
003import io.ebean.RawSql;
004import io.ebean.RawSqlBuilder;
005import io.ebean.SqlRow;
006
007import java.sql.ResultSet;
008import java.sql.SQLException;
009
010/**
011 * Service provided by Ebean for parsing and column mapping raw SQL queries.
012 */
013public interface SpiRawSqlService {
014
015  /**
016   * Create based on a JDBC ResultSet.
017   */
018  RawSql resultSet(ResultSet resultSet, String... propertyNames);
019
020  /**
021   * Parse the SQL determining column mapping.
022   */
023  RawSqlBuilder parsed(String sql);
024
025  /**
026   * Unparsed SQL so explicit column mapping expected.
027   */
028  RawSqlBuilder unparsed(String sql);
029
030  /**
031   * Create based on a JDBC ResultSet.
032   *
033   * @param resultSet           The ResultSet row to read as a SqlRow
034   * @param dbTrueValue         The DB true value
035   * @param binaryOptimizedUUID Flag set to true if the UUID value is stored as optimised binary(16)
036   */
037  SqlRow sqlRow(ResultSet resultSet, String dbTrueValue, boolean binaryOptimizedUUID) throws SQLException;
038}