From b7d384c6347fb54746e255adfc4980c57bc401cc Mon Sep 17 00:00:00 2001 From: Simon Danner Date: Fri, 20 Mar 2020 23:41:54 +0100 Subject: [PATCH] Added @PersistAsBaseType to support persistent base/abstract bean container types --- .idea/codeStyles/Project.xml | 11 +- .../java/de/adito/ojcms/beans/OJBean.java | 19 +- .../literals/fields/types/AbstractField.java | 49 ++-- .../persistence/OJPersistenceException.java | 3 +- .../de/adito/ojcms/persistence/Persist.java | 9 +- .../ojcms/persistence/PersistAsBaseType.java | 32 +++ .../datasource/AbstractBeanContent.java | 19 +- .../datasource/BeanContentForContainer.java | 40 ++- .../datasource/BeanPersistenceUtil.java | 25 +- .../datasource/BeanProducerExtension.java | 212 +++++++++++++--- .../datasource/ContainerContent.java | 69 +++-- .../datasource/SingleBeanContent.java | 8 +- .../datasource/StartupBeanRegistration.java | 2 + .../ojcms/persistence/BeanLoaderForTest.java | 38 ++- .../ojcms/persistence/BeanStorageForTest.java | 12 +- .../adito/ojcms/persistence/BeanTestData.java | 32 +-- .../PersistentBaseContainerTest.java | 136 ++++++++++ .../persistence/PersistentContainerTest.java | 48 ++-- .../persistence/PersistentSingleBeanTest.java | 2 +- ...Beans.java => RegisteredBeansForTest.java} | 30 ++- .../cleanup/ObsoleteTableCleanup.java | 4 +- .../model/BaseContainerPersistenceModel.java | 135 ++++++++++ .../model/ContainerPersistenceModel.java | 235 ++++++++++++------ .../datasource/model/PersistenceModels.java | 23 ++ .../model/column/BeanColumnDefinition.java | 27 +- .../persistence/SQLBeanDataLoader.java | 7 + .../persistence/SQLBeanDataStorage.java | 14 +- .../datasource/util/DatabaseConstants.java | 1 + .../model/AbstractDatabaseTest.java | 57 ++++- .../BaseContainerPersistenceModelTest.java | 81 ++++++ .../model/ContainerPersistenceModelTest.java | 5 +- .../transactions/ManagedTransaction.java | 30 ++- .../transactions/TransactionalChanges.java | 124 ++++----- .../ojcms/transactions/api/BeanAddition.java | 79 ++++++ .../ojcms/transactions/api/ITransaction.java | 15 +- .../transactions/api/PersistentBeanData.java | 8 +- .../transactions/spi/IBeanDataLoader.java | 10 + .../transactions/spi/IBeanDataStorage.java | 14 +- .../transactions/BeanTransactionTest.java | 46 +++- 39 files changed, 1376 insertions(+), 335 deletions(-) create mode 100644 ojcms-persistence/src/main/java/de/adito/ojcms/persistence/PersistAsBaseType.java create mode 100644 ojcms-persistence/src/test/java/de/adito/ojcms/persistence/PersistentBaseContainerTest.java rename ojcms-persistence/src/test/java/de/adito/ojcms/persistence/{RegisteredBeans.java => RegisteredBeansForTest.java} (68%) create mode 100644 ojcms-sqldatasource/src/main/java/de/adito/ojcms/sql/datasource/model/BaseContainerPersistenceModel.java create mode 100644 ojcms-sqldatasource/src/test/java/de/adito/ojcms/sql/datasource/model/BaseContainerPersistenceModelTest.java create mode 100644 ojcms-transactions/src/main/java/de/adito/ojcms/transactions/api/BeanAddition.java diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index 74761e0..1b44fdc 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -53,17 +53,26 @@ +