This section is about the process of how to create 6 different objects connected between them. So we can be able to creat: different Dashboards and execute an Olap Analysis.

First of all, the example is based on a wic called wic_form, used in order to register all information in a dictionary. All objects have been added on a data base called Formación Demo.

We will use the following data model in the tutorial example.

1 Data Model

Loading...

This explanation is based:

  • Object 1 movie: this is the "master table" connected with: director,categories and movie_tickets, and the head of the structure.
  • Object 2 director: this is the "master table" connected with the table movie.
  • Object 3 categories: this is the "master table" connected with the table movie.
  • Object 4 movie_tickets: this is a "master table" connected with the table movie. Depends on the movie that it has been selected, it will be shown different information.
  • Object 5 movie_actor: this is a "master table" connected with objects: movie and actor. Depends on the movie or the actor that it has been selected, it will be shown different information.
  • Object 6 actor: this is a "master table" connected with object movie_actor.

It is important to remain this concepts before writing definition code:

  • Primary Key: single-value column. It use to be an id.
  • Foreign: it refers to extern keys. This function is useful to connect two or more objects.

1.1 Movie

Table: movie



Copy
CREATE TABLE movie (
    movie_code char(12) not null,
    movie_name char(60) not null,
    movie_age date not null,
    categories_code char(12) not null,
    director_code char(12) not null,
    movie_image blob,
    num_actor char(12)
);
ALTER TABLE movie LOCK MODE (ROW);

-- Index to avoid automatic named by database (named with pk name).
CREATE UNIQUE INDEX p_movie ON movie(movie_code);
ALTER TABLE movie
 ADD CONSTRAINT 
 PRIMARY KEY (movie_code)
 CONSTRAINT p_movie;

CREATE  INDEX f_movie1 ON movie(director_code);
ALTER TABLE movie
 ADD CONSTRAINT  FOREIGN KEY (director_code)
 REFERENCES director(director_code)
 CONSTRAINT f_movie1;

CREATE  INDEX f_movie2 ON movie(categories_code);
ALTER TABLE movie
 ADD CONSTRAINT  FOREIGN KEY (categories_code)
 REFERENCES categories(categories_code)
 CONSTRAINT f_movie2;
Copy
INSERT INTO movie (movie_code, movie_name, movie_age, categories_code, director_code, num_actor) 
VALUES ('M001', 'EL PADRINO I','02-06-1983','ACTION', 'D001', '2');
INSERT INTO movie (movie_code, movie_name, movie_age, categories_code, director_code, num_actor) 
VALUES ('M002', 'EL PADRINO II','18-03-1985','ACTION', 'D001', '3');
INSERT INTO movie (movie_code, movie_name, movie_age, categories_code, director_code, num_actor) 
VALUES ('M003', 'Batman - El Caballero Oscuro','02-11-2006','ACTION', 'D002', '3');
INSERT INTO movie (movie_code, movie_name, movie_age, categories_code, director_code, num_actor) 
VALUES ('M004', 'Pulp Fiction','25-02-1991','COMEDY', 'D003', '2');
INSERT INTO movie (movie_code, movie_name, movie_age, categories_code, director_code, num_actor) 
VALUES ('M005', 'Snach, cerdos y diamantes','14-08-2002','SUPENSE', 'D004', '6');
INSERT INTO movie (movie_code, movie_name, movie_age, categories_code, director_code, num_actor) 
VALUES ('M006', 'Lock & Stock','19-09-2000','ACTION', 'D004', '3');
Copy
<table name="movie">

    <!-- COLUMNS -->  
    <column name="movie_code"           type="char"         size='12'      required="y" />
    <column name="movie_name"           type="char"         size='60'      required="y" />
    <column name="movie_age"            type="date"                        required="y" />
    <column name="categories_code"      type="char"         size='12'      required="y" />
    <column name="director_code"        type="char"         size='12'      required="y" />
    <column name="movie_image"          type="blob"                                     />
    <column name="num_actor"            type="char"         size='12'                   />

    <!-- PRIMARY KEY -->   
	<primary name="p_movie" columns="movie_code" />
    
    <!-- FOREIGN KEY -->   
    <foreign name="f_movie1" columns="director_code"    references="director"      refcols="director_code" />
    <foreign name="f_movie2" columns="categories_code"  references="categories"  refcols="categories_code" />

</table>
[SOAPException: faultCode=SOAP-ENV:Server; msg=Exception from service object: java.sql.SQLException: No row bean PK([database_code])([wic_form]) for table 'wic_database_object' in database 'wic_conf_2022'] at deister.axional.docs.xsl.CMSSOAPClient.__doSOAPCall(CMSSOAPClient.java:113) at deister.axional.docs.xsl.CMSSOAPClient.__doSOAPCall(CMSSOAPClient.java:94) at deister.axional.docs.xsl.CMSSOAPClient.getDictionaryObjectData(CMSSOAPClient.java:207) at jdk.internal.reflect.GeneratedMethodAccessor1491.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:564) at org.apache.xalan.extensions.ExtensionHandlerJavaPackage.callFunction(ExtensionHandlerJavaPackage.java:343) at org.apache.xalan.extensions.ExtensionHandlerJavaPackage.callFunction(ExtensionHandlerJavaPackage.java:440) at org.apache.xalan.extensions.ExtensionsTable.extFunction(ExtensionsTable.java:222) at org.apache.xalan.transformer.TransformerImpl.extFunction(TransformerImpl.java:475) at org.apache.xpath.functions.FuncExtFunction.execute(FuncExtFunction.java:208) at org.apache.xpath.objects.XRTreeFragSelectWrapper.execute(XRTreeFragSelectWrapper.java:69) at org.apache.xpath.XPath.execute(XPath.java:337) at org.apache.xalan.templates.ElemVariable.getValue(ElemVariable.java:280) at org.apache.xalan.templates.ElemVariable.execute(ElemVariable.java:248) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemTemplate.execute(ElemTemplate.java:394) at org.apache.xalan.templates.ElemCallTemplate.execute(ElemCallTemplate.java:248) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemChoose.execute(ElemChoose.java:141) at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:395) at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:178) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemIf.execute(ElemIf.java:162) at org.apache.xalan.templates.ElemForEach.transformSelectedNodes(ElemForEach.java:425) at org.apache.xalan.templates.ElemForEach.execute(ElemForEach.java:265) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376) at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:395) at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:178) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemChoose.execute(ElemChoose.java:128) at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:395) at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:178) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemChoose.execute(ElemChoose.java:128) at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:395) at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:178) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376) at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:395) at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:178) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2272) at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1358) at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:711) at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1275) at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1253) at deister.axional.server.lang.xsl.XSLProcessor.__execute(XSLProcessor.java:866) at deister.axional.server.lang.xsl.XSLProcessor$4.call(XSLProcessor.java:702) at deister.axional.server.lang.xsl.XSLProcessor$4.call(XSLProcessor.java:694) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) at java.base/java.lang.Thread.run(Thread.java:832)

1.2 Director

Table: director



Copy
CREATE TABLE director (
    director_code char(12) not null,
    director_name varchar(60) not null,
    director_age date
);
ALTER TABLE director LOCK MODE (ROW);

-- Index to avoid automatic named by database (named with pk name).
CREATE UNIQUE INDEX p_director ON director(director_code);
ALTER TABLE director
 ADD CONSTRAINT 
 PRIMARY KEY (director_code)
 CONSTRAINT p_director;
Copy
INSERT INTO director (director_code, director_name, director_age) 
VALUES ('D001', 'Martin scorsese','01-06-1945');
INSERT INTO director (director_code, director_name, director_age)  
VALUES ('D002', 'Christopher Nolan','22-02-1958');
INSERT INTO director (director_code, director_name, director_age)  
VALUES ('D003', 'Quentin Tarantino','06-10-1968');
INSERT INTO director (director_code, director_name, director_age)  
VALUES ('D004', 'Guy Ritchie','26-07-1970');
Copy
<table name="director">

	<!-- COLUMNS -->   
	<column name="director_code"   type="char"    size="12"  required="y" />
	<column name="director_name"   type="varchar" size="60"  required="y" />
	<column name="director_age"    type="date" />

 	<!-- PRIMARY KEY -->   
    <primary name='p_director' columns='director_code' />
    
</table>
[SOAPException: faultCode=SOAP-ENV:Server; msg=Exception from service object: java.sql.SQLException: No row bean PK([database_code])([wic_form]) for table 'wic_database_object' in database 'wic_conf_2022'] at deister.axional.docs.xsl.CMSSOAPClient.__doSOAPCall(CMSSOAPClient.java:113) at deister.axional.docs.xsl.CMSSOAPClient.__doSOAPCall(CMSSOAPClient.java:94) at deister.axional.docs.xsl.CMSSOAPClient.getDictionaryObjectData(CMSSOAPClient.java:207) at jdk.internal.reflect.GeneratedMethodAccessor1491.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:564) at org.apache.xalan.extensions.ExtensionHandlerJavaPackage.callFunction(ExtensionHandlerJavaPackage.java:300) at org.apache.xalan.extensions.ExtensionHandlerJavaPackage.callFunction(ExtensionHandlerJavaPackage.java:440) at org.apache.xalan.extensions.ExtensionsTable.extFunction(ExtensionsTable.java:222) at org.apache.xalan.transformer.TransformerImpl.extFunction(TransformerImpl.java:475) at org.apache.xpath.functions.FuncExtFunction.execute(FuncExtFunction.java:208) at org.apache.xpath.objects.XRTreeFragSelectWrapper.execute(XRTreeFragSelectWrapper.java:69) at org.apache.xpath.XPath.execute(XPath.java:337) at org.apache.xalan.templates.ElemVariable.getValue(ElemVariable.java:280) at org.apache.xalan.templates.ElemVariable.execute(ElemVariable.java:248) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemTemplate.execute(ElemTemplate.java:394) at org.apache.xalan.templates.ElemCallTemplate.execute(ElemCallTemplate.java:248) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemChoose.execute(ElemChoose.java:141) at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:395) at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:178) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemIf.execute(ElemIf.java:162) at org.apache.xalan.templates.ElemForEach.transformSelectedNodes(ElemForEach.java:425) at org.apache.xalan.templates.ElemForEach.execute(ElemForEach.java:265) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376) at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:395) at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:178) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemChoose.execute(ElemChoose.java:128) at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:395) at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:178) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemChoose.execute(ElemChoose.java:128) at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:395) at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:178) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376) at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:395) at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:178) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2272) at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1358) at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:711) at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1275) at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1253) at deister.axional.server.lang.xsl.XSLProcessor.__execute(XSLProcessor.java:866) at deister.axional.server.lang.xsl.XSLProcessor$4.call(XSLProcessor.java:702) at deister.axional.server.lang.xsl.XSLProcessor$4.call(XSLProcessor.java:694) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) at java.base/java.lang.Thread.run(Thread.java:832)

1.3 Categories

Table: categories



Copy
CREATE TABLE categories (
    categories_code char(12) not null,
    categories_name varchar(60) not null
);
ALTER TABLE categories LOCK MODE (ROW);

-- Index to avoid automatic named by database (named with pk name).
CREATE UNIQUE INDEX p_categories ON categories(categories_code);
ALTER TABLE categories
 ADD CONSTRAINT 
 PRIMARY KEY (categories_code)
 CONSTRAINT p_categories;
Copy
INSERT INTO categories (categories_code, categories_name)
VALUES ('DRAMA', 'Drama');
INSERT INTO categories (categories_code, categories_name) 
VALUES ('ACTION', 'Action');
INSERT INTO categories (categories_code, categories_name) 
VALUES ('TERROR', 'Terroro');
INSERT INTO categories (categories_code, categories_name) 
VALUES ('SUPENSE', 'Suspense');
INSERT INTO categories (categories_code, categories_name) 
VALUES ('COMEDY', 'Comedia');
Copy
<table name="categories">

    <!-- COLUMNS -->  
    <column name="categories_code" type="char"       size='12'      required="y" />
    <column name="categories_name" type="varchar"    size='60'      required="y"   />

    <!-- PRIMARY KEY -->   
    <primary name="p_categories"  columns='categories_code' />

</table>
[SOAPException: faultCode=SOAP-ENV:Server; msg=Exception from service object: java.sql.SQLException: No row bean PK([database_code])([wic_form]) for table 'wic_database_object' in database 'wic_conf_2022'] at deister.axional.docs.xsl.CMSSOAPClient.__doSOAPCall(CMSSOAPClient.java:113) at deister.axional.docs.xsl.CMSSOAPClient.__doSOAPCall(CMSSOAPClient.java:94) at deister.axional.docs.xsl.CMSSOAPClient.getDictionaryObjectData(CMSSOAPClient.java:207) at jdk.internal.reflect.GeneratedMethodAccessor1491.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:564) at org.apache.xalan.extensions.ExtensionHandlerJavaPackage.callFunction(ExtensionHandlerJavaPackage.java:300) at org.apache.xalan.extensions.ExtensionHandlerJavaPackage.callFunction(ExtensionHandlerJavaPackage.java:440) at org.apache.xalan.extensions.ExtensionsTable.extFunction(ExtensionsTable.java:222) at org.apache.xalan.transformer.TransformerImpl.extFunction(TransformerImpl.java:475) at org.apache.xpath.functions.FuncExtFunction.execute(FuncExtFunction.java:208) at org.apache.xpath.objects.XRTreeFragSelectWrapper.execute(XRTreeFragSelectWrapper.java:69) at org.apache.xpath.XPath.execute(XPath.java:337) at org.apache.xalan.templates.ElemVariable.getValue(ElemVariable.java:280) at org.apache.xalan.templates.ElemVariable.execute(ElemVariable.java:248) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemTemplate.execute(ElemTemplate.java:394) at org.apache.xalan.templates.ElemCallTemplate.execute(ElemCallTemplate.java:248) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemChoose.execute(ElemChoose.java:141) at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:395) at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:178) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemIf.execute(ElemIf.java:162) at org.apache.xalan.templates.ElemForEach.transformSelectedNodes(ElemForEach.java:425) at org.apache.xalan.templates.ElemForEach.execute(ElemForEach.java:265) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376) at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:395) at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:178) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemChoose.execute(ElemChoose.java:128) at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:395) at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:178) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemChoose.execute(ElemChoose.java:128) at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:395) at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:178) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376) at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:395) at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:178) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2272) at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1358) at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:711) at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1275) at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1253) at deister.axional.server.lang.xsl.XSLProcessor.__execute(XSLProcessor.java:866) at deister.axional.server.lang.xsl.XSLProcessor$4.call(XSLProcessor.java:702) at deister.axional.server.lang.xsl.XSLProcessor$4.call(XSLProcessor.java:694) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) at java.base/java.lang.Thread.run(Thread.java:832)

1.4 Movie Tickets

Table: movie_tickets



Copy
CREATE TABLE movie_tickets (
    movie_code char(12) not null,
    qty smallint not null,
    price decimal(14,2) not null,
    fecha date not null
);
ALTER TABLE movie_tickets LOCK MODE (ROW);

CREATE  INDEX f_movie_tickets1 ON movie_tickets(movie_code);
ALTER TABLE movie_tickets
 ADD CONSTRAINT  FOREIGN KEY (movie_code)
 REFERENCES movie(movie_code)
 CONSTRAINT f_movie_tickets1;
Copy
<!--This script will create a random quantity of tickets,                -->
<!-- for a random quantity of movies, and its respective price; per day. -->
<!-- From January till June of 2017,                                     -->
<!-- considering that all of those months have 30 days. -->

<xsql-script>
    <body>
        <set name='var'><date.today /></set>
        
            <!-- ==================================== --> 
            <!-- Date creation from January till June -->
            <!-- ==================================== --> 
            <for name='the_month' start='1' end='6'>
                <do>
                    <!-- We consider that all months have 30 days -->
                    <for name='the_day' start='1' end='30'> 
                        <do>
                            <!-- Random number of movies where it will be created a ticket data, -->
                            <!-- per day, and inserted in the table 'movie_tickets' -->
                            <set name='m_ins'><math.round><mul><math.random/>5</mul>0</math.round></set> 
                       
                                <for name='table_insert' start='0' end='#m_ins'>
                                    <do>
                                        <!-- Random quantity of tickets that are created, per movie; maximum 9 -->
                                        <set name='qty_m'><math.round><mul><math.random/>9</mul>0</math.round></set>
                                        <!-- Price of the tickets (7.5) * Quantity -->
                                        <set name='final'><mul><qty_m/>7.5</mul></set>
                                        <!-- Creation of the date of the tickets, from January till June, -->
                                        <!-- considering all months have 30 days, and for only year 2017 -->
                                        <set name='fecha_m'><date.mdy><the_month/><the_day/>2017</date.mdy></set>
                                        <!-- Creates randomly a movie code, from M001-M006 -->
                                        <set name='peli'><string>M00<add><math.round><mul><math.random/>5</mul>0</math.round>1</add></string></set> 
                    
                                        <!-- Insertion into the table "movie_tickets" -->
                                        <insert table='movie_tickets'>
                                            <column name='movie_code'><peli /></column>
                                            <column name='qty'><qty_m/></column>
                                            <column name='price'><final /></column>
                                            <column name='fecha'><fecha_m /></column>
                                        </insert>
        
                                    </do>
                                </for>
                        </do>
                    </for> 
                </do>
        </for>

    </body>
</xsql-script>
Copy
<table name="movie_tickets">

    <!-- COLUMNS -->  
    <column name="movie_code"           type="char"         size='12'      required="y" />
    <column name="qty"                  type="smallint"                    required="y" />
    <column name="price"                type="decimal"      size='14,2'    required="y" />
    <column name="fecha"                type="date"                        required="y" />

    <!-- FOREIGN KEY -->   
    <foreign name="f_movie_tickets1" columns="movie_code"    references="movie"      refcols="movie_code" />

</table>

1.5 Actor

Table: actor



Copy
CREATE TABLE actor (
    actor_code char(12) not null,
    actor_name  varchar(60) not null,
    actor_age date not null,
    actor_direcc varchar(60),
    actor_poblac varchar(60),
    actor_codpos char(10),
    gps_lon decimal(14,10),
    gps_lat decimal(14,10)
);
ALTER TABLE actor LOCK MODE (ROW);

-- Index to avoid automatic named by database (named with pk name).
CREATE UNIQUE INDEX p_actor ON actor(actor_code);
ALTER TABLE actor
 ADD CONSTRAINT 
 PRIMARY KEY (actor_code)
 CONSTRAINT p_actor;
