Liking cljdoc? Tell your friends :D

entity.core

Define domain types

Define domain types
raw docstring

defentityclj/smacro

(defentity ent-name fields primary & more)

Define a record type with fields, keys and any additional information

Define a record type with fields, keys and any additional information
source (clj)source (cljs)raw docstring

defenumclj/smacro

(defenum name symsvals default)

Define an enum type, mapping keywords to values, for example

(defenum :foo/Active {:y 1 :n 0} :y)

defines the enum :foo/Active with two keyword symbols and corresponding values, and whose default is :y

Define an enum type, mapping keywords to values, for example

  (defenum :foo/Active {:y 1
                        :n 0} :y)

defines the enum :foo/Active with two keyword symbols and
corresponding values, and whose default is :y
source (clj)source (cljs)raw docstring

defscalarclj/smacro

(defscalar name val)

Define a scalar type, for example:

(defscalar :foo/Money 0.00M

defines the type :foo/Money as a big decimal with 2 decimal places of accuracy.

Define a scalar type, for example:

  (defscalar :foo/Money 0.00M

defines the type :foo/Money as a big decimal with 2 decimal
places of accuracy.
source (clj)source (cljs)raw docstring

delete-instanceclj/s

(delete-instance instance)

Delete the given entity instance from its persistent storage.

Delete the given entity instance from its persistent storage.
sourceraw docstring

entity-instance?clj/s

(entity-instance? arg entity)

Returns true if the argument is an instance of the given entity. The entity can be a keyword (a literal referral to the domain type) or an instance (from which the type will be determined). If arg is not an instance of entity, returns false.

Returns true if the argument is an instance of the given entity. The
entity can be a keyword (a literal referral to the domain type) or
an instance (from which the type will be determined).
If arg is not an instance of entity, returns false.
sourceraw docstring

enum-symclj/smacro

(enum-sym enum val)

Return the symbol for a given domain enum type and value

Return the symbol for a given domain enum type and value
source (clj)source (cljs)raw docstring

enum-valclj/smacro

(enum-val enum sym)

Return the value for the given domain enum type and symbol

Return the value for the given domain enum type and symbol
source (clj)source (cljs)raw docstring

enum-val-fnclj/s

(enum-val-fn enum sym)

Return the value for the given domain enum type and symbol

Return the value for the given domain enum type and symbol
sourceraw docstring

find-entityclj/s

(find-entity entity)

Find the type from the given keyword ref

Find the type from the given keyword ref
sourceraw docstring

find-valueclj/s

(find-value scalar)
(find-value entity field)

Find a value from the types catalog. Two args means type:field. Single arg means scalar. If type:field does not resolve then field is considered a key name, returning the key proto if found.

Find a value from the types catalog. Two args means type:field.
Single arg means scalar. If type:field does not resolve then field is
considered a key name, returning the key proto if found.
sourceraw docstring

get-aliasclj/s

(get-alias instance)

Return a keyword that can be used to associate the instance in a map. This will be either its unqualified name or any alias that was specified when defined.

Return a keyword that can be used to associate the
instance in a map. This will be either its unqualified
name or any alias that was specified when defined.
sourceraw docstring

get-create-fnclj/s

(get-create-fn instance)

Return the function that can be called to correctly initialise this and anything other required in the domain.

Return the function that can be called to correctly initialise this
and anything other required in the domain.
sourceraw docstring

get-destroy-fnclj/s

(get-destroy-fn instance)

Return the function that can be called to destroy this and anything else required in the domain.

Return the function that can be called to destroy this
and anything else required in the domain.
sourceraw docstring

get-key-infoclj/s

(get-key-info entity key-name)
source

get-mutate-fnclj/s

(get-mutate-fn instance)

Return the function that can be called to verify what changes are allowed and perform any consequential actions in the domain.

Return the function that can be called to verify what changes are
allowed and perform any consequential actions in the domain.
sourceraw docstring

get-primary-keyclj/s

(get-primary-key instance)

Return the instance's primary key from its meta data. If not found, throws, if identifiable as the primary key itself then returns the argument

Return the instance's primary key from its meta data.
If not found, throws, if identifiable as the primary key
itself then returns the argument
sourceraw docstring

key-val?clj/s

(key-val? arg)

Returns true if the argument appears to be a value returned by make-key

Returns true if the argument appears to be a value returned
by make-key
sourceraw docstring

make-keyclj/s

(make-key key-val entity key-name)

Make a key value. Returns a map comprising only the map keys for the given domain key name. Any missing fields are nil (or explicit default value); additional fields are ignored.

Make a key value. Returns a map comprising only the map keys
for the given domain key name. Any missing fields are
nil (or explicit default value); additional
fields are ignored.
sourceraw docstring

new-instanceclj/s

(new-instance entity)
(new-instance entity ent-val)

Make an instance of the specified type, setting any fields when an initial value is given. Any missing fields remain their default values; additional fields are ignored.

Make an instance of the specified type, setting any fields
when an initial value is given. Any missing fields remain their
default values; additional fields are ignored.
sourceraw docstring

null-ioclj/s

I/O that does nothing

I/O that does nothing
sourceraw docstring

primary-key-to-metaclj/s

(primary-key-to-meta instance)

Augment the instance meta data with the primary key. This can only be done when the primary key is established, but it is trusted this is so

Augment the instance meta data with the primary key.
This can only be done when the primary key is established,
but it is trusted this is so
sourceraw docstring

read-entityclj/s

(read-entity key-val)
(read-entity entity-name key-val)
(read-entity key-val entity-name key-name)

Read the given entity, applying the key value

Read the given entity, applying the key value
sourceraw docstring

write-instanceclj/s

(write-instance instance)

Write the given entity instance to its persistent storage

Write the given entity instance to its persistent storage
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close