简体   繁体   English

JOOQ是否支持重新映射表列名称

[英]Is remapping table column names supported in JOOQ

JOOQ documentation explains a way to map JOOQ tables to different schema and table names. JOOQ文档介绍了一种将JOOQ表映射到不同模式和表名的方法。 What about column names? 列名呢? In other words, can I run my JOOQ backed code on a similar structured set of tables where column names are different from the one hard coded, but have the same meaning. 换句话说,我是否可以在一组相似的结构化表上运行JOOQ支持的代码,这些表的列名与一个硬编码的表名称不同,但含义相同。 For example 例如

PEOPLE(FIRST_NAME, LAST_NAME) -> EMPLOYEES(FName, LName) PEOPLE(FIRST_NAME,LAST_NAME)-> EMPLOYEES(FName,LName)

Thanks, Max 谢谢,马克斯

As of jOOQ 3.9, this is not yet supported out of the box. 从jOOQ 3.9开始,尚不支持此功能。 Here's the relevant feature request https://github.com/jOOQ/jOOQ/issues/2949 这是相关的功能请求https://github.com/jOOQ/jOOQ/issues/2949

A workaround would be to implement a VisitListener , which would take care of such translation on a lower AST transformation level. 一种解决方法是实现VisitListener ,它将在较低的AST转换级别上进行此类转换。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM