From ddd10f94836a673843137024069dee6787efdd49 Mon Sep 17 00:00:00 2001 From: florian <f.spreckelsen@inidscale.com> Date: Mon, 20 Sep 2021 17:39:48 +0200 Subject: [PATCH] FIX: Use new datatypes and values in creators --- src/Entity.jl | 39 +++++++++++++++++---------------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/src/Entity.jl b/src/Entity.jl index a507886..b202cb8 100644 --- a/src/Entity.jl +++ b/src/Entity.jl @@ -311,22 +311,20 @@ end """ function create_property_entity(; name::AbstractString = "", - datatype::AbstractString = "", + datatype::Union{AbstractString,CaosDB.Constants.DATATYPE._DATATYPE} = "", + collection::Union{CaosDB.Constants.COLLECTION._COLLECTION,Nothing} = nothing, unit::AbstractString = "", - is_reference::Bool = false, - is_list::Bool = false, ) -Return a new entity object with role Record. If `name`, `datatype`, or -`unit` were provided, its name, datatype (including whether it is a -reference or a list), or unit are set accordingly. +Return a new entity object with role Record. If `name`, `datatype`, or `unit` +were provided, its name, datatype (including whether its `collection` type), or +unit are set accordingly. """ function create_property_entity(; name::AbstractString = "", - datatype::AbstractString = "", + datatype::Union{AbstractString,CaosDB.Constants.DATATYPE._DATATYPE} = "", + collection::Union{CaosDB.Constants.COLLECTION._COLLECTION,Nothing} = nothing, unit::AbstractString = "", - is_reference::Bool = false, - is_list::Bool = false, ) property = create_entity(name) @@ -334,7 +332,7 @@ function create_property_entity(; set_role(property, CaosDB.Constants.ROLE.PROPERTY) if datatype != "" - set_datatype(property, datatype, is_list = is_list, is_reference = is_reference) + set_datatype(property, datatype, collection) end if unit != "" @@ -349,16 +347,14 @@ end name::AbstractString = "", id::AbstractString = "", value::Union{AbstractString, Number, Bool} = "", - datatype::AbstractString = "", - is_reference::Bool = false, - is_list::Bool = false, + datatype::Union{AbstractString,CaosDB.Constants.DATATYPE._DATATYPE} = "", + collection::Union{CaosDB.Constants.COLLECTION._COLLECTION, Nothing} = nothing, ) -Create a property object that can be appended to another `_Entity`. If -`name`, `id`, or `value` are given, the property's name, id, or value -are set accordingly. The datatype and whether it is a list or a -reference can be specified with `datatype`, `is_reference`, and -`is_list`, respectively. +Create a property object that can be appended to another `_Entity`. If `name`, +`id`, or `value` are given, the property's name, id, or value are set +accordingly. The datatype and its collection type can be specified with +`datatype` and `collection`, respectively. !!! info @@ -369,9 +365,8 @@ function create_property(; name::AbstractString = "", id::AbstractString = "", value::Union{AbstractString,Number,Bool} = "", - datatype::AbstractString = "", - is_reference::Bool = false, - is_list::Bool = false, + datatype::Union{AbstractString,CaosDB.Constants.DATATYPE._DATATYPE} = "", + collection::Union{CaosDB.Constants.COLLECTION._COLLECTION,Nothing} = nothing, ) property = Ref{_Property}(_Property(true)) @@ -393,7 +388,7 @@ function create_property(; end if datatype != "" - set_datatype(property, datatype, is_reference = is_reference, is_list = is_list) + set_datatype(property, datatype, collection) end if value != "" -- GitLab