Skip to content

Conversation

@chernser
Copy link
Contributor

Summary

Adds a simple demonstration of using ClickHouse JDBC driver with JPA.

Checklist

Delete items not relevant to your PR:

  • Closes #
  • Unit and integration tests covering the common scenarios were added
  • A human-readable description of the changes was provided to include in CHANGELOG
  • For significant changes, documentation in https://github.com/ClickHouse/clickhouse-docs was updated with further explanations or tutorials
@chernser chernser requested review from Paultagoras and mzitnik April 11, 2025 17:48
@mshustov mshustov requested a review from Copilot April 14, 2025 07:40
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 8 out of 10 changed files in this pull request and generated 2 comments.

Files not reviewed (2)
  • examples/demo-service/build.gradle.kts: Language not supported
  • examples/demo-service/src/main/resources/application.properties: Language not supported
Comments suppressed due to low confidence (1)

examples/demo-service/src/main/java/com/clickhouse/demo_service/jpa/ClickHouseStringArrayType.java:37

  • [nitpick] Consider renaming the iteration variable 'i' to 'item' for improved clarity.
 for (Object i : (Object[]) array.getArray() ) { 
}

@Override
public boolean isMutable() {
Copy link

Copilot AI Apr 14, 2025

Choose a reason for hiding this comment

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

The isMutable() method returns false, yet deepCopy() creates a new modifiable ArrayList. Either mark the type as mutable or return an unmodifiable collection to maintain consistency.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

isMutable() relates to column of this type and so deepCopy() is not linked here. However you might be correct that column should be treated as mutable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This should stay false to mark value as immutable just for safety. Wrapping with Collections.unmodifiableList() will add performance overhead.

Comment on lines 4 to 5
This is and example of a Spring Boot service using ClickHouse client directly and via JPA.
Example is an application that requires ClickHouse DB running externally. It can be a Docker or
Copy link

Copilot AI Apr 14, 2025

Choose a reason for hiding this comment

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

Typographical error: 'and example' should be corrected to 'an example'.

Suggested change
This is and example of a Spring Boot service using ClickHouse client directly and via JPA.
Example is an application that requires ClickHouse DB running externally. It can be a Docker or
This is an example of a Spring Boot service using ClickHouse client directly and via JPA.
Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do.

@mshustov mshustov added this to the 0.8.4 milestone Apr 14, 2025
@chernser chernser merged commit 3dde2a0 into main Apr 14, 2025
25 checks passed
@chernser chernser deleted the jpa_example branch April 14, 2025 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants