Class

org.mybatis.scala.mapping

SelectMapPageBy

Related Doc: package mapping

Permalink

abstract class SelectMapPageBy[Param, ResultKey, ResultValue] extends Select with SQLFunction2[Param, RowBounds, Map[ResultKey, ResultValue]]

Query for a Map of objects with RowBounds and one input parameter.

Details

This class defines a function: ((Param, RowBounds) => Map[ResultKey, ResultValue])

Sample code

val peopleMapById = new SelectMapPageBy[String,Long,Person](mapKey="id") {
  def xsql = "SELECT * FROM person WHERE name LIKE #{name}"
}

// Configuration etc .. omitted ..

// Then use it
db.readOnly {
  val people = peopleMapById("John%", RowBounds(100,20))
  val p = people(3)
  ...
}
Param

input parameter type

ResultKey

map Key type

ResultValue

map Value type

Linear Supertypes
SQLFunction2[Param, RowBounds, Map[ResultKey, ResultValue]], Select, Statement, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. SelectMapPageBy
  2. SQLFunction2
  3. Select
  4. Statement
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new SelectMapPageBy(mapKey: String)(implicit arg0: Manifest[Param], arg1: Manifest[ResultValue])

    Permalink

    mapKey

    Property to be used as map key

Abstract Value Members

  1. abstract def xsql: XSQL

    Permalink

    Dynamic SQL definition, an xml node with root <xsql>

    Dynamic SQL definition, an xml node with root <xsql>

    Code sample

    As simple as an static SQL:

    def xsql = "SELECT * FROM mytable WHERE id = #{{id}}"

    Or using dynamic tags:

    def xsql =
      <xsql>
        SELECT *
        FROM mytable
        <where>
          <if test="name != null">
            name like #{{name}}
          </if>
        </where>
      <xsql>
    Definition Classes
    Statement

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def apply(param: Param, rowBounds: RowBounds)(implicit s: Session): Map[ResultKey, ResultValue]

    Permalink
    Definition Classes
    SelectMapPageBySQLFunction2
  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. var databaseId: String

    Permalink

    Vendor ID

    Vendor ID

    Definition Classes
    Statement
  8. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  10. def execute[A](command: ⇒ A): A

    Permalink
    Definition Classes
    Statement
  11. var fetchSize: Int

    Permalink

    This is a driver hint that will attempt to cause the driver to return results in batches of rows numbering in size equal to this setting.

    This is a driver hint that will attempt to cause the driver to return results in batches of rows numbering in size equal to this setting. Default is unset (driver dependent).

    Definition Classes
    Select
  12. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. var flushCache: Boolean

    Permalink

    Setting this to true will cause the cache to be flushed whenever this statement is called.

    Setting this to true will cause the cache to be flushed whenever this statement is called. Default: false for select statements.

    Definition Classes
    Statement
  14. var fqi: FQI

    Permalink

    Fully qualified identifier of the statement.

    Fully qualified identifier of the statement. Autogenerated by the configuration space.

    Definition Classes
    Statement
  15. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  16. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  17. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  18. var languageDriver: DefaultScriptingDriver.type

    Permalink

    Scripting driver

    Scripting driver

    Definition Classes
    Statement
  19. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  20. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  21. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  22. def parameterTypeClass: Class[_]

    Permalink

    Returns the Class of the input parameter.

    Returns the Class of the input parameter.

    Definition Classes
    SelectMapPageByStatement
  23. var resultMap: ResultMap[_]

    Permalink

    A reference to an external resultMap.

    A reference to an external resultMap. Result maps are the most powerful feature of MyBatis, and with a good understanding of them, many difficult mapping cases can be solved.

    Definition Classes
    Select
  24. var resultSetType: ResultSetType

    Permalink

    Any one of FORWARD_ONLY|SCROLL_SENSITIVE|SCROLL_INSENSITIVE.

    Any one of FORWARD_ONLY|SCROLL_SENSITIVE|SCROLL_INSENSITIVE. Default FORWARD_ONLY.

    Definition Classes
    Select
  25. def resultTypeClass: Class[_]

    Permalink
    Definition Classes
    SelectMapPageBySelect
  26. var statementType: StatementType

    Permalink

    Any one of STATEMENT, PREPARED or CALLABLE.

    Any one of STATEMENT, PREPARED or CALLABLE. This causes MyBatis to use Statement, PreparedStatement or CallableStatement respectively. Default: PREPARED.

    Definition Classes
    Statement
  27. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  28. var timeout: Int

    Permalink

    This sets the maximum time the driver will wait for the database to return from a request, before throwing an exception.

    This sets the maximum time the driver will wait for the database to return from a request, before throwing an exception. Default is unset (driver dependent).

    Definition Classes
    Statement
  29. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  30. var useCache: Boolean

    Permalink

    Setting this to true will cause the results of this statement to be cached.

    Setting this to true will cause the results of this statement to be cached. Default: true for select statements.

    Definition Classes
    Select
  31. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from SQLFunction2[Param, RowBounds, Map[ResultKey, ResultValue]]

Inherited from Select

Inherited from Statement

Inherited from AnyRef

Inherited from Any

Ungrouped