com.websudos.morpheus.query

InsertQuery

class InsertQuery[T <: BaseTable[T, _], R, Type <: QueryType, Group <: GroupBind, Order <: OrderBind, Limit <: LimitBind, Chain <: ChainBind, AssignChain <: AssignBind, Status <: StatusBind] extends AnyRef

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. InsertQuery
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new InsertQuery(query: Query[T, R, Type, Group, Order, Limit, Chain, AssignChain, Status], statements: List[(String, String)] = immutable.this.Nil)

Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. final def eq(arg0: AnyRef): Boolean

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

    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. final def getClass(): Class[_]

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

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

    Definition Classes
    Any
  14. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  15. final def notify(): Unit

    Definition Classes
    AnyRef
  16. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  17. val query: Query[T, R, Type, Group, Order, Limit, Chain, AssignChain, Status]

  18. val statements: List[(String, String)]

  19. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  20. def toString(): String

    Definition Classes
    AnyRef → Any
  21. final def value[RR](insertion: (T) ⇒ AbstractColumn[RR], obj: RR)(implicit primitive: SQLPrimitive[RR], ev: =:=[Type, InsertType], ev1: =:=[Status, Unterminated]): InsertQuery[T, R, Type, Group, Order, Limit, Chain, AssignChain, Unterminated]

    At this point you may be reading and thinking "WTF", but fear not, it all makes sense.

    At this point you may be reading and thinking "WTF", but fear not, it all makes sense. Every call to a "value method" will generate a new Insert Query, but the list of statements in the new query will include a new (String, String) pair, where the first part is the column name and the second one is the serialised value. This is a very simple accumulator that will eventually allow calling the "insert" method on a queryBuilder to produce the final serialisation result, a hopefully valid MySQL insert query.

    RR

    The SQL primitive or rather it's Scala correspondent to use at this time.

    insertion

    The insert condition is a pair of a column with the value to use for it. It looks like this: value(_.someColumn, someValue), where the assignment is of course type safe.

    obj

    The object is the value to use for the column.

    primitive

    The primitive is the SQL primitive that converts the object into an SQL Primitive. Since the user cannot deal with types that are not "marked" as SQL primitives for the particular database in use, we use a simple context bound to enforce this constraint.

    ev

    The first evidence parameter is a restriction upon the Type phantom type and it tests if the Query is an Insert query. This prevents the user from jumping around with the implicit conversion mechanism and converting an Update query to an implicit and so on. It also allows us to guarantee the MySQL syntax is followed with respect to what methods are available on certain types of queries, all with a single Query class.

    ev1

    The second evidence parameter is a restriction upon the status of a Query. Certain "exit" points mark the serialisation as Terminated with respect to the SQL syntax in use. It's a way of saying: there are no further options possible according to the DB you are using.

    returns

    A new InsertQuery, where the list of statements in the Insert has been chained and updated for serialisation.

    Annotations
    @implicitNotFound( ... )
  22. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped