Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HHH-17375 HQL syntax sugar for array operations #8330

Merged
merged 10 commits into from May 13, 2024
Merged

Conversation

beikov
Copy link
Contributor

@beikov beikov commented May 7, 2024

@gavinking
Copy link
Member

Nice!

Class<?> javaTypeClass = jdbcMapping.getJavaTypeDescriptor().getJavaTypeClass();
if ( javaTypeClass == Boolean.class ) {
// BooleanJavaType has this as an implicit conversion
return Integer.parseInt( string, start, end, 10 ) == 1;

Check notice

Code scanning / CodeQL

Missing catch of NumberFormatException Note

Potential uncaught 'java.lang.NumberFormatException'.
return Integer.parseInt( string, start, end, 10 ) == 1;
}
if ( javaTypeClass.isEnum() ) {
return javaTypeClass.getEnumConstants()[Integer.parseInt( string, start, end, 10 )];

Check notice

Code scanning / CodeQL

Missing catch of NumberFormatException Note

Potential uncaught 'java.lang.NumberFormatException'.
Comment on lines 74 to 76
throw new SemanticException(
"Oracle array_agg emulation requires a basic plural return type, but resolved return type was: " + returnType
);

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note

Invoking
SemanticException.SemanticException
should be avoided because it has been deprecated.
@@ -125,4 +161,8 @@

return new String[] { buf.toString() };
}

public String[] getSqlDropStrings(UserDefinedArrayType userDefinedType, Metadata metadata, SqlStringGenerationContext context) {

Check notice

Code scanning / CodeQL

Useless parameter Note

The parameter 'metadata' is never used.
}
}

public String[] getSqlDropStrings(UserDefinedObjectType userDefinedType, Metadata metadata, SqlStringGenerationContext context) {

Check notice

Code scanning / CodeQL

Useless parameter Note

The parameter 'metadata' is never used.
}
}

public String[] getSqlDropStrings(UserDefinedObjectType userDefinedType, Metadata metadata, SqlStringGenerationContext context) {

Check notice

Code scanning / CodeQL

Confusing overloading of methods Note

Method StandardUserDefinedTypeExporter.getSqlDropStrings(..) could be confused with overloaded method
getSqlDropStrings
, since dispatch depends on static types.
@@ -82,12 +99,19 @@
}
}

public String[] getSqlCreateStrings(

Check notice

Code scanning / CodeQL

Confusing overloading of methods Note

Method StandardUserDefinedTypeExporter.getSqlCreateStrings(..) could be confused with overloaded method
getSqlCreateStrings
, since dispatch depends on static types.
}
}

public String[] getSqlCreateStrings(

Check notice

Code scanning / CodeQL

Confusing overloading of methods Note

Method StandardUserDefinedTypeExporter.getSqlCreateStrings(..) could be confused with overloaded method
getSqlCreateStrings
, since dispatch depends on static types.
import org.hibernate.type.spi.TypeConfiguration;

/**
* @author Christian Beikov
*/
public class StructJdbcType implements AggregateJdbcType {
public class StructJdbcType implements org.hibernate.type.descriptor.jdbc.StructJdbcType {

Check notice

Code scanning / CodeQL

Class has same name as super class Note

StructJdbcType has the same name as its supertype
org.hibernate.type.descriptor.jdbc.StructJdbcType
.
}

@Override
public boolean equals(Object object) {

Check notice

Code scanning / CodeQL

Confusing overloading of methods Note

Method AbstractUserDefinedType.equals(..) could be confused with overloaded method
equals
, since dispatch depends on static types.
@beikov beikov force-pushed the HHH-17375 branch 2 times, most recently from 0b01125 to e24a948 Compare May 7, 2024 15:56
@beikov beikov marked this pull request as ready for review May 7, 2024 19:01
@beikov beikov force-pushed the HHH-17375 branch 3 times, most recently from 9ef3fa3 to 99d9173 Compare May 7, 2024 22:25
@beikov beikov force-pushed the HHH-17375 branch 2 times, most recently from 2e1108d to aca4cd9 Compare May 13, 2024 06:40

@Internal
public static boolean isAssignableTo(JdbcMapping defined, JdbcMapping implied) {

Check notice

Code scanning / CodeQL

Confusing overloading of methods Note

Method StandardFunctionReturnTypeResolvers.isAssignableTo(..) could be confused with overloaded method
isAssignableTo
, since dispatch depends on static types.
@beikov beikov merged commit 8b5cdba into hibernate:main May 13, 2024
23 of 25 checks passed
@beikov beikov deleted the HHH-17375 branch May 22, 2024 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants