Extra lazy collection size query invalid postgresql syntax

Description

Attempt to use extra-lazy collections with PostgreSQL ends with invalid syntax exception:

ERROR: subquery in FROM must have an alias

The cause is that AbstractCollectionPersister.generateSelectSizeString fills sqlSelectSizeString query via SimpleSelect.toStatementString and it doesn't add an alias to query. Workaround is to append some alias in Dialect.appendLockHint, but not sure if it doesn't break other functionality.

Activity

Brett MeyerOctober 14, 2013 at 5:06 PM

No response received – closing.

Former userJanuary 17, 2012 at 10:55 PM

Is this still an issue in 4.0.1.Final? If so, please create a pull request (preferably) or attach a patch with an update to org.hibernate.test.extralazy.ExtraLazyTest that reproduces your issue.

Thanks
Gail

Dmitry MurashenkovJanuary 17, 2012 at 3:49 PM

Oh, just found out that a custom @Persister can be supplied, so better to override it as a workaround.

Won't Fix

Details

Assignee

Reporter

Components

Affects versions

Priority

Created January 17, 2012 at 3:07 PM
Updated April 28, 2014 at 8:23 PM
Resolved October 14, 2013 at 5:06 PM