Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix problem with tenantId part of Composite identifier (#451)
* Fix problem with tenantId part of Composite identifier Fixes #450 * add multitenant with composite Co-authored-by: Sergio del Amo <sergio.delamo@softamo.com>
- Loading branch information
Showing
3 changed files
with
21 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
examples/test-data-service/grails-app/domain/example/MultitenantBook.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package example | ||
|
||
import grails.gorm.MultiTenant | ||
|
||
// Issue: https://github.com/grails/gorm-hibernate5/issues/450 | ||
// Pr: https://github.com/grails/gorm-hibernate5/pull/451 | ||
class MultitenantBook implements MultiTenant<MultitenantBook>, Serializable { | ||
String id | ||
String tenantId | ||
String title | ||
|
||
static mapping = { | ||
id composite: ['id', 'tenantId'] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters