I have a custom EnumConverter setup and I want to use it only for a single column in a specific table to generate the POJOs.

<forcedType>
    <name>foo.bar.MyTableStatus</name>
    <expression>mytable.status</expression>
</forcedType>

I've tried several permutations, but the only one I got working was a generic

<forcedType>
    <name>foo.bar.MyTableStatus</name>
    <expression>.*\.status</expression>
</forcedType>

But this converts all status columns in all tables, which is not what I'm looking for.

I've read the docs, the XSD and there's nothing explaining against what regular expression to match. Is it table/column? table.column?

Thanks for any help.

有帮助吗?

解决方案

Your original configuration looks almost correct to me:

<expression>mytable.status</expression>

Fully qualified means that the schema is also part of the name, i.e. you should try either of these:

<expression>.*\.mytable\.status</expression>
<expression>myschema\.mytable\.status</expression>

Also, be sure to use the correct casing. Case-insensitive regexes can also be used:

<expression>(?i:.*\.mytable\.status)</expression>
<expression>(?i:myschema\.mytable\.status)</expression>
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top