diff --git a/src/Entity.jl b/src/Entity.jl index a507886ecab1a358f19286ffda9c6a7d0cd855a0..b202cb8867e8eec61c2325d60441ec66fb01c250 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 != ""