Is it possible to combine two database fields into one in JOOQ with customer generators?

问题: I'm reading over the docs custom generators and data type rewrites. It seems like it has a lot of flexibility. But is it possible to combine two db fields into one? For e...

问题:

I'm reading over the docs custom generators and data type rewrites. It seems like it has a lot of flexibility. But is it possible to combine two db fields into one?

For example, for foreign exchange, I'd like to store two fields

budget.value, budget.currency

Could I somehow have JOOQ convert this to

Value getMonetaryValue() {
    return Value(this.value, this.currency);
}

Where in this case Value is a custom enum that I've created to support both value and currency.


回答1:

As of jOOQ 3.11, this isn't possible out of the box. There's a pending feature request and related features that will allow for supporting what JPA calls @Embeddable types: https://github.com/jOOQ/jOOQ/issues/6124

  • 发表于 2019-02-21 06:24
  • 阅读 ( 172 )
  • 分类:sof

条评论

请先 登录 后评论
不写代码的码农
小编

篇文章

作家榜 »

  1. 小编 文章
返回顶部
部分文章转自于网络,若有侵权请联系我们删除