Hi Philippe, 2013/6/18 <[email protected]>
> Hi, > > Is there a way to implement custom types with arrays? > > If I use Postgres and have a table like this: > > CREATE TABLE ice_cream_cup ( > ... > flavors TEXT[], > ... > ); > > where the value of "flavors" is not an enumeration but some description > that my system shouldn't (have to) know too much about. > > So far, my tests have been unsuccessful: > - the generator ignores my forced type (I tried with "Flavor", "Flavor[]" > or "[LFlavor;"). > - auto-conversions from String cannot be provided (unless I can register a > converter with a forced type) > If I get this right, you would like to map TEXT to com.example.Flavor, and thus, TEXT[] to com.example.Flavor[] ? In principle, you should be able to write a Converter<String[], Flavor[]> and hook it into the generator. But as you said, this didn't seem to work. Can you provide the XML snipped you used for code generation configuration? > I think I am going to work-around the difficulty for now by providing > properties of type String[] in my POJO, but perhaps there is another way > (or I made a mistake during my tests). This currently isn't officially supported as there are no integration tests covering using converters for array types. I have added an issue for this: https://github.com/jOOQ/jOOQ/issues/2533 Cheers Lukas -- You received this message because you are subscribed to the Google Groups "jOOQ User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
