borinquenkid commented on code in PR #15568:
URL: https://github.com/apache/grails-core/pull/15568#discussion_r3439412622


##########
grails-data-hibernate7/README.md:
##########
@@ -0,0 +1,114 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+    https://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->

Review Comment:
   Fixed — the duplicate license header was removed in a subsequent commit. The 
file now has a single ASF license header.



##########
grails-data-hibernate5/core/src/test/groovy/grails/gorm/specs/multitenancy/MultiTenancyBidirectionalManyToManySpec.groovy:
##########
@@ -58,14 +57,17 @@ class MultiTenancyBidirectionalManyToManySpec extends 
Specification {
 
     @Shared @AutoCleanup HibernateDatastore datastore
 
-
-    void setup() {
+    void setupSpec() {
         System.setProperty(SystemPropertyTenantResolver.PROPERTY_NAME, "oci")
         datastore = new 
HibernateDatastore(DatastoreUtils.createPropertyResolver(config), 
getClass().getPackage() )
         departmentService = datastore.getService(DepartmentService)
         userService = datastore.getService(UserService)
     }
 
+    void setup() {
+        System.setProperty(SystemPropertyTenantResolver.PROPERTY_NAME, "oci")

Review Comment:
   The H7 `MultiTenancyBidirectionalManyToManySpec` already uses 
`@RestoreSystemProperties` at the class level. The H5 version of this file was 
not changed in this PR.



##########
grails-data-hibernate5/core/src/test/groovy/grails/gorm/specs/multitenancy/MultiTenancyUnidirectionalOneToManySpec.groovy:
##########
@@ -48,7 +51,13 @@ class MultiTenancyUnidirectionalOneToManySpec extends 
Specification {
                 'hibernate.hbm2ddl.auto'                      : 'create',
         ]
 
-        HibernateDatastore datastore = new 
HibernateDatastore(DatastoreUtils.createPropertyResolver(config), 
getClass().getPackage())
+        datastore = new 
HibernateDatastore(DatastoreUtils.createPropertyResolver(config), 
getClass().getPackage())
+    }
+
+    @Issue('https://github.com/apache/grails-data-mapping/issues/954')
+    void "test multi-tenancy with unidirectional one-to-many"() {
+        given: "A configuration for schema based multi-tenancy"
+        System.setProperty(SystemPropertyTenantResolver.PROPERTY_NAME, "")

Review Comment:
   The H7 `MultiTenancyUnidirectionalOneToManySpec` already uses 
`@RestoreSystemProperties` at the class level. The H5 version of this file was 
not changed in this PR.



##########
grails-data-hibernate5/core/src/test/groovy/org/grails/orm/hibernate/connections/SchemaMultiTenantSpec.groovy:
##########
@@ -57,7 +58,13 @@ class SchemaMultiTenantSpec extends Specification {
                 'hibernate.hbm2ddl.auto': 'create',
         ]
 
-        HibernateDatastore datastore = new 
HibernateDatastore(DatastoreUtils.createPropertyResolver(config), 
SingleTenantAuthor )
+        datastore = new 
HibernateDatastore(DatastoreUtils.createPropertyResolver(config), 
SingleTenantAuthor )
+    }
+
+    void "Test a database per tenant multi tenancy"() {
+        given:"A configuration for multiple data sources"
+        System.setProperty(SystemPropertyTenantResolver.PROPERTY_NAME, "")

Review Comment:
   This file (`SchemaMultiTenantSpec.groovy`) has no changes in the current 
branch — the comment references an earlier intermediate commit that was 
subsequently reverted.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to