object definition
Schema definition DSL.
Define Datomic database schema in a Schema Definition 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.schema.definition._ // import schema definition DSL @InOut(1, 8) // Set input/output arity object SeattleDefinition { // Schema definition object 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.schema.definition._ @InOut(3, 15) object SeattleDefinition { 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... }
- Source
- definition.scala
- See also
Manual | Tests: Schema without partitions, Schema with partitions, Bidirectionals
- Grouped
- Alphabetic
- By Inheritance
- definition
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
class
InOut extends Annotation with StaticAnnotation
Arity annotation for number of molecule input/output attributes.
-
trait
many extends refOptionBuilder[many]
Card-many reference.
-
trait
manyBi extends refOptionBuilder[manyBi]
Card-many bi-directional reference.
-
trait
manyBiEdge extends refOptionBuilder[manyBiEdge]
Card-many bi-directional edge reference.
-
trait
manyBigDecimal extends number[manyBigDecimal, BigDecimal]
Card-many BigDecimal attribute.
-
trait
manyBigInt extends number[manyBigInt, BigInt]
Card-many BigInt attribute.
-
trait
manyBoolean extends optionBuilder[manyBoolean]
Card-many Boolean attribute.
-
trait
manyByte extends optionBuilder[manyByte]
Card-many Bytes attribute.
-
trait
manyDate extends optionBuilder[manyDate]
Card-many Date attribute.
-
trait
manyDouble extends number[manyDouble, Double]
Card-many Double attribute.
-
trait
manyEnum extends enum
Card-many Enum attribute.
-
trait
manyFloat extends number[manyFloat, Float]
Card-many Float attribute.
-
trait
manyInt extends number[manyInt, Int]
Card-many Int attribute.
-
trait
manyLong extends number[manyLong, Long]
Card-many Long attribute.
-
trait
manyString extends optionBuilder[manyString]
Card-many String attribute.
-
trait
manyURI extends optionBuilder[manyURI]
Card-many URI attribute.
-
trait
manyUUID extends optionBuilder[manyUUID]
Card-many UUID attribute.
-
trait
mapBigDecimal extends number[mapBigDecimal, BigDecimal]
BigDecimal map attribute.
-
trait
mapBigInt extends number[mapBigInt, BigInt]
BigInt map attribute.
-
trait
mapBoolean extends optionBuilder[mapBoolean]
Boolean map attribute.
-
trait
mapByte extends optionBuilder[mapByte]
Bytes map attribute.
-
trait
mapDate extends optionBuilder[mapDate]
Date map attribute.
-
trait
mapDouble extends number[mapDouble, Double]
Double map attribute.
-
trait
mapFloat extends number[mapFloat, Float]
Float map attribute.
-
trait
mapInt extends number[mapInt, Int]
Int map attribute.
-
trait
mapLong extends number[mapLong, Long]
Long map attribute.
-
trait
mapString extends optionBuilder[mapString]
String map attribute.
-
trait
mapURI extends optionBuilder[mapURI]
URI map attribute.
-
trait
mapUUID extends optionBuilder[mapUUID]
UUID map attribute.
-
trait
one extends refOptionBuilder[one]
Card-one reference.
-
trait
oneBi extends refOptionBuilder[oneBi]
Card-one bi-directional reference.
-
trait
oneBiEdge extends refOptionBuilder[oneBiEdge]
Card-one bi-directional edge reference.
-
trait
oneBigDecimal extends number[oneBigDecimal, BigDecimal]
Card-one BigDecimal attribute.
-
trait
oneBigInt extends number[oneBigInt, BigInt]
Card-one BigInt attribute.
-
trait
oneBoolean extends optionBuilder[oneBoolean]
Card-one Boolean attribute.
-
trait
oneByte extends optionBuilder[oneByte]
Card-one Bytes attribute.
-
trait
oneDate extends optionBuilder[oneDate]
Card-one Date attribute.
-
trait
oneDouble extends number[oneDouble, Double]
Card-one Double attribute.
-
trait
oneEnum extends enum
Card-one Enum attribute.
-
trait
oneFloat extends number[oneFloat, Float]
Card-one Float attribute.
-
trait
oneInt extends number[oneInt, Int]
Card-one Int attribute.
-
trait
oneLong extends number[oneLong, Long]
Card-one Long attribute.
-
trait
oneString extends optionBuilder[oneString]
Card-one String attribute.
-
trait
oneURI extends optionBuilder[oneURI]
Card-one URI attribute.
-
trait
oneUUID extends optionBuilder[oneUUID]
Card-one UUID attribute.
-
sealed
trait
optionBuilder[Self] extends AnyRef
Attribute options.
- trait refOptionBuilder[RefType] extends optionBuilder[RefType]
-
trait
target extends refOptionBuilder[target]
Bi-directional edge target attribute.
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
- object many extends many
- object manyBi extends manyBi
- object manyBiEdge extends manyBiEdge
- object manyBigDecimal extends manyBigDecimal
- object manyBigInt extends manyBigInt
- object manyBoolean extends manyBoolean
- object manyByte extends manyByte
- object manyDate extends manyDate
- object manyDouble extends manyDouble
- object manyEnum extends manyEnum
- object manyFloat extends manyFloat
- object manyInt extends manyInt
- object manyLong extends manyLong
- object manyString extends manyString
- object manyURI extends manyURI
- object manyUUID extends manyUUID
- object mapBigDecimal extends mapBigDecimal
- object mapBigInt extends mapBigInt
- object mapBoolean extends mapBoolean
- object mapByte extends mapByte
- object mapDate extends mapDate
- object mapDouble extends mapDouble
- object mapFloat extends mapFloat
- object mapInt extends mapInt
- object mapLong extends mapLong
- object mapString extends mapString
- object mapURI extends mapURI
- object mapUUID extends mapUUID
- object one extends one
- object oneBi extends oneBi
- object oneBiEdge extends oneBiEdge
- object oneBigDecimal extends oneBigDecimal
- object oneBigInt extends oneBigInt
- object oneBoolean extends oneBoolean
- object oneByte extends oneByte
- object oneDate extends oneDate
- object oneDouble extends oneDouble
- object oneEnum extends oneEnum
- object oneFloat extends oneFloat
- object oneInt extends oneInt
- object oneLong extends oneLong
- object oneString extends oneString
- object oneURI extends oneURI
- object oneUUID extends oneUUID
- object target extends target
Documentation/API for the Molecule library - a meta DSL for the Datomic database.
Manual | scalamolecule.org | Github | Forum