Dear Mike,
thank you very much!
One more question: how does appfuse know which column(s) is(are) being
inserted NULL value(s)?
It looks like we can only insert nulls to the last column(s) as defined in
the sample-data.xml.
In other words, how to insert the following data (with NULL for the 2nd
column)?
<value>2</value>
<value>NULL</value>
<value>1</value>
Michael Horwitz wrote:
>
> To specify a null value, simply leave out the value field. So in your
> sample.xml:
>
> <row>
> <value>1</value>
> <value>Tree 01</value>
> </row>
>
> Mike.
>
> On 3/30/07, wnqq <[EMAIL PROTECTED]> wrote:
>>
>>
>> Environment: Appfuse v2.0M4 + Hibernate + MySQL5.0
>>
>> Question: How to specify NULL value in sample-data.xml so that the data
>> could be inserted into database via "mvn dbunit:operation" ?
>>
>> The following is an extract from my POJO Tree.java:
>>
>> =======================================
>>
>> private Long parentTreeId;
>>
>> private Tree parentTree;
>>
>> @Column(name = "PARENT_TREE_ID")
>> public Long getParentTreeId() {
>> return parentTreeId;
>> }
>>
>> @ManyToOne(optional=true)
>> @JoinColumn(name="PARENT_TREE_ID", nullable=true, updatable = false,
>> insertable = false)
>> public Tree getParentTree() {
>> return parentTree;
>> }
>>
>> =======================================
>>
>> The following is an extract of my sample-data.xml:
>>
>> =======================================
>>
>> <table name='tree'>
>> <column>id</column>
>> <column>name</column>
>> <column>parent_tree_id</column>
>> <row>
>> <value>1</value>
>> <value>Tree 01</value>
>> <value></value>
>> </row>
>> <row>
>> <value>2</value>
>> <value>Tree 02</value>
>> <value>1</value>
>> </row>
>> </table>
>> </dataset>
>>
>> =======================================
>>
>> I am trying to simulate a tree structure where the tree without a
>> parent-tree is the ROOT.
>> Thus, it is necessary to be able to insert parent_tree_id=NULL for the
>> ROOT
>> record (id=1).
>>
>> Unfortunately, when mvn is executed, I got the following error:
>>
>> Caused by: org.dbunit.dataset.datatype.TypeCastException: Error casting
>> value for table 'tree' and column 'PARENT_TREE_ID'
>>
>> So, how to revolve it?
>>
>> Thanks in advance.
>> --
>> View this message in context:
>> http://www.nabble.com/How-to-specify-NULL-value-in-sample-data.xml---tf3490838s2369.html#a9748925
>> Sent from the AppFuse - User mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>
--
View this message in context:
http://www.nabble.com/How-to-specify-NULL-value-in-sample-data.xml---tf3490838s2369.html#a9749392
Sent from the AppFuse - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]