Copy
INSERT INTO actor (actor_code, actor_name, actor_age, actor_direcc, actor_poblac,actor_codpos, gps_lon, gps_lat)
VALUES ('01','Jason Statham', '1980-07-01','Elm Street, nº 12', 'London', '02367', '-0.1257', '51.5085);
INSERT INTO actor (actor_code, actor_name, actor_age, actor_direcc, actor_poblac,actor_codpos, gps_lon, gps_lat)
VALUES ('04', 'Rachel McAdams','1985-11-15', 'C/ Angli, nº 35', 'Barcelona', '08052','   2.1685', '41.3818');
INSERT INTO actor (actor_code, actor_name, actor_age, actor_direcc, actor_poblac,actor_codpos, gps_lon, gps_lat)
VALUES ('02', 'Heath Ledger ','1982-04-26', 'Cangaroo Street, nº 375', 'Sydney', '85695',' 151.2073', '-33.8679');
INSERT INTO actor (actor_code, actor_name, actor_age, actor_direcc, actor_poblac,actor_codpos, gps_lon, gps_lat)
VALUES ('03', 'Leonardo Dicaprio','1894-08-29', '5th Avenue, 72', 'New York', '96547',' -74.0060', '40.7143');
INSERT INTO actor (actor_code, actor_name, actor_age, actor_direcc, actor_poblac,actor_codpos, gps_lon, gps_lat)
VALUES ('05', 'Matt Damon','1978-02-04', 'Dessert Avenue, 516', 'Phoenix', '58961','-112.0740', '33.4484');
INSERT INTO actor (actor_code, actor_name, actor_age, actor_direcc, actor_poblac,actor_codpos, gps_lon, gps_lat)
VALUES ('07', 'Christian Bale','1978-06-16', 'Railway Street, 789', 'San Francisco', '45616','120.4194', '27.7749');
INSERT INTO actor (actor_code, actor_name, actor_age, actor_direcc, actor_poblac,actor_codpos, gps_lon, gps_lat)
VALUES ('06', 'Marion Cotillard','1978-11-28', 'La vie en rose, nº 43', 'Paris', '69517','2.3488', ' 48.8534');
INSERT INTO actor (actor_code, actor_name, actor_age, actor_direcc, actor_poblac,actor_codpos, gps_lon, gps_lat)
VALUES ('08', 'John Travolta','1948-07-28', 'Shotgun Avenue, 56, 'Detroit', '08653','-83.0458', ' 42.3314');
INSERT INTO actor (actor_code, actor_name, actor_age, actor_direcc, actor_poblac,actor_codpos, gps_lon, gps_lat)
VALUES ('09', 'Samuel L.Jackson','1947-08-14', 'C/ Che Guevara, 34', 'Buenos Aires', '54962',' -58.3772', '-34.6132');
INSERT INTO actor (actor_code, actor_name, actor_age, actor_direcc, actor_poblac,actor_codpos, gps_lon, gps_lat)
VALUES ('10', 'Ben Affleck','1981-11-29', 'Batman street, nº 85', 'Boston', '78958','-71.0598', '2.3584');
INSERT INTO actor (actor_code, actor_name, actor_age, actor_direcc, actor_poblac,actor_codpos, gps_lon, gps_lat)
VALUES ('11', 'Emma Watson','1894-08-09', 'Howards Avenue, nº19', 'Cardiff', '02895 ','-0.1257', '51.5085');
INSERT INTO actor (actor_code, actor_name, actor_age, actor_direcc, actor_poblac,actor_codpos, gps_lon, gps_lat)
VALUES ('12', 'Tom Cruise','2017-06-21', 'Celtic Street, nº 12', 'Boston', '02367','-112.0740', '33.4484');
Copy
<table name="actor">

	<!-- COLUMNS -->  
	<column name="actor_code"   type="char"     size="12"   required="y"   />
	<column name="actor_name "  type="varchar"  size="60"   required="y"   />
	<column name="actor_age"    type="date"                 required="y"   />
	
	<column name='actor_direcc'  type='varchar'  size='60'                 />
    <column name='actor_poblac'  type='varchar'  size='60'                 />
    <column name='actor_codpos'  type='char'     size='10'                 />
       
    <column name='gps_lon'       type='decimal' size='14,10'               />  
    <column name='gps_lat'       type='decimal' size='14,10'               />

	<!-- PRIMARY KEY -->   
	<primary name="p_actor" columns="actor_code" />
    
</table>
[SOAPException: faultCode=SOAP-ENV:Server; msg=Exception from service object: java.sql.SQLException: No row bean PK([database_code])([wic_form]) for table 'wic_database_object' in database 'wic_conf_2022'] at deister.axional.docs.xsl.CMSSOAPClient.__doSOAPCall(CMSSOAPClient.java:113) at deister.axional.docs.xsl.CMSSOAPClient.__doSOAPCall(CMSSOAPClient.java:94) at deister.axional.docs.xsl.CMSSOAPClient.getDictionaryObjectData(CMSSOAPClient.java:207) at jdk.internal.reflect.GeneratedMethodAccessor1491.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:564) at org.apache.xalan.extensions.ExtensionHandlerJavaPackage.callFunction(ExtensionHandlerJavaPackage.java:300) at org.apache.xalan.extensions.ExtensionHandlerJavaPackage.callFunction(ExtensionHandlerJavaPackage.java:440) at org.apache.xalan.extensions.ExtensionsTable.extFunction(ExtensionsTable.java:222) at org.apache.xalan.transformer.TransformerImpl.extFunction(TransformerImpl.java:475) at org.apache.xpath.functions.FuncExtFunction.execute(FuncExtFunction.java:208) at org.apache.xpath.objects.XRTreeFragSelectWrapper.execute(XRTreeFragSelectWrapper.java:69) at org.apache.xpath.XPath.execute(XPath.java:337) at org.apache.xalan.templates.ElemVariable.getValue(ElemVariable.java:280) at org.apache.xalan.templates.ElemVariable.execute(ElemVariable.java:248) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemTemplate.execute(ElemTemplate.java:394) at org.apache.xalan.templates.ElemCallTemplate.execute(ElemCallTemplate.java:248) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemChoose.execute(ElemChoose.java:141) at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:395) at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:178) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemIf.execute(ElemIf.java:162) at org.apache.xalan.templates.ElemForEach.transformSelectedNodes(ElemForEach.java:425) at org.apache.xalan.templates.ElemForEach.execute(ElemForEach.java:265) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376) at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:395) at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:178) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemChoose.execute(ElemChoose.java:128) at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:395) at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:178) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemChoose.execute(ElemChoose.java:128) at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:395) at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:178) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376) at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:395) at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:178) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2272) at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1358) at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:711) at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1275) at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1253) at deister.axional.server.lang.xsl.XSLProcessor.__execute(XSLProcessor.java:866) at deister.axional.server.lang.xsl.XSLProcessor$4.call(XSLProcessor.java:702) at deister.axional.server.lang.xsl.XSLProcessor$4.call(XSLProcessor.java:694) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) at java.base/java.lang.Thread.run(Thread.java:832)

1.6 Movie Actor

Table: movie_actor



Copy
CREATE TABLE movie_actor (
    movie_code char(12) not null,
    actor_code char(12) not null
);
ALTER TABLE movie_actor LOCK MODE (ROW);

CREATE  INDEX f_movie_actor1 ON movie_actor(movie_code);
ALTER TABLE movie_actor
 ADD CONSTRAINT  FOREIGN KEY (movie_code)
 REFERENCES movie(movie_code)
 CONSTRAINT f_movie_actor1;

CREATE  INDEX f_movie_actor2 ON movie_actor(actor_code);
ALTER TABLE movie_actor
 ADD CONSTRAINT  FOREIGN KEY (actor_code)
 REFERENCES actor(actor_code)
 CONSTRAINT f_movie_actor2;
Copy
INSERT INTO movie_actor (movie_code, actor_name)
VALUES ('M001', '01');
INSERT INTO movie_actor (movie_code, actor_name)
VALUES ('M002', '10');
INSERT INTO movie_actor (movie_code, actor_name)
VALUES ('M003', '07');
INSERT INTO movie_actor (movie_code, actor_name)
VALUES ('M003', '02');
INSERT INTO movie_actor (movie_code, actor_name)
VALUES ('M003', '06');
INSERT INTO movie_actor (movie_code, actor_name)
VALUES ('M004', '08');
INSERT INTO movie_actor (movie_code, actor_name)
VALUES ('M004', '09');
INSERT INTO movie_actor (movie_code, actor_name)
VALUES ('M005', '01');
INSERT INTO movie_actor (movie_code, actor_name)
VALUES ('M005', '03');
INSERT INTO movie_actor (movie_code, actor_name)
VALUES ('M005', '04');
INSERT INTO movie_actor (movie_code, actor_name)
VALUES ('M005', '09');
INSERT INTO movie_actor (movie_code, actor_name)
VALUES ('M005', '10');
INSERT INTO movie_actor (movie_code, actor_name)
VALUES ('M006', '08');
INSERT INTO movie_actor (movie_code, actor_name)
VALUES ('M002', '11');
INSERT INTO movie_actor (movie_code, actor_name)
VALUES ('M005', '02');
INSERT INTO movie_actor (movie_code, actor_name)
VALUES ('M006', '05');
INSERT INTO movie_actor (movie_code, actor_name)
VALUES ('M006', '01');
INSERT INTO movie_actor (movie_code, actor_name)
VALUES ('M001', '11');
Copy
<table name="movie_actor">

    <!-- COLUMNS -->  
    <column name="movie_code" type="char"       size='12'      required="y" />
    <column name="actor_code" type="char"       size='12'      required="y" />

    <!-- FOREIGN KEY -->   
    <foreign name="f_movie_actor1" columns="movie_code"  references="movie"  refcols="movie_code" />
    <foreign name="f_movie_actor2" columns="actor_code"  references="actor"  refcols="actor_code" />

</table>
[SOAPException: faultCode=SOAP-ENV:Server; msg=Exception from service object: java.sql.SQLException: No row bean PK([database_code])([wic_form]) for table 'wic_database_object' in database 'wic_conf_2022'] at deister.axional.docs.xsl.CMSSOAPClient.__doSOAPCall(CMSSOAPClient.java:113) at deister.axional.docs.xsl.CMSSOAPClient.__doSOAPCall(CMSSOAPClient.java:94) at deister.axional.docs.xsl.CMSSOAPClient.getDictionaryObjectData(CMSSOAPClient.java:207) at jdk.internal.reflect.GeneratedMethodAccessor1491.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:564) at org.apache.xalan.extensions.ExtensionHandlerJavaPackage.callFunction(ExtensionHandlerJavaPackage.java:300) at org.apache.xalan.extensions.ExtensionHandlerJavaPackage.callFunction(ExtensionHandlerJavaPackage.java:440) at org.apache.xalan.extensions.ExtensionsTable.extFunction(ExtensionsTable.java:222) at org.apache.xalan.transformer.TransformerImpl.extFunction(TransformerImpl.java:475) at org.apache.xpath.functions.FuncExtFunction.execute(FuncExtFunction.java:208) at org.apache.xpath.objects.XRTreeFragSelectWrapper.execute(XRTreeFragSelectWrapper.java:69) at org.apache.xpath.XPath.execute(XPath.java:337) at org.apache.xalan.templates.ElemVariable.getValue(ElemVariable.java:280) at org.apache.xalan.templates.ElemVariable.execute(ElemVariable.java:248) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemTemplate.execute(ElemTemplate.java:394) at org.apache.xalan.templates.ElemCallTemplate.execute(ElemCallTemplate.java:248) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemChoose.execute(ElemChoose.java:141) at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:395) at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:178) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemIf.execute(ElemIf.java:162) at org.apache.xalan.templates.ElemForEach.transformSelectedNodes(ElemForEach.java:425) at org.apache.xalan.templates.ElemForEach.execute(ElemForEach.java:265) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376) at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:395) at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:178) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemChoose.execute(ElemChoose.java:128) at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:395) at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:178) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemChoose.execute(ElemChoose.java:128) at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:395) at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:178) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376) at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:395) at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:178) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2272) at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1358) at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:711) at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1275) at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1253) at deister.axional.server.lang.xsl.XSLProcessor.__execute(XSLProcessor.java:866) at deister.axional.server.lang.xsl.XSLProcessor$4.call(XSLProcessor.java:702) at deister.axional.server.lang.xsl.XSLProcessor$4.call(XSLProcessor.java:694) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) at java.base/java.lang.Thread.run(Thread.java:832)

2 Dashboards

In this area, it will be shown, 3 different Chart types examples: Cartesian, Pie and Funnel. Using the objects created above.

The main purpose of this section is to create a new object called dashboards, which will consist in an object with all master's movie objects information.

First step: How to create a dashboard

It is not necessary to define any tables, if we do not want to use them in the form.




Create a form with an SQL-JCHART, and start the configuration of it, to start with the definition of the different graphs.



2.1 Cartesian

In this example we will appreciate the total amount of movies that the actors have performed individualy.

In the picture below we would be able to observe the parametrization of the Chart:



  1. Select the wanted type of graph: Cartesian.
  2. Set the value of the abscissa axis (x-axis), table and column, respectively. In this case the values will be: the table actor, and column actor_name.
  3. To lable the ordinates axis (y-axis), we can set a value. We have set the correspondant label, "Movies". (This field is not mandatory)
  4. SQL statement to be executed. In this occasion will be:
Copy
<select>
    <columns>
        COUNT (*) <alias name='num'/>,
        actor.actor_name <alias name='actor_name'/>
    </columns>
    <from table='movie_actor'>
        <join table = 'actor'>
            <on>actor.actor_code = movie_actor.actor_code</on>
        </join>
    </from>
    <group>2</group>
    <order>1</order>
</select>

* from the table actor".



5. In the JCHART series we add the column ' num' with its numeric value. In this case will show the total number of movies that each actor has performed.

You can choose the type of graph that you want to perform. We have choosen Lines.


See result:



2.2 Pie

In this example we will appreciate the different categories in which the movies are classified.

In the picture below we would be able to observe the parametrization of the Chart:



  1. Select the wanted type of graph: Pie.
  2. Set the values that you want to be shown, in the abscissa axis (x-axis), table and column, respectively. In this case the values will be, from the table categories, and the value name, from the column categories_name.
  3. SQL statement to be executed. In this occasion will be:
Copy
<select>
    <columns>
        COUNT(*) num,
        categories.categories_name 
    </columns>
    <from table='movie'>
        <join table='categories'>
            <on>movie.categories_code = categories.categories_code</on>
        </join>
    </from>
    <group>2</group>
</select>

* from the table movie.



4. In the JCHART series we add the column ' num' with its numeric value. In this case will show the total number of movies, and the percentage it represents of the total, classified by categories.

You can choose the type of graph that you want to perform. We have choosen Pie.


See result:



2.3 Funnel

In this example you will appreciate the total number of movies that each director has directed.

In the picture below we would be able to observe the parametrization of the Chart:



  1. Select the wanted type of graph: Funnel.
  2. Set the values that you want to be shown, in the abscissa axis (x-axis), table and column, respectively. In this case the values will be, from the table director, and the value name, from the column director_name.
  3. SQL statement to be executed. In this occasion will be:
Copy
<select>
    <columns>
        director.director_name, 
        COUNT (*) total
    </columns>    
    <from table='movie'>                    
        <join table='director'>
            <on>movie.director_code = director.director_code</on>		
        </join>	
    </from>
    <group>1</group>
    <order>1</order>
</select>

* from the table movie.



4. In the JCHART series we add the column ' total' with its numeric value. In this case will show the total number of movies, and the percentage it represents of the total, that each director has done.

You can choose the type of graph that you want to perform. We have choosen Funnel.


See result:



3 OLAP

We will present an example of an Olap cube.

3.1 Example

It has to be created an Olap schema, in the correspondant dictionary.

Below, you will find the definition of the schema, in XML:

Copy
<Schema name="movie_tickets">
    
    <!-- Year-Month -->
    <Dimension name="GenericDate" type="TimeDimension">
        <Hierarchy hasAll="true" name="Year Calendar" primaryKey="day">
            <Table name="gdwh_cal_day"/>
            <Level name="Year"       column="yearnum"      uniqueMembers="true"     levelType="TimeYears"    />
            <Level name="Semester"   column="semestername" uniqueMembers="false"                             />
            <Level name="Quarter"    column="quartername"  uniqueMembers="false"    levelType="TimeQuarters" />
            <Level name="Month"      column="monthname"    uniqueMembers="false"    levelType="TimeMonths"   />
            <Level name="Day"        column="dayname"      uniqueMembers="false"    levelType="TimeDays"     />
        </Hierarchy>
        <Hierarchy hasAll="true" name="Week Calendar" primaryKey="day">
            <Table name="gdwh_cal_day"/>
            <Level name="Year"       column="yearnum"      uniqueMembers="true"     levelType="TimeYears"    />
            <Level name="Week"       column="weekname"     uniqueMembers="false"    levelType="TimeWeeks"    />
            <Level name="Day"        column="dayname"      uniqueMembers="false"    levelType="TimeDays"     />
        </Hierarchy>
        <Hierarchy hasAll="true" name="Year Compare Calendar" primaryKey="day">
            <Table name="gdwh_cal_day"/>
            <Level name="Year"       column="yearnum"      uniqueMembers="true"     levelType="TimeYears"    />
            <Level name="Semester"   column="semestername" uniqueMembers="true"                              />
            <Level name="Quarter"    column="quartername"  uniqueMembers="true"                              />
            <Level name="Month"      column="monthname"    uniqueMembers="true"                              />
            <Level name="Week"       column="sevenname"    uniqueMembers="true"     levelType="TimeWeeks"    />
            <Level name="Day"        column="daynum"       uniqueMembers="true"                              />
        </Hierarchy>
        <Hierarchy hasAll="true" name="Week Compare Calendar" primaryKey="day">
            <Table name="gdwh_cal_day" />
            <Level name="Year"       column="yearnum"  uniqueMembers="true"         levelType="TimeYears"    />
            <Level name="Week"       column="weekname" uniqueMembers="true"         levelType="TimeWeeks"    />
        </Hierarchy>

        <Hierarchy hasAll="true" name="Date Calendar" primaryKey="day">
            <Table name="gdwh_cal_day" />
            <Level name="Day date" uniqueMembers="false" type="Date">
                <KeyExpression>
                    <SQL dialect="generic">
                       (day)
                    </SQL>
                </KeyExpression>
            </Level>
        </Hierarchy>
    </Dimension>
    
    <!-- Movie -->
    <Dimension name="Movies">
        <Hierarchy hasAll="true" primaryKey="movie_code">
          <Join leftKey="director_code" rightKey="director_code">
            <Table name="movie"/>
            <Table name="director"/>
           </Join>
         
          <Level name="Movie Code" table="movie" column="movie_code"  uniqueMembers="true" />
          <Level name="Movie name" table="movie" column="movie_name"  uniqueMembers="false" />
          <Level name="Director" table="director" column="director_code"   uniqueMembers="false" />
          <Level name="Director name" table="director" column="director_name"   uniqueMembers="false" />
        </Hierarchy>
          
        <Hierarchy hasAll="true" name="Categories" primaryKey="movie_code">
          <Join leftKey="categories_code" rightKey="categories_code">
            <Table name="movie"/>
            <Table name="categories"/>
           </Join>
          
          <Level name="Category" table="categories" column="categories_code" uniqueMembers="false" />
          <Level name="Category Name" table="categories" column="categories_name" uniqueMembers="false" />

        </Hierarchy>
    </Dimension>
         
          <!-- Actors -->
    <Dimension name="Actors">
        <Hierarchy hasAll="true" primaryKey="movie_code" >
          <Join leftKey="movie_code" rightKey="movie_code">
            <Table name="movie"/>
          <Join leftKey="actor_code" rightKey="actor_code">
            <Table name="movie_actor"/>
            <Table name="actor"/>
           </Join>
           </Join>
          
          <Level name="Actor Code" table="actor" column="actor_code" uniqueMembers="true" />
          <Level name="Actor Name" table="actor" column="actor_name" uniqueMembers="false" >
            <Property name="Direction" column="actor_direcc" type="string"/>
            <Property name="Postal Code" column="actor_codpos" type="number"/>
            </Level>
            <Level name="Poblation of Actor" table="actor" column="actor_poblac" type="String" uniqueMembers="false" />
        </Hierarchy>
    </Dimension>
        
    <Cube name="Movie Analysis" defaultMeasure="Sales">
        <Table name="movie_tickets"/>        
        <!-- Year-Month -->
        <DimensionUsage name='GenericDate'        foreignKey='fecha'    source='GenericDate'   />                                                                              
        <!-- Movies -->                                                      
        <DimensionUsage name="Movies"             foreignKey="movie_code"  source="Movies"       />
       <!-- Actors -->                                                      
        <DimensionUsage name="Actors"             foreignKey="movie_code"  source="Actors"       />
        
        <Measure name="Sales"   column="price"         aggregator="sum" formatString="#,###.00">
            <MeasureExpression>
                <SQL dialect="generic">NVL(price,0)</SQL> <!-- NVL(..,0) replaces the NULL values for 0s -->
          </MeasureExpression>
        </Measure>
        
        <Measure name="Quantity" column="qty" aggregator="sum" formatString="#,###">
         <MeasureExpression>
                <SQL dialect="generic">NVL(qty,0)</SQL>
          </MeasureExpression>
        </Measure>
        
    </Cube>
    
    <Cube name="Movie Analysis 2" defaultMeasure="Sales">
        <Table name="movie_tickets"/>        
        <!-- Year-Month -->
        <DimensionUsage name='GenericDate'        foreignKey='fecha'    source='GenericDate'   />                                                                              
        <!-- Movies -->                                                      
        <DimensionUsage name="Movies"             foreignKey="movie_code"  source="Movies"       />
        
        <Measure name="Sales"   column="price"         aggregator="sum" formatString="#,###.00">
            <MeasureExpression>
                <SQL dialect="generic">NVL(price,0)</SQL> <!-- NVL(..,0) replaces the NULL values for 0s -->
          </MeasureExpression>
        </Measure>
        
    </Cube>
</Schema>

This schema contains 2 different cubes: Movie Analysis and Movie Analysis 2. The First Cube, Movie Analysis, has 3 dimensions:

  1. GenericDate
  2. Movies
  3. Actors
And 2 measures:
  1. Sales
  2. Quantity

The second cube, Movie Analysis 2, has 2 dimensions:
  1. GenericDate
  2. Movies
And only 1 measure:
  1. Quantity


  • The dimensions have been defined before the creation of each cube, in the schema, so both cubes can share them. But also it exists the option, of defining the dimensions inside each cube, where the measures are defined. However, this way dimensions are particular for the cube where they are defined, so they are not shared.
  • Every measure has a name, a column in the original table and an aggregator. The aggregator is usually sum, as appreciated in the example. However, count, min, max, avg, and distinct-count also are allowed; distinct-count has some limitation if the cube contains father-son hierarchies.

    The attribute for the data type can have different values: String, Integer, Numeric, Boolean, Date, Time, and Timestamp. The default value is Numeric, except for count and distinct-count that are Integer.

    An optional attribute can specify how the value is shown. Like in the example, we can specify the sales units to be shown with 2 decimals, and, on the other hand, the quantity units to be shown with no decimals.

  • It has been defined a dimension, GenericDate, with 5 different hierarchies; where you can find different options of time selection. The values of the dimension are taken from the columns, of a time period table created named: gdwh_cal_day.

    Therefore, the dimension Movies contains two hierarchies. Both consist in two joined tables, so that the names of the directors and categories can be observed.

    For the last dimension defined, Actors, it is based in a simple hierarchy. The values are taken from the columns, of the union of three tables: movie,movie_actor and actor. In this way, we are able to get all the information of the actors that participate in each movie.


Using this schema we obtain the following cube analysis: