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.

Environment

PostgreSQL 9.1

Activity

Show:
Dmitry Murashenkov
January 17, 2012, 3:49 PM

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

Gail Badner
January 17, 2012, 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

Brett Meyer
October 14, 2013, 5:06 PM

No response received – closing.

Assignee

Unassigned

Reporter

Dmitry Murashenkov

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure