Skip to content

HHH-17767 - Add support for Value LOBs#12152

Open
loiclefevre wants to merge 1 commit intohibernate:7.4from
loiclefevre:HHH-17767
Open

HHH-17767 - Add support for Value LOBs#12152
loiclefevre wants to merge 1 commit intohibernate:7.4from
loiclefevre:HHH-17767

Conversation

@loiclefevre
Copy link
Copy Markdown
Collaborator

@loiclefevre loiclefevre commented Apr 10, 2026

This PR adds the support for VALUE LOBs for Oracle database 26ai. This is a performance improvement that lets LOB columns be defined as VALUE LOBs starting with 26ai.

Documentation: https://docs.oracle.com/en/database/oracle/oracle-database/26/adlob/value-based-LOBs.html


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license
and can be relicensed under the terms of the LGPL v2.1 license in the future at the maintainers' discretion.
For more information on licensing, please check here.



Please make sure that the following tasks are completed:
Tasks specific to HHH-17767 (Improvement):

  • Add tests for feature/improvement
  • Update documentation as relevant: javadoc for changed API, documentation/src/main/asciidoc/userguide for all features, documentation/src/main/asciidoc/introduction for main features, links from existing documentation
  • Add entries as relevant to migration-guide.adoc (breaking changes) and whats-new.adoc (new features/improvements)

https://hibernate.atlassian.net/browse/HHH-17767

@sonarqubecloud
Copy link
Copy Markdown

Comment on lines +87 to +88
if( database.getDialect().supportsValueLOBAccess() ) {
return database.getDialect().getValueLOBFragmentForExtraCreateTableInfo(columnName);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Shouldn't you also ensure that the JavaType is a non-blob?

Suggested change
if( database.getDialect().supportsValueLOBAccess() ) {
return database.getDialect().getValueLOBFragmentForExtraCreateTableInfo(columnName);
if ( javaType.getJavaTypeClass() != Blob.class && database.getDialect().supportsValueLOBAccess() ) {
return database.getDialect().getValueLOBFragmentForExtraCreateTableInfo( columnName );

Comment on lines +83 to +84
if( database.getDialect().supportsValueLOBAccess() ) {
return database.getDialect().getValueLOBFragmentForExtraCreateTableInfo(columnName);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Shouldn't you also ensure that the JavaType is a non-clob?

Suggested change
if( database.getDialect().supportsValueLOBAccess() ) {
return database.getDialect().getValueLOBFragmentForExtraCreateTableInfo(columnName);
if ( javaType.getJavaTypeClass() != Clob.class && database.getDialect().supportsValueLOBAccess() ) {
return database.getDialect().getValueLOBFragmentForExtraCreateTableInfo( columnName );

Comment on lines +90 to +91
if( database.getDialect().supportsValueLOBAccess() ) {
return database.getDialect().getValueLOBFragmentForExtraCreateTableInfo(columnName);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Shouldn't you also ensure that the JavaType is a non-clob?

Suggested change
if( database.getDialect().supportsValueLOBAccess() ) {
return database.getDialect().getValueLOBFragmentForExtraCreateTableInfo(columnName);
if ( javaType.getJavaTypeClass() != Clob.class && javaType.getJavaTypeClass() != NClob.class && database.getDialect().supportsValueLOBAccess() ) {
return database.getDialect().getValueLOBFragmentForExtraCreateTableInfo( columnName );


@Override
public String getValueLOBFragmentForExtraCreateTableInfo(String columnName) {
return "\nlob(" + columnName + ") query as value";
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
return "\nlob(" + columnName + ") query as value";
return " lob(" + columnName + ") query as value";

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.

2 participants