Copilot commented on code in PR #15768:
URL: https://github.com/apache/grails-core/pull/15768#discussion_r3477066693
##########
grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/HibernateGormStaticApi.groovy:
##########
@@ -275,11 +275,11 @@ class HibernateGormStaticApi<D> extends GormStaticApi<D> {
doListInternal(query, namedParams, [], args, false)
}
- D findWithNativeSql(CharSequence sql, Map args = Collections.emptyMap()) {
+ D findWithSql(CharSequence sql, Map args = Collections.emptyMap()) {
doSingleInternal(sql, [:], [], args, true) as D
}
- List<D> findAllWithNativeSql(CharSequence query, Map args =
Collections.emptyMap()) {
+ List<D> findAllWithSql(CharSequence query, Map args =
Collections.emptyMap()) {
doListInternal(query, [:], [], args, true)
Review Comment:
In `findAllWithSql`, the parameter is named `query` but represents SQL (and
`findWithSql` uses `sql`). This makes the public method signature inconsistent
and slightly confusing.
##########
grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/HibernateGormStaticApi.groovy:
##########
@@ -275,11 +275,11 @@ class HibernateGormStaticApi<D> extends GormStaticApi<D> {
doListInternal(query, namedParams, [], args, false)
}
- D findWithNativeSql(CharSequence sql, Map args = Collections.emptyMap()) {
+ D findWithSql(CharSequence sql, Map args = Collections.emptyMap()) {
doSingleInternal(sql, [:], [], args, true) as D
}
- List<D> findAllWithNativeSql(CharSequence query, Map args =
Collections.emptyMap()) {
+ List<D> findAllWithSql(CharSequence query, Map args =
Collections.emptyMap()) {
doListInternal(query, [:], [], args, true)
}
Review Comment:
The Hibernate 7 docs/upgrade notes in this repo still describe
`findWithNativeSql` / `findAllWithNativeSql` as the supported API, and describe
`findWithSql` / `findAllWithSql` as deprecated aliases. With these methods
renamed here, the documented `*NativeSql` methods no longer exist, so the
docs/examples become incorrect and will mislead users.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]