Project

General

Profile

Actions

feature request #8464

open

Make AuthorityBases unique

Added by Andreas Müller over 2 years ago. Updated over 1 year ago.

Status:
New
Priority:
New
Category:
cdm
Target version:
Start date:
08/14/2019
Due date:
% Done:

0%

Estimated time:
Severity:
normal
Tags:

Description

The old GrantedAuthorityImpl.authority was unique and NotNull. This was forgotten to implement when implementing CdmAuthority and Role (AuthorityBase) in #7099.
Needs to be done or to be discussed (see #4922).

Maybe also #7100 needs to be considered.

https://dev.e-taxonomy.eu/redmine/projects/edit/wiki/WorkshopRightsAndRoles2017-11


Related issues

Related to Edit - task #7100: Split CdmAuthority into operations and filtersNewAndreas Müller11/30/2017

Actions
Related to Edit - feature request #4922: GrantedAuthorities not reusable anymoreNewAndreas Müller05/21/2015

Actions
Related to Edit - bug #9058: Hibernate loggs error when creating schema on MySQL due to failing index creationClosedAndreas Müller06/09/2020

Actions
Copied from Edit - task #7099: Make CdmAuthority a persistable classClosedAndreas Müller11/30/2017

Actions
Actions #1

Updated by Andreas Müller over 2 years ago

  • Copied from task #7099: Make CdmAuthority a persistable class added
Actions #2

Updated by Andreas Müller over 2 years ago

  • Related to task #7100: Split CdmAuthority into operations and filters added
Actions #3

Updated by Andreas Müller over 2 years ago

Actions #4

Updated by Andreas Müller over 2 years ago

  • Tags set to permission
Actions #5

Updated by Andreas Müller over 2 years ago

  • Target version changed from CDM UML 5.15 to CDM UML 5.8
Actions #6

Updated by Andreas Müller over 2 years ago

  • Target version changed from CDM UML 5.8 to CDM UML 5.15

This seems to be more difficult then I thought.

In general hibernate allows the ,uniqueConstraints=@UniqueConstraint(columnNames={"xxx"})" attribute on java.persistence.Table. This also works on ordinary tables with multiple columns (I tested on FeatureState).

But CdmAuthority uses the table from the base class AuthorityBase. Therefore it uniqueConstraints needs to be defined there. This also works if only 1 column is defined. It does not work with multiple columnNames for some reason. I also tried to remove all other constraints with no effect.

This requires further investigation.

Actions #7

Updated by Andreas Müller over 1 year ago

Maybe this is a simple index size problem. During an import I got

20:20:05,140 ERROR SchemaExport:484 - HHH000389: Unsuccessful: alter table Authority add constraint UKr4d50pph1jg53wdxl7pxp8bmp unique (property, permissionClass, targetUuid, operations)
20:20:05,140 ERROR SchemaExport:485 - Specified key was too long; max key length is 1000 bytes

We need to try if with smaller column sizes it works.

Actions #8

Updated by Andreas Müller over 1 year ago

  • Related to bug #9058: Hibernate loggs error when creating schema on MySQL due to failing index creation added
Actions #9

Updated by Andreas Müller over 1 year ago

In #9058 a very similar problem was solved. For doing the same thing for this index (which is a unique index not a simple index as in #9058) will require to

  • reduce the size of the columns to the required size (maybe we can also reduce the key's size for the enumerations)
  • define a new uniqueIndexExporter with prefix indexing as in #9058 for multiple columns if the size is still too large

Needs discussion on what the better solution is.

Actions #10

Updated by Andreas Müller over 1 year ago

  • Target version changed from CDM UML 5.15 to CDM UML 5.29
Actions

Also available in: Atom PDF