From 17c85e26d185047825950e3eae95579919baf74e Mon Sep 17 00:00:00 2001 From: guzman-raphael Date: Wed, 12 Aug 2020 10:25:43 -0500 Subject: [PATCH] Update user tables such that they are compatible with virtual classes for R2016b, update lookup such that it defines relation to getSchema properly, update djunsupported test to utilize lookup table. --- +dj/+internal/TableAccessor.m | 3 ++- +dj/+internal/UserRelation.m | 5 +++++ +dj/Computed.m | 5 +++++ +dj/Imported.m | 5 +++++ +dj/Jobs.m | 5 +++++ +dj/Lookup.m | 3 ++- +dj/Manual.m | 5 +++++ tests/TestSchema.m | 2 +- tests/test_schemas/+External/Document.m | 2 +- 9 files changed, 31 insertions(+), 4 deletions(-) diff --git a/+dj/+internal/TableAccessor.m b/+dj/+internal/TableAccessor.m index 62917766..85eb1c3b 100644 --- a/+dj/+internal/TableAccessor.m +++ b/+dj/+internal/TableAccessor.m @@ -30,7 +30,8 @@ tierClass = dj.Schema.tierClasses{2}; % default to Manual table for k=1:numel(dj.Schema.tierPrefixes) tierCharLen = length(dj.Schema.tierPrefixes{k}); - if tierCharLen > 0 && ~isempty(regexp(dj.Schema.tierPrefixes{k}, tableName(1:tierCharLen), 'ONCE')) + if tierCharLen > 0 && ~isempty(regexp(dj.Schema.tierPrefixes{k}, ... + tableName(1:tierCharLen), 'ONCE')) tierClass = dj.Schema.tierClasses{k}; break; end diff --git a/+dj/+internal/UserRelation.m b/+dj/+internal/UserRelation.m index e50db330..e384c401 100644 --- a/+dj/+internal/UserRelation.m +++ b/+dj/+internal/UserRelation.m @@ -1,2 +1,7 @@ classdef UserRelation < dj.Relvar & dj.internal.Master + methods + function self = UserRelation(varargin) + self@dj.Relvar(varargin{:}) + end + end end diff --git a/+dj/Computed.m b/+dj/Computed.m index c7bdd421..2f915455 100644 --- a/+dj/Computed.m +++ b/+dj/Computed.m @@ -1,3 +1,8 @@ classdef Computed < dj.internal.AutoPopulate % defines a computed table + methods + function self = Computed(varargin) + self@dj.internal.AutoPopulate(varargin{:}) + end + end end diff --git a/+dj/Imported.m b/+dj/Imported.m index 89d5b35c..5a4fadb9 100644 --- a/+dj/Imported.m +++ b/+dj/Imported.m @@ -1,3 +1,8 @@ classdef Imported < dj.internal.AutoPopulate % defines an imported table + methods + function self = Imported(varargin) + self@dj.internal.AutoPopulate(varargin{:}) + end + end end diff --git a/+dj/Jobs.m b/+dj/Jobs.m index 0f408bc0..fedae0d5 100644 --- a/+dj/Jobs.m +++ b/+dj/Jobs.m @@ -1,2 +1,7 @@ classdef Jobs < dj.Relvar + methods + function self = Jobs(varargin) + self@dj.Relvar(varargin{:}) + end + end end diff --git a/+dj/Lookup.m b/+dj/Lookup.m index a63f33b2..37649f43 100644 --- a/+dj/Lookup.m +++ b/+dj/Lookup.m @@ -2,7 +2,8 @@ % defines a lookup table methods - function self = Lookup() + function self = Lookup(varargin) + self@dj.internal.UserRelation(varargin{:}) if isprop(self, 'contents') if length(self.contents) > count(self) self.inserti(self.contents) diff --git a/+dj/Manual.m b/+dj/Manual.m index 2658eb35..184ac0c3 100644 --- a/+dj/Manual.m +++ b/+dj/Manual.m @@ -1,3 +1,8 @@ classdef Manual < dj.internal.UserRelation % Defines a manual table + methods + function self = Manual(varargin) + self@dj.internal.UserRelation(varargin{:}) + end + end end \ No newline at end of file diff --git a/tests/TestSchema.m b/tests/TestSchema.m index 3172922c..1cc21c84 100644 --- a/tests/TestSchema.m +++ b/tests/TestSchema.m @@ -28,7 +28,7 @@ function TestSchema_testUnsupportedDJTypes(testCase) ' X''1d751e2e1e74faf84ab485fde8ef72ca''),' ... '(X''1d751e2e1e74faf84ab485fde8ef72bf'', 2, ''attach_name'', ''filepath'',' ... 'X''1d751e2e1e74faf84ab485fde8ef72cb'')']); - c1.query(['insert into `' testCase.PREFIX '_' lower(package) '`.`document` ' ... + c1.query(['insert into `' testCase.PREFIX '_' lower(package) '`.`#document` ' ... 'values (' num2str(id) ', ''raphael'', ''hello'',' ... 'X''1d751e2e1e74faf84ab485fde8ef72be'',' ... 'X''1d751e2e1e74faf84ab485fde8ef72bf'')']); diff --git a/tests/test_schemas/+External/Document.m b/tests/test_schemas/+External/Document.m index 0c489db8..9985e5e1 100644 --- a/tests/test_schemas/+External/Document.m +++ b/tests/test_schemas/+External/Document.m @@ -7,5 +7,5 @@ document_data2 : attach@main document_data3 : filepath@main %} -classdef Document < dj.Manual +classdef Document < dj.Lookup end \ No newline at end of file