...
MariaDB [controlloop]> SHOW CREATE TABLE JpaExampleMap_ATTRIBUTES;
+--------------------------+----------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+--------------------------+----------------------------------------------------------------------------------------------------------+
| JpaExampleMap_ATTRIBUTES | CREATE TABLE `JpaExampleMap_ATTRIBUTES` (
`name` varchar(120) DEFAULT NULL,
`version` varchar(20) DEFAULT NULL,
`ATTRIBUTES` longtext DEFAULT NULL,
`ATTRIBUTES_KEY` varchar(255) DEFAULT NULL,
KEY `FK_JpaExampleMap_ATTRIBUTES_name` (`name`,`version`),
CONSTRAINT `FK_JpaExampleMap_ATTRIBUTES_name` FOREIGN KEY (`name`, `version`)
REFERENCES `ExampleMap` (`name`, `version`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 |
+--------------------------+----------------------------------------------------------------------------------------------------------+
...
MariaDB [controlloop]> SHOW CREATE TABLE JpaExampleMap_ATTRIBUTES;
+--------------------------+----------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+--------------------------+----------------------------------------------------------------------------------------------------------+
| JpaExampleMap_ATTRIBUTES | CREATE TABLE `JpaExampleMap_ATTRIBUTES` (
`name` varchar(120) NOT NULL,
`version` varchar(20) NOT NULL,
`attributes` longtext DEFAULT NULL,
`attributes_KEY` varchar(255) NOT NULL,
PRIMARY KEY (`name`,`version`,`attributes_KEY`),
CONSTRAINT `FKrwvpo54nao070vsy5p23xnps7` FOREIGN KEY (`name`, `version`)
REFERENCES `ExampleMap` (`name`, `version`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 |
+--------------------------+ |
+--------------------------+----------------------------------------------------------------------------------------------------------+
JpaToscaCapabilityAssignment_ATTRIBUTES table
...
MariaDB [controlloop]> SHOW CREATE TABLE JpaToscaCapabilityAssignment_ATTRIBUTES;
+-----------------------------------------+-------------------------------------------------------------------------------------------+
| Table | Create Table |
+-----------------------------------------+-------------------------------------------------------------------------------------------+
| JpaToscaCapabilityAssignment_ATTRIBUTES | CREATE TABLE `JpaToscaCapabilityAssignment_ATTRIBUTES` (
`name` varchar(120) DEFAULT NULL,
`version` varchar(20) DEFAULT NULL,
`ATTRIBUTES` longtext DEFAULT NULL,
`ATTRIBUTES_KEY` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 |
+-----------------------------------------+-------------------------------------------------------------------------------------------+
...
MariaDB [controlloop]> SHOW CREATE TABLE JpaToscaCapabilityAssignment_ATTRIBUTES;
+-----------------------------------------+-------------------------------------------------------------------------------------------+
| Table | Create Table |
+-----------------------------------------+-------------------------------------------------------------------------------------------+
| JpaToscaCapabilityAssignment_ATTRIBUTES | CREATE TABLE `JpaToscaCapabilityAssignment_ATTRIBUTES` (
`name` varchar(120) NOT NULL,
`version` varchar(20) NOT NULL,
`attributes` longtext DEFAULT NULL,
`attributes_KEY` varchar(255) NOT NULL,
PRIMARY KEY (`name`,`version`,`attributes_KEY`),
CONSTRAINT `FKjuqj4nashp9jx76h5eh5psp7l` FOREIGN KEY (`name`, `version`)
REFERENCES `ToscaCapabilityAssignment` (`name`, `version`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 |
+-- |
+-----------------------------------------+-------------------------------------------------------------------------------------------+
...
MariaDB [controlloop]> SHOW CREATE TABLE ExampleObjMap_Example;
+-----------------------+-------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-----------------------+-------------------------------------------------------------------------------------------------------------+
| ExampleObjMap_Example | CREATE TABLE `ExampleObjMap_Example` (
`name` varchar(120) NOT NULL,
`version` varchar(20) NOT NULL,
`EXAMPLES_KEY` varchar(255) DEFAULT NULL,
PRIMARY KEY (`name`,`version`),
CONSTRAINT `FK_ExampleObjMap_Example_name` FOREIGN KEY (`name`, `version`)
REFERENCES `ExampleObjMap` (`name`, `version`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 |
+-----------------------+-------------------------------------------------------------------------------------------------------------+
...
MariaDB [controlloop]> SHOW CREATE TABLE ExampleObjMap_Example;
+-----------------------+-------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-----------------------+-------------------------------------------------------------------------------------------------------------+
| ExampleObjMap_Example | CREATE TABLE `ExampleObjMap_Example` (
`parent_name` varchar(120) NOT NULL,
`parent_version` varchar(20) NOT NULL,
`child_name` varchar(120) NOT NULL,
`child_version` varchar(20) NOT NULL,
`EXAMPLES_KEY` varchar(255) DEFAULT NULL,
PRIMARY KEY (`parent_name`,`parent_version`,`child_name`,`child_version`),
KEY `FK_ExampleObjMap_Example_child_name` (`child_name`,`child_version`),
CONSTRAINT `FK_ExampleObjMap_Example_child_name` FOREIGN KEY (`child_name`, `child_version`)
REFERENCES `Example` (`name`, `version`),
CONSTRAINT `FK_ExampleObjMap_Example_parent_name` FOREIGN KEY (`parent_name`, `parent_version`)
REFERENCES `ExampleObjMap` (`name`, `version`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 |
+ |
+-----------------------+-------------------------------------------------------------------------------------------------------------+
...
+-----------------------+-------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-----------------------+-------------------------------------------------------------------------------------------------------------+
| ExampleObjMap_Example | CREATE TABLE `ExampleObjMap_Example` (
`parent_name` varchar(120) NOT NULL,
`parent_version` varchar(20) NOT NULL,
`child_name` varchar(120) NOT NULL,
`child_version` varchar(20) NOT NULL,
`examples_KEY` varchar(255) NOT NULL,
PRIMARY KEY (`parent_name`,`parent_version`,`examples_KEY`),
UNIQUE KEY `UK_ma8t20i58tt5ilqjrk2ged242` (`child_name`,`child_version`),
CONSTRAINT `FK2n1x5g38x55wejkvnvhqin980` FOREIGN KEY (`parent_name`, `parent_version`)
REFERENCES `ExampleObjMap` (`name`, `version`),
CONSTRAINT `FKstwyuf69lrj4tjpafwriuwp3h` FOREIGN KEY (`child_name`, `child_version`)
REFERENCES `Example` (`name`, `version`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 |
+-----------------------+-- |
+-----------------------+-------------------------------------------------------------------------------------------------------------+
After saving the example:
...
MariaDB [controlloop]> SHOW CREATE TABLE JpaExampleObjMapEc_EXAMPLES;
+-----------------------------+-------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-----------------------------+-------------------------------------------------------------------------------------------------------+
| JpaExampleObjMapEc_EXAMPLES | CREATE TABLE `JpaExampleObjMapEc_EXAMPLES` (
|
+-----------------------------+-------------------------------------------------------------------------------------------------------+
| JpaExampleObjMapEc_EXAMPLES | CREATE TABLE `JpaExampleObjMapEc_EXAMPLES` (
`name` varchar(120) DEFAULT NULL,
`version` varchar(20) DEFAULT NULL,
`EXAMPLES` longblob DEFAULT NULL,
`EXAMPLES_KEY` varchar(255) DEFAULT NULL,
KEY `FK_JpaExampleObjMapEc_EXAMPLES_name` (`name`,`version`),
CONSTRAINT `FK_JpaExampleObjMapEc_EXAMPLES_name` FOREIGN KEY (`name`, `version`)
REFERENCES `ExampleObjMapEc` (`name`, `version`)
`name` varchar(120) DEFAULT NULL,
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 `version` varchar(20) DEFAULT NULL,
`EXAMPLES` longblob DEFAULT NULL,
`EXAMPLES_KEY` varchar(255) DEFAULT NULL,
KEY `FK_JpaExampleObjMapEc_EXAMPLES_name` (`name`,`version`),
CONSTRAINT `FK_JpaExampleObjMapEc_EXAMPLES_name` FOREIGN KEY (`name`, `version`)
REFERENCES `ExampleObjMapEc` (`name`, `version`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 |
|
+-----------------------------+-------------------------------------------------------------------------------------------------------+
After saving the example:
MariaDB [controlloop]> select * from ExampleObjMapEc;
+---------------+---------+
| name | version |
+---------------+---------+
| ExampleObjMap | 1.0.0 |
+---------------+---------+
MariaDB [controlloop]> select * from JpaExampleObjMapEc_EXAMPLES;
+--------------------+---------+---------------------------+---------------------+
| name | version | EXAMPLES | EXAMPLES_KEY |
+---------------+-------------+---------------------------+
After saving the example:
MariaDB [controlloop]> select * from ExampleObjMapEc;
+---------------+---------+
| name | version |
+----
| ExampleObjMap | 1.0.0 | .... <binary code> .... | MyKey1 |
| ExampleObjMap | 1.0.0 | .... <binary code> .... | MyKey2 |
+---------------+---------+
| ExampleObjMap | 1.0.0 |
+---------------------------+--------------+
Hibernate
MariaDB [controlloop]> select * from JpaExampleObjMapEc_EXAMPLESdescribe ExampleObjMapEc;
+---------+------+---------+------+-----+---------+-------+
| nameField | Type | version | EXAMPLES | Null | Key | Default | Extra |
+---------+--------------+------+-----+---------+-------+
| name | varchar(120) | NO | PRI | NULL | |
| version | varchar(20) | NO | PRI | NULL | |
+---------+--------------+------+-----+---------+-------+
MariaDB [controlloop]> SHOW CREATE TABLE JpaExampleObjMapEc_EXAMPLES;
+-----------------------------+-------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-----------------------------+-------------------------------------------------------------------------------------------------------+
| JpaExampleObjMapEc_EXAMPLES | CREATE TABLE `JpaExampleObjMapEc_EXAMPLES` (
`name` varchar(120) NOT NULL,
`version` varchar(20) NOT NULL,
`examples_name` varchar(120) NOT NULL,
`examples_version` varchar(20) NOT NULL,
`examples_KEY` varchar(255) NOT NULL,
PRIMARY KEY (`name`,`version`,`examples_KEY`),
UNIQUE KEY `UK_o5b5lwcueiue1x7wf2j9l0ohb` (`examples_name`,`examples_version`),
CONSTRAINT `FKeu2s8p9mhstus32uliuwib8rr` FOREIGN KEY (`name`, `version`)
REFERENCES `ExampleObjMapEc` (`name`, `version`),
CONSTRAINT `FKf66pkeal9tdygic4pvspxhph5` FOREIGN KEY (`examples_name`, `examples_version`)
REFERENCES `Example` (`name`, `version`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 |
+-----------------------------+-------------------------------------------------------------------------------------------------------+
After saving the example (it needs an extra step: save JpaExample objects before JpaExampleObjMapEc object):
MariaDB [controlloop]> select * from ExampleObjMapEc;
+-----------------+---------+
| name | version |
+-----------------+---------+
| ExampleObjMapEc | 1.0.0 |
+-----------------+---------+
MariaDB [controlloop]> select * from Example;
+----------+---------+--------+-----------+
| name | version | primed | timeStamp |
+----------+---------+--------+-----------+
| example1 | 1.0.0 | NULL | NULL |
| example2 | 1.0.0 | NULL | NULL |
+----------+---------+--------+-----------+
MariaDB [controlloop]> select * from JpaExampleObjMapEc_EXAMPLES;
+-----------------+---------+---------------+------------------+--------------+
| name | version | examples_name | examples_version | examples_KEY | EXAMPLES_KEY |
|
+-----------------+---------+------+---------+------------------+--------------+
| ExampleObjMapExampleObjMapEc | 1.0.0 | example1 | 1.... <binary code> .... 0.0 | MyKey1 |
| ExampleObjMapExampleObjMapEc | 1.0.0 | example2 | 1.... <binary code> .... 0.0 | MyKey2 |
+-----------------+---------+---------------+------------------+
...
--------------+