Using dbunit to prepopulate varbinary data with HEX value

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Using dbunit to prepopulate varbinary data with HEX value

Ian Bentley
Hi all,

I'd like to use a dbunit flat xml file to populate some HEX data into a varbinary field in the database.

With standard SQL, you can use a number of encodings (i.e. x'001', 0x001) to specify that the incoming values are hex, but I haven't been able to get any of these to work with the dbunit xml flat files.

I've tried a number of things, including:

        <Entity id="1"
                ...snip...
                path="x'0000000000000001'"
                ...snip.../>

        <Entity id="1"
                ...snip...
                path="0x0000000000000001"
                ...snip.../>

Any help would be appreciated.

Ian
------------------------------------------------------------------------------
Got Input?   Slashdot Needs You.
Take our quick survey online.  Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey
_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user
Reply | Threaded
Open this post in threaded view
|

Re: Using dbunit to prepopulate varbinary data with HEX value

Roberto Lo Giacco
Hi, what you are calling standard SQL is instead a feature of your
database and because dbUnit is RDBMS agnostic it can't do the
conversion for you. You can achieve your goal using a custom
DataTypeFactory and/or a DataSetDecorator

Roberto Lo Giacco

> Il giorno 27/lug/2011, alle ore 16:33, Ian Bentley
> <[hidden email]> ha scritto:
>
>> Hi all,
>>
>> I'd like to use a dbunit flat xml file to populate some HEX data into a varbinary field in the database.
>>
>> With standard SQL, you can use a number of encodings (i.e. x'001', 0x001) to specify that the incoming values are hex, but I haven't been able to get any of these to work with the dbunit xml flat files.
>>
>> I've tried a number of things, including:
>>
>>    <Entity id="1"
>>        ...snip...
>>        path="x'0000000000000001'"
>>        ...snip.../>
>>
>>    <Entity id="1"
>>        ...snip...
>>        path="0x0000000000000001"
>>        ...snip.../>
>>
>> Any help would be appreciated.
>>
>> Ian
>> ------------------------------------------------------------------------------
>> Got Input?   Slashdot Needs You.
>> Take our quick survey online.  Come on, we don't ask for help often.
>> Plus, you'll get a chance to win $100 to spend on ThinkGeek.
>> http://p.sf.net/sfu/slashdot-survey
>> _______________________________________________
>> dbunit-user mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/dbunit-user
>

------------------------------------------------------------------------------
Got Input?   Slashdot Needs You.
Take our quick survey online.  Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey
_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user