Skip to content

Add support for the UUID type - #23

Merged
ThoSap merged 2 commits into
mainfrom
support-uuid
Jul 9, 2025
Merged

Add support for the UUID type#23
ThoSap merged 2 commits into
mainfrom
support-uuid

Conversation

@ThoSap

@ThoSap ThoSap commented Jul 9, 2025

Copy link
Copy Markdown
Member

This adds support for using a WrappedUUIDJavaType ID, as well as for using it with Jackson and the OpenAPI document.

@ThoSap
ThoSap requested review from Copilot and mmalfertheiner July 9, 2025 10:00
@ThoSap ThoSap self-assigned this Jul 9, 2025

This comment was marked as outdated.

Comment on lines -94 to +95
property.format("int64");
property.format("");

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A BigDecimal can be bigger than int64, therefore I removed the format here.
https://swagger.io/docs/specification/v3_0/data-models/data-types/#numbers

Comment on lines +152 to +153
property.type("string");
property.format("uuid");

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The OpenAPI specification has a built-in format for UUID, see https://swagger.io/docs/specification/v3_0/data-models/data-types/#strings

@ThoSap
ThoSap requested a review from Copilot July 9, 2025 11:40

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds end-to-end support for UUID types—both raw and wrapped—in persistence, JSON binding, MVC endpoints, and OpenAPI docs.

  • Extended DB changelogs with uuid and uuid_as_string columns.
  • Introduced WrappedUUIDJavaType and associated wrapper types, JPA mappings, converters, and tests.
  • Updated MVC controllers, Jackson deserializer, property editor, and Swagger customizers to handle UUID.

Reviewed Changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/test/resources/db/changelog/2024-09-06-create-wrapper-type-testing-table.yml Added uuid_value / uuid_value_as_string
src/test/resources/db/changelog/2024-09-06-create-custom-type-testing-table.yml Added uuid / uuid_as_string columns
src/test/java/it/aboutbits/.../TupleTransformerTest.java Updated tuple transformer tests for UUID
src/test/java/it/aboutbits/.../WrapUUIDRecord.java New UUID record wrapper
src/test/java/it/aboutbits/.../WrapUUIDClass.java New UUID class wrapper
src/test/java/it/aboutbits/.../WrapperTypesModelRepository.java Added findBy methods for UUID wrappers
src/test/java/it/aboutbits/.../WrapperTypesModel.java Added wrapped-UUID fields with Java/Jdbc types
src/test/java/it/aboutbits/.../WrapUUIDRecordJavaType.java JavaType for WrapUUIDRecord
src/test/java/it/aboutbits/.../WrapUUIDClassJavaType.java JavaType for WrapUUIDClass
src/test/java/it/aboutbits/.../WrapperTypesJpaTest.java JPA tests for wrapped-UUID behavior
src/test/java/it/aboutbits/.../CustomTypeTestModelRepository.java Added findByUuid methods
src/test/java/it/aboutbits/.../CustomTypeTestModel.java Added raw UUID fields and converter
src/test/java/it/aboutbits/.../CustomTypeJpaTest.java Tests for raw UUID persistence
src/test/java/it/aboutbits/.../CustomTypeTestController.java MVC endpoints for UUID path/param/body
src/test/java/it/aboutbits/.../BodyWithUUID.java New request body type for UUID
src/test/java/it/aboutbits/.../CustomTypeBindingsForControllerTest.java Controller tests for UUID binding
src/main/java/it/aboutbits/.../CustomTypePropertyEditor.java Added UUID parsing support
src/main/java/it/aboutbits/.../CustomTypePropertyCustomizer.java Extended OpenAPI schema for UUID
src/main/java/it/aboutbits/.../CustomTypeModelConverter.java Model conversion for UUID type
src/main/java/it/aboutbits/.../WrappedUUIDJavaType.java Base Hibernate type for wrapped-UUID
src/main/java/it/aboutbits/.../UUIDConverter.java JPA AttributeConverter for UUID ↔ String
src/main/java/it/aboutbits/.../CustomTypeDeserializer.java Jackson deserializer for UUID
Comments suppressed due to low confidence (1)

src/test/java/it/aboutbits/springboot/toolbox/persistence/transformer/TupleTransformerTest.java:194

  • List does not have a getFirst() method; use result.dataRecords.get(0) or switch to a Deque if you need getFirst() behavior.
        var firstRecord = result.dataRecords.getFirst();

@ThoSap
ThoSap merged commit 7b532ea into main Jul 9, 2025
@ThoSap
ThoSap deleted the support-uuid branch July 9, 2025 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants