@@ -19,18 +19,6 @@ class Schema extends Clonable {
1919 */
2020 entities = { } ;
2121
22- /**
23- * Datasets, dataset = entity + relations + projection
24- * @member {object}
25- */
26- datasets = { } ;
27-
28- /**
29- * Views, view = dataset + filters
30- * @member {object}
31- */
32- views = { } ;
33-
3422 /**
3523 * @param {Linker } linker
3624 * @param {string } name
@@ -108,17 +96,6 @@ class Schema extends Clonable {
10896 this . addEntity ( entity ) ;
10997 }
11098
111- if ( ! _ . isEmpty ( this . info . views ) ) {
112- this . info . views . forEach ( ( viewName ) => {
113- let view = this . linker . loadView ( this . xemlModule , viewName ) ;
114- if ( ! view . linked ) {
115- throw new Error ( `View [${ entity . name } ] not linked after loading.` ) ;
116- }
117-
118- this . addView ( view ) ;
119- } ) ;
120- }
121-
12299 this . linked = true ;
123100
124101 return this ;
@@ -170,43 +147,6 @@ class Schema extends Clonable {
170147 return this ;
171148 }
172149
173- /**
174- * Check whether a view with given name is in the schema
175- * @param {string } viewName
176- * @returns {boolean }
177- */
178- hasView ( viewName ) {
179- return viewName in this . views ;
180- }
181-
182- /**
183- * Add a view into the schema
184- * @param {View } view
185- * @returns {Schema }
186- */
187- addView ( view ) {
188- pre: ! this . hasView ( view . name ) , `View name [${ view . name } ] conflicts in schema [${ this . name } ].` ;
189-
190- this . views [ view . name ] = view ;
191-
192- return this ;
193- }
194-
195- /**
196- * Get a document hierarchy
197- * @param {object } fromModule
198- * @param {string } datasetName
199- * @returns {object }
200- */
201- getDocumentHierachy ( fromModule , datasetName ) {
202- if ( datasetName in this . datasets ) {
203- return this . datasets [ datasetName ] ;
204- }
205-
206- let dataset = this . linker . loadDataset ( fromModule , datasetName ) ;
207- return ( this . datasets [ datasetName ] = dataset . buildHierarchy ( this ) ) ;
208- }
209-
210150 /**
211151 * Get the referenced entity, add it into schema if not in schema
212152 * @param {object } refererModule
@@ -258,8 +198,6 @@ class Schema extends Clonable {
258198 deepCloneField ( this , schema , 'comment' ) ;
259199 deepCloneField ( this , schema , 'entities' ) ;
260200 deepCloneField ( this , schema , 'types' ) ;
261- deepCloneField ( this , schema , 'datasets' ) ;
262- deepCloneField ( this , schema , 'views' ) ;
263201
264202 schema . linked = true ;
265203
@@ -277,7 +215,6 @@ class Schema extends Clonable {
277215 comment : this . comment ,
278216 entities : _ . mapValues ( this . entities , ( entity ) => entity . toJSON ( ) ) ,
279217 types : this . types ,
280- datasets : _ . mapValues ( this . datasets , ( dataset ) => dataset . toJSON ( ) ) ,
281218 views : _ . mapValues ( this . views , ( view ) => view . toJSON ( ) ) ,
282219 } ;
283220
0 commit comments