开发者

hibernate - Postgres- target lists can have at most 1664 entries

We are using hibernate, postgres 8.3x

Our entities are many to one mapped with eager fetching. We have multiple associations with Many to one mapping.

As we added new columns to any other existing entities, We are getting below error:

target lists can have at most 1664 entries

I searched internet and they say this is due to More number of select statements in sql query (generated by hibernate)

Can you any body please let us know if there is any configuration (in postgres) to up开发者_运维百科date max number columns in configuration or any other solution to solve this issue.

Thank you in advance.


Sometimes this happen when there are too much @ManyToOne(fetch=FetchType.EAGER) in the project. So, when is not necessary the FetchType.EAGER, put @ManyToOne(fetch=FetchType.LAZY)

This help me, try!


There is definitely something wrong with your model/mappings/query. The right way to fix that is to work on your model/mappings/query, not on the max number of columns in PostgreSQL (I don't even get how you reached it, a query that retrieve 1664+ columns doesn't make any sense).


Try

      <property name="hibernate.max_fetch_depth" value="25"/>


This is the max number of columns in PostgreSQL, that's correct. But why do you need even more columns? Just do some normalization and your problem is gone. Or don't use a relational database at all, you will always hit the max number of columns when you don't normalize.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