Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions docs/modules/ROOT/pages/servlet/appendix/database-schema.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,33 @@ BEGIN
END;
----

[[dbschema-acl-class-id-type]]
=== UUID and String Object Identities
By default, the ACL module expects the identifier of a domain object (`object_id_identity`) to be a `Long`.
To use non-Long identifiers, such as `UUID` or `String`, add the optional `class_id_type` column to the `acl_class` table:

[source,ddl]
----
create table acl_class(
id bigint generated by default as identity(start with 100) not null primary key,
class varchar_ignorecase(100) not null,
class_id_type varchar_ignorecase(100),
constraint unique_uk_2 unique(class)
);
----

The column stores the fully qualified class name of the identifier type, such as `java.util.UUID`.
Since reading and writing this column is disabled by default, you must also enable it on both `BasicLookupStrategy` and `JdbcMutableAclService`:

[source,java]
----
basicLookupStrategy.setAclClassIdSupported(true);
jdbcMutableAclService.setAclClassIdSupported(true);
----

The ACL artifact JAR contains a complete HyperSQL schema with this column in the `createAclSchemaWithAclClassIdType.sql` file.
For other databases, add the `class_id_type` column to the corresponding `acl_class` definition shown in the preceding sections.

[[dbschema-oauth2-client]]
== OAuth 2.0 Client Schema
The JDBC implementation of xref:servlet/oauth2/client/core.adoc#oauth2Client-authorized-repo-service[ `OAuth2AuthorizedClientService`] (`JdbcOAuth2AuthorizedClientService`) requires a table for persisting `OAuth2AuthorizedClient` instances.
Expand Down