DataModel
molecule.DataModel
case class DataModel(maxArity: Int) 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:
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
- Source
- DataModel.scala
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait DataModelApiclass Objecttrait Matchableclass AnyShow all
Members list
Grouped members
Options
Attribute options.
Attribute options.
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
trait oneBigDecimalobject oneBigDecimal.typetrait oneBigIntobject oneBigInt.typetrait oneBooleanobject oneBoolean.typetrait oneByteobject oneByte.typetrait oneCharobject oneChar.typetrait oneDateobject oneDate.typetrait oneDoubleobject oneDouble.typetrait oneFloatobject oneFloat.typetrait oneIntobject oneInt.typetrait oneLongobject oneLong.typetrait oneShortobject oneShort.typetrait oneURIobject oneURI.typetrait oneUUIDobject oneUUID.typetrait manyobject many.typetrait oneobject one.typetrait setBigDecimalobject setBigDecimal.typetrait setBigIntobject setBigInt.typetrait setBooleanobject setBoolean.typetrait setByteobject setByte.typetrait setCharobject setChar.typetrait setDateobject setDate.typetrait setDoubleobject setDouble.typetrait setFloatobject setFloat.typetrait setIntobject setInt.typetrait setLongobject setLong.typetrait setShortobject setShort.typetrait setURIobject setURI.typetrait setUUIDobject setUUID.typetrait oneStringobject oneString.typetrait setStringobject setString.typeShow all
Type members
Classlikes
trait TxBase
Attributes
- Source
- DataModel.scala
- Supertypes
-
class Objecttrait Matchableclass Any
Inherited classlikes
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
trait many extends refOptions[many, Set[Long]]
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
object many.type
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
trait one extends refOptions[one, Long]
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
- Known subtypes
-
object one.type
object oneBigDecimal extends oneBigDecimal
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
trait oneBigDecimal extends Options[oneBigDecimal, BigDecimal, BigDecimal]
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
- Known subtypes
-
object oneBigDecimal.type
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
- Known subtypes
-
object oneBigInt.type
object oneBoolean extends oneBoolean
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
trait oneBoolean extends Options[oneBoolean, Boolean, Boolean]
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
- Known subtypes
-
object oneBoolean.type
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
- Known subtypes
-
object oneByte.type
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
- Known subtypes
-
object oneChar.type
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
- Known subtypes
-
object oneDate.type
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
- Known subtypes
-
object oneDouble.type
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
- Known subtypes
-
object oneFloat.type
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
- Known subtypes
-
object oneInt.type
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
- Known subtypes
-
object oneLong.type
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
- Known subtypes
-
object oneShort.type
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
trait oneString extends stringOptions[oneString, String]
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
object oneString.type
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
- Known subtypes
-
object oneURI.type
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
- Known subtypes
-
object oneUUID.type
trait refOptions[Self, Tpe] extends Options[Self, Tpe, Long]
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
- Known subtypes
object setBigDecimal extends setBigDecimal
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
trait setBigDecimal extends Options[setBigDecimal, Set[BigDecimal], BigDecimal]
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
- Known subtypes
-
object setBigDecimal.type
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
- Known subtypes
-
object setBigInt.type
object setBoolean extends setBoolean
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
trait setBoolean extends Options[setBoolean, Set[Boolean], Boolean]
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
- Known subtypes
-
object setBoolean.type
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
- Known subtypes
-
object setByte.type
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
- Known subtypes
-
object setChar.type
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
- Known subtypes
-
object setDate.type
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
- Known subtypes
-
object setDouble.type
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
- Known subtypes
-
object setFloat.type
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
- Known subtypes
-
object setInt.type
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
- Known subtypes
-
object setLong.type
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
- Known subtypes
-
object setShort.type
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
trait setString extends stringOptions[oneString, Set[String]]
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
object setString.type
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
- Known subtypes
-
object setURI.type
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
- Known subtypes
-
object setUUID.type
trait stringOptions[Self, Tpe] extends Options[Self, Tpe, String]
Attributes
- Inherited from:
- DataModelApi
- Source
- DataModelApi.scala
- Supertypes
- Known subtypes
Value members
Inherited methods
Attributes
- Inherited from:
- Product
Attributes
- Inherited from:
- Product
In this article