diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4dcc37d..2cdce97 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,6 +9,7 @@ https://keepachangelog.com/en/1.0.0/
https://www.markdownguide.org/basic-syntax/
* [Unreleased](#unreleased)
+* [0.3.1](#031---2024-03-07)
* [0.3.0](#030---2024-01-04)
* [0.2.2](#022---2023-08-08)
* [0.2.1](#021---2023-07-26)
@@ -18,6 +19,12 @@ https://www.markdownguide.org/basic-syntax/
## [Unreleased]
+## [0.3.1] - 2024-03-07
+
+### Changed
+
+- Upgraded posmulten dependency to 0.8.1 version [46](https://github.com/starnowski/posmulten-hibernate/issues/46)
+
## [0.3.0] - 2024-01-04
### Changed
diff --git a/README.md b/README.md
index 09b909b..49a9303 100644
--- a/README.md
+++ b/README.md
@@ -56,7 +56,7 @@ For Hibernate 5 add project to your pom.xml
com.github.starnowski.posmulten.hibernate
hibernate5
- 0.3.0
+ 0.3.1
@@ -72,7 +72,7 @@ For Hibernate 6 add project to your pom.xml
com.github.starnowski.posmulten.hibernate
hibernate6
- 0.3.0
+ 0.3.1
@@ -241,7 +241,7 @@ Besides that you need to add maven dependency as below:
com.github.starnowski.posmulten.configuration
configuration-yaml-interpreter
- 0.7.2
+ 0.8.1
test
```
diff --git a/hibernate6-functional-tests/pom.xml b/hibernate6-functional-tests/pom.xml
index 6caf6fc..50450e2 100644
--- a/hibernate6-functional-tests/pom.xml
+++ b/hibernate6-functional-tests/pom.xml
@@ -61,7 +61,7 @@
com.github.starnowski.posmulten.configuration
configuration-yaml-interpreter
- 0.7.2
+ 0.8.1
test
diff --git a/hibernate6-functional-tests/src/test/resources/import_nonforeignkeyconstraint.sql b/hibernate6-functional-tests/src/test/resources/import_nonforeignkeyconstraint.sql
index d249897..bede12a 100644
--- a/hibernate6-functional-tests/src/test/resources/import_nonforeignkeyconstraint.sql
+++ b/hibernate6-functional-tests/src/test/resources/import_nonforeignkeyconstraint.sql
@@ -2,6 +2,3 @@
GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA public TO "posmhib4-user";
--TODO Add option in builder component so that the correct access for grantee could be added.
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO "posmhib4-user";
-
--- This is required because hibernate does not creates foreign key constraint for JoinColumnsOrFormulas annotation
-ALTER TABLE posts_nonforeignkeyconstraint ADD CONSTRAINT fk_posts_users_author_manual_added FOREIGN KEY (user_id, tenant_id) REFERENCES user_info_nonforeignkeyconstraint(user_id, tenant);
\ No newline at end of file
diff --git a/hibernate6-functional-tests/src/test/resources/integration-tests-configuration-nonforeignkeyconstraint.yaml b/hibernate6-functional-tests/src/test/resources/integration-tests-configuration-nonforeignkeyconstraint.yaml
index 1484d54..a806c3c 100644
--- a/hibernate6-functional-tests/src/test/resources/integration-tests-configuration-nonforeignkeyconstraint.yaml
+++ b/hibernate6-functional-tests/src/test/resources/integration-tests-configuration-nonforeignkeyconstraint.yaml
@@ -9,6 +9,7 @@ force_row_level_security_for_table_owner: false
default_tenant_id_column: "tenant_id"
grantee: "{{template_user_grantee}}"
set_current_tenant_identifier_as_default_value_for_tenant_column_in_all_tables: true
+create_foreignkey_constraint_with_tenant_column: true
valid_tenant_value_constraint:
is_tenant_valid_function_name: is_t_valid
is_tenant_valid_constraint_name: "is_tenant_valid_constraint_sdfa"
@@ -25,7 +26,6 @@ tables:
name_for_function_that_checks_if_record_exists_in_table: "is_user_exists"
pk_columns_name_to_type:
user_id: uuid
- tenant: "VARCHAR(255)"
- name: user_role_nonforeignkeyconstraint
rls_policy:
name: "user_role_table_rls_policy"
@@ -35,7 +35,6 @@ tables:
name_for_function_that_checks_if_record_exists_in_table: "is_user_role_exists"
pk_columns_name_to_type:
id: bigint
- tenant: "VARCHAR(255)"
- name: posts_nonforeignkeyconstraint
rls_policy:
name: "posts_table_rls_policy"
@@ -44,8 +43,12 @@ tables:
primary_key_definition:
name_for_function_that_checks_if_record_exists_in_table: "is_posts_exists"
pk_columns_name_to_type:
- id: bigint
- tenant_id: "VARCHAR(255)"
+ key: bigint
+ foreign_keys:
+ - constraint_name: "user_info_tenant_constraint"
+ table_name: user_info_nonforeignkeyconstraint
+ foreign_key_primary_key_columns_mappings:
+ user_id: user_id
- name: comments_nonforeignkeyconstraint
rls_policy:
name: "comments_table_rls_policy"
@@ -55,7 +58,15 @@ tables:
name_for_function_that_checks_if_record_exists_in_table: "is_comments_exists"
pk_columns_name_to_type:
id: bigint
- comment_tenant_id: "VARCHAR(255)"
+ foreign_keys:
+ - constraint_name: "user_info_tenant_constraint"
+ table_name: user_info_nonforeignkeyconstraint
+ foreign_key_primary_key_columns_mappings:
+ user_id: user_id
+ - constraint_name: "posts_tenant_constraint"
+ table_name: posts_nonforeignkeyconstraint
+ foreign_key_primary_key_columns_mappings:
+ post_id: key
- name: categories_nonforeignkeyconstraint
rls_policy:
name: "categories_table_rls_policy"
@@ -64,19 +75,37 @@ tables:
name_for_function_that_checks_if_record_exists_in_table: "is_categories_exists"
pk_columns_name_to_type:
id: bigint
- categorytenantid: "VARCHAR(255)"
- name: posts_categories_nonforeignkeyconstraint
rls_policy:
name: "posts_categories_table_rls_policy"
create_tenant_column_for_table: true
+ foreign_keys:
+ - constraint_name: "posts_tenant_constraint"
+ table_name: "posts_nonforeignkeyconstraint"
+ foreign_key_primary_key_columns_mappings:
+ posts_key: key
+ - constraint_name: "categories_tenant_constraint"
+ table_name: "categories_nonforeignkeyconstraint"
+ foreign_key_primary_key_columns_mappings:
+ categories_id: id
- name: categories_category_types
rls_policy:
name: "categories_category_types_table_rls_policy"
create_tenant_column_for_table: true
+ foreign_keys:
+ - constraint_name: "categories_tenant_constraint"
+ table_name: "categories_nonforeignkeyconstraint"
+ foreign_key_primary_key_columns_mappings:
+ Category_id: id
- name: posts_category_types
rls_policy:
name: "posts_category_types_table_rls_policy"
create_tenant_column_for_table: true
+ foreign_keys:
+ - constraint_name: "posts_tenant_constraint"
+ table_name: "posts_nonforeignkeyconstraint"
+ foreign_key_primary_key_columns_mappings:
+ post_id: key
sql_definitions_validation:
identifier_max_length: 30
identifier_min_length: 5
diff --git a/pom.xml b/pom.xml
index 163fb48..88eaa1a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -19,7 +19,7 @@
5.6.3.Final
- 0.7.2
+ 0.8.1
1.18.28
2.4.12
1.1-groovy-2.4