com.outworkers.phantom.macros

TableHelperMacro

class TableHelperMacro extends MacroUtils

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

Instance Constructors

  1. new TableHelperMacro(c: Context)

Type Members

  1. case class Field(name: scala.reflect.macros.Universe.TermName, tpe: scala.reflect.macros.Universe.Type) extends Product with Serializable

  2. case class Match(results: List[Field], partition: Boolean) extends TableMatchResult with Product with Serializable

  3. trait TableMatchResult extends AnyRef

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. object Field extends Serializable

  7. object NoMatch extends TableMatchResult with Product with Serializable

  8. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  9. val c: Context

    Definition Classes
    TableHelperMacroMacroUtils
  10. def caseFields(tpe: scala.reflect.macros.Universe.Type): Iterable[(scala.reflect.macros.Universe.Name, scala.reflect.macros.Universe.Type)]

    Definition Classes
    MacroUtils
  11. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  12. val colSymbol: Symbol

  13. def determineReferenceTable(tpe: scala.reflect.macros.Universe.Type): Option[Symbol]

    Finds the first type in the type hierarchy for which columns exist as direct members.

    Finds the first type in the type hierarchy for which columns exist as direct members.

    tpe

    The type of the table.

    returns

    An optional symbol, if such a type was found in the type hierarchy.

  14. final def eq(arg0: AnyRef): Boolean

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

    Definition Classes
    AnyRef → Any
  16. val exclusions: (Symbol) ⇒ Option[Symbol]

  17. def extractColumnMembers(table: scala.reflect.macros.Universe.Type, columns: List[Symbol]): List[Field]

  18. def extractRecordMembers(tpe: scala.reflect.macros.Universe.Type): Iterable[Field]

    A "generic" type extractor that's meant to produce a list of fields from a record type.

    A "generic" type extractor that's meant to produce a list of fields from a record type. We support a narrow domain of types for automated generation, currently including: - Case classes - Tuples

    To achieve this, we simply have specific ways of extracting the types from the underlying records, and producing a Field for each of the members in the product type,

    tpe

    The underlying record type that was passed as the second argument to a Cassandra table.

    returns

    An iterable of fields, each containing a TermName and a Type that describe a record member.

  19. def extractTableName(source: scala.reflect.macros.Universe.Type): String

    Extracts the name of the table that will be generated and used in Cassandra.

    Extracts the name of the table that will be generated and used in Cassandra. This can be changed at runtime by the user by overriding CassandraTable.tableName. This mechanism is incompatible with the historical way we used to do this, effectively using the type inferred by the final database object.

    Instead, at present times, it is the type hierarchy that dictates what a table will be called, and the first member of the type hierarchy of a table type with columns defined will dictate the name.

    source

    The source table type to extract the name from. We rely on this to be the first in the hierarchy to contain column definitions, determined by determineReferenceTable() above.

    returns

  20. def filterColumns[Filter](columns: Seq[scala.reflect.macros.Universe.Type])(implicit arg0: scala.reflect.macros.Universe.TypeTag[Filter]): Seq[scala.reflect.macros.Universe.Type]

  21. def filterMembers[T, Filter](exclusions: (Symbol) ⇒ Option[Symbol] = s: Symbol => Some(s))(implicit arg0: scala.reflect.macros.Universe.WeakTypeTag[T], arg1: scala.reflect.macros.Universe.TypeTag[Filter]): Seq[Symbol]

    Definition Classes
    MacroUtils
  22. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  23. def findMatchingSubset(tableName: scala.reflect.macros.Universe.Name, members: List[Field], recordMembers: Iterable[Field]): TableMatchResult

    Finds a matching subset of columns inside a table definition where the extracted type from a table does not need to include all of the columns inside a table.

    Finds a matching subset of columns inside a table definition where the extracted type from a table does not need to include all of the columns inside a table.

    This addresses https://websudos.atlassian.net/browse/PHANTOM-237.

    members

    The type members of the table.

    recordMembers

    The type members of the record type.

    returns

  24. final def getClass(): Class[_]

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

    Definition Classes
    AnyRef → Any
  26. def inferPrimaryKey(tableName: String, table: scala.reflect.macros.Universe.Type, columns: Seq[scala.reflect.macros.Universe.Type]): Tree

    This method will check for common Cassandra anti-patterns during the intialisation of a schema.

    This method will check for common Cassandra anti-patterns during the intialisation of a schema. If the Schema definition violates valid CQL standard, this function will throw an error.

    A perfect example is using a mixture of Primary keys and Clustering keys in the same schema. While a Clustering key is also a primary key, when defining a clustering key all other keys must become clustering keys and specify their order.

    We could auto-generate this order but we wouldn't be making false assumptions about the desired ordering.

  27. def insertQueryType(table: scala.reflect.macros.Universe.Type, record: scala.reflect.macros.Universe.Type): Tree

  28. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  29. val knownList: List[String]

  30. def macroImpl[T, R](implicit arg0: scala.reflect.macros.Universe.WeakTypeTag[T], arg1: scala.reflect.macros.Universe.WeakTypeTag[R]): Tree

  31. def materializeExtractor[T](tableTpe: scala.reflect.macros.Universe.Type, recordTpe: scala.reflect.macros.Universe.Type, columns: List[Symbol]): Option[Tree]

    Materializes an extractor method for a table, the so called "fromRow" method.

    Materializes an extractor method for a table, the so called "fromRow" method.

    This will only work if the types of the record type match the types inferred by the return types of the columns inside the table.

    If the implementation could not be inferred, the output of this method will be the unimplemented method exception and the user will have to manually override the fromRow definition and create one themselves.

    def fromRow(row: Row): R = ???

    Not only that but they also have to be in the same order. For example:

    case class MyRecord(
      id: UUID,
      email: String,
      date: DateTime
    )
    
    class MyTable extends CassandraTable[MyTable, MyRecord] {
      object id extends UUIDColumn(this) with PartitionKey
      object email extends StringColumn(this)
      object date extends DateTimeColumn(this)
    }
    returns

    An interpolated tree that will contain the automatically generated implementation of the fromRow method in a Cassandra Table. Alternatively, this will return an unimplemented ??? method, provided a correct definition could not be inferred.

  32. final def ne(arg0: AnyRef): Boolean

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

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

    Definition Classes
    AnyRef
  35. val rootConn: Symbol

  36. val selectTable: Symbol

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

    Definition Classes
    AnyRef
  38. val tableSym: Symbol

  39. def toString(): String

    Definition Classes
    AnyRef → Any
  40. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from MacroUtils

Inherited from AnyRef

Inherited from Any

Ungrouped