molecule.base.api
package molecule.base.api
Members list
Type members
Classlikes
object DataModelApi extends DataModelApi
Data Model DSL.
Define a Domain Data Model in a data model file.
For small projects, the schema can be defined without partition definitions where all namespaces reside in a default tacit partition:
Data Model DSL.
Define a Domain Data Model in a data model file.
For small projects, the schema can be defined without partition definitions where all namespaces reside in a default tacit partition:
package path.to.your.project
import molecule.data.model._ // import data model DSL
object Seattle extends DataModel(8) { // data model object with input/output arity
trait Person { // Namespace
val name = oneString.fulltext // String attribute definition with fulltext search
val age = oneInt // Int attribute definition
}
// Additional namespaces...
}
For larger projects, it is recommended to group namespaces in partitions:
package path.to.your.project
import molecule.data.model._
object Seattle extends DataModel(15) {
object customer {
trait Person {
val name = oneString.fulltext
val age = oneInt
val address = one[Address]
val bought = many[products.Item]
}
trait Address {
val street = oneString.fulltext
val city = oneInt
}
// ..more namespaces in the `customer` partition
}
object products {
trait Item {
val title = oneString
val inStock = oneInt
}
// ..more namespaces in the `products` partition
}
// Additional partitions...
}
Attributes
- Companion
- trait
- Source
- DataModelApi.scala
- Supertypes
- Self type
-
DataModelApi.type
trait DataModelApi
Attributes
- Companion
- object
- Source
- DataModelApi.scala
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
object DataModelApi.typeclass DataModel
trait Schema
Schema transaction data interface with data sources for various databases.
Schema transaction data interface with data sources for various databases.
Attributes
- Source
- Schema.scala
- Supertypes
-
class Objecttrait Matchableclass Any
In this article