开发者

How to tell EclipseLink to use full table names for aliases in SQL

开发者 https://www.devze.com 2023-01-21 20:37 出处:网络
EclipseLink normally generates SQLs like: SELECT t0.ID, t1.NAME FROM MAN t0, WIFE t1 WHERE t0.ID = t1.MAN_ID

EclipseLink normally generates SQLs like:

SELECT t0.ID, t1.NAME FROM MAN t0, WIFE t1 WHERE t0.ID = t1.MAN_ID

Is it possible to tell EclipseLink, that it should use full table names for aliases to make the query more readable?

SELECT t0_MAN.ID, t1_WIFE.NAME FROM MAN t0_MAN, WIFE t1_WIFE WHERE t0_MAN.ID = t1_WIFE.MAN_ID

I t开发者_Go百科hink Hibernate has a similar feature.


No, EclipseLink will always use short aliases. But if there isn't a join then it will avoid aliases entirely.

The issue with postfix the table name is that this will exceed the maximum length for an alias if the table name is long. We could truncate them of coarse, feel free to log an enhancement for this.

0

精彩评论

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

关注公众号