Uploaded image for project: 'Hibernate ORM'
  1. HHH-6054

Support for discriminator-based multi-tenancy

    Details

    • Last commented by a user?:
      true
    • Sprint:

      Description

      Follow up on HHH-5697 Closed to add support for discriminator based set ups.

      Considerations:

      1. What is the design of this in the metadata?
        1. At minimum we need to know the column to use for discrimination.
        2. Personally believe this should not be a attribute/property based. Should just name a column to use.
      2. We really should discover up front whether a SessionFactory contains any tenant data and require tenant identifier to be set in these cases.
        1. Explicit. The user passes us something saying that the SessionFactory involves multi tenancy
        2. Implied. Checking the connection provider (based on current split there) can indicate schema-based multi-tenancy. Checking all entities can imply the same for discriminator-based
        3. May need a way to allow user to tell us which approach to use. That might be the explicit option.
      3. Insert statements need to be altered to include the tenant identifier
      4. All selects need to be altered to add predicate condition based on tenant identifier.
        1. Allow switch to say whether this is done as a literal versus done as a JDBC parameter. This has been requested couple of times in regards filters as well to deal with database partitions and database query optimizers that need the partition value to be a literal.

      All persistence context and second level cache related keys are already handled in the first phase.

        Attachments

          Issue links

            Activity

              People

              • Votes:
                73 Vote for this issue
                Watchers:
                76 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - Not Specified
                  Not Specified
                  Logged:
                  Time Spent - 6h 22m
                  6h 22m