You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Johnson <jo...@soho.club.tw> on 2005/03/20 14:46:06 UTC
a one2many binding with hibernate
Hi:
I want to write a one2many binding,the O/R MAP and java code were generated by hibernatesync,
it had two kind of beans for parent table,Bean,DAO
and it had three kind of beans child table,Bean,DAO,PK
The Biding collection is below
<fb:repeater id="shclj2List" parent-path="." row-path="shclj2Set">
<fb:on-bind>
<fb:value id="shclj2_csdh" path="id/shclj2Csdh"/>
<fb:value id="shclj2_csjc" path="shclj2Csjc"/>
<fb:value id="shclj2_cspm" path="shclj2Cspm"/>
<fb:value id="shclj2_coin" path="shclj2Coin"/>
<fb:value id="shclj2_price" path="shclj2Price"/>
<fb:value id="shclj2_cgl" path="shclj2Cgl"/>
</fb:on-bind>
<fb:on-delete-row>
<fb:delete-node/>
</fb:on-delete-row>
<fb:on-insert-row>
<fb:insert-bean classname="com.goodwillheater.Shclj2" addmethod="addToShclj2Set"/>
</fb:on-insert-row>
</fb:repeater>
When Load It's ok,But When save org.apache.avalon.framework.CascadingRuntimeException: InsertBean failed
If I don't use a PK class,the same error appear.
If I add a
<fb:identity>
<fb:value id="id" path="@id/shclj2Csdh"/>
</fb:identity>
the error happend
java.lang.RuntimeException: Tried to set value of output widget "shclj2List.0.id" with an object of an incorrect type: expected class java.lang.Long, received class java.lang.String
I do not write a hibernate session component in cocoon.xconf like the sample said.
Best Regards
Johnson
Re: a one2many binding with hibernate
Posted by Johnson <jo...@soho.club.tw>.
Hi!
I got the problem.
in <fb:insert-bean classname="com.goodwillheater.Shclj2" addmethod="addToShclj2Set"/>
the doSave() in InsertBeanJXPATHBinding.java throw the error.
But I don't know how to solve still,pls help.
Best Regards
Johnson
----- Original Message -----
From: Johnson
To: users@cocoon.apache.org
Sent: Sunday, March 20, 2005 10:09 PM
Subject: Re: a one2many binding with hibernate
If I use a different node than @id/shclj2Csdh even the node is a virtual one,the load is ok.But save had the same error.
<fb:identity>
<fb:value id="id" path="@oid"/>
</fb:identity>
Johnson
----- Original Message -----
From: Johnson
To: users@cocoon.apache.org
Sent: Sunday, March 20, 2005 9:46 PM
Subject: a one2many binding with hibernate
Hi:
I want to write a one2many binding,the O/R MAP and java code were generated by hibernatesync,
it had two kind of beans for parent table,Bean,DAO
and it had three kind of beans child table,Bean,DAO,PK
The Biding collection is below
<fb:repeater id="shclj2List" parent-path="." row-path="shclj2Set">
<fb:on-bind>
<fb:value id="shclj2_csdh" path="id/shclj2Csdh"/>
<fb:value id="shclj2_csjc" path="shclj2Csjc"/>
<fb:value id="shclj2_cspm" path="shclj2Cspm"/>
<fb:value id="shclj2_coin" path="shclj2Coin"/>
<fb:value id="shclj2_price" path="shclj2Price"/>
<fb:value id="shclj2_cgl" path="shclj2Cgl"/>
</fb:on-bind>
<fb:on-delete-row>
<fb:delete-node/>
</fb:on-delete-row>
<fb:on-insert-row>
<fb:insert-bean classname="com.goodwillheater.Shclj2" addmethod="addToShclj2Set"/>
</fb:on-insert-row>
</fb:repeater>
When Load It's ok,But When save org.apache.avalon.framework.CascadingRuntimeException: InsertBean failed
If I don't use a PK class,the same error appear.
If I add a
<fb:identity>
<fb:value id="id" path="@id/shclj2Csdh"/>
</fb:identity>
the error happend
java.lang.RuntimeException: Tried to set value of output widget "shclj2List.0.id" with an object of an incorrect type: expected class java.lang.Long, received class java.lang.String
I do not write a hibernate session component in cocoon.xconf like the sample said.
Best Regards
Johnson
Re: a one2many binding with hibernate
Posted by Johnson <jo...@soho.club.tw>.
Hi!
I got the problem.
in <fb:insert-bean classname="com.goodwillheater.Shclj2" addmethod="addToShclj2Set"/>
the doSave() in InsertBeanJXPATHBinding.java throw the error.
But I don't know how to solve still,pls help.
Best Regards
Johnson
----- Original Message -----
From: Johnson
To: users@cocoon.apache.org
Sent: Sunday, March 20, 2005 10:09 PM
Subject: Re: a one2many binding with hibernate
If I use a different node than @id/shclj2Csdh even the node is a virtual one,the load is ok.But save had the same error.
<fb:identity>
<fb:value id="id" path="@oid"/>
</fb:identity>
Johnson
----- Original Message -----
From: Johnson
To: users@cocoon.apache.org
Sent: Sunday, March 20, 2005 9:46 PM
Subject: a one2many binding with hibernate
Hi:
I want to write a one2many binding,the O/R MAP and java code were generated by hibernatesync,
it had two kind of beans for parent table,Bean,DAO
and it had three kind of beans child table,Bean,DAO,PK
The Biding collection is below
<fb:repeater id="shclj2List" parent-path="." row-path="shclj2Set">
<fb:on-bind>
<fb:value id="shclj2_csdh" path="id/shclj2Csdh"/>
<fb:value id="shclj2_csjc" path="shclj2Csjc"/>
<fb:value id="shclj2_cspm" path="shclj2Cspm"/>
<fb:value id="shclj2_coin" path="shclj2Coin"/>
<fb:value id="shclj2_price" path="shclj2Price"/>
<fb:value id="shclj2_cgl" path="shclj2Cgl"/>
</fb:on-bind>
<fb:on-delete-row>
<fb:delete-node/>
</fb:on-delete-row>
<fb:on-insert-row>
<fb:insert-bean classname="com.goodwillheater.Shclj2" addmethod="addToShclj2Set"/>
</fb:on-insert-row>
</fb:repeater>
When Load It's ok,But When save org.apache.avalon.framework.CascadingRuntimeException: InsertBean failed
If I don't use a PK class,the same error appear.
If I add a
<fb:identity>
<fb:value id="id" path="@id/shclj2Csdh"/>
</fb:identity>
the error happend
java.lang.RuntimeException: Tried to set value of output widget "shclj2List.0.id" with an object of an incorrect type: expected class java.lang.Long, received class java.lang.String
I do not write a hibernate session component in cocoon.xconf like the sample said.
Best Regards
Johnson
Re: a one2many binding with hibernate
Posted by Johnson <jo...@soho.club.tw>.
If I use a different node than @id/shclj2Csdh even the node is a virtual one,the load is ok.But save had the same error.
<fb:identity>
<fb:value id="id" path="@oid"/>
</fb:identity>
Johnson
----- Original Message -----
From: Johnson
To: users@cocoon.apache.org
Sent: Sunday, March 20, 2005 9:46 PM
Subject: a one2many binding with hibernate
Hi:
I want to write a one2many binding,the O/R MAP and java code were generated by hibernatesync,
it had two kind of beans for parent table,Bean,DAO
and it had three kind of beans child table,Bean,DAO,PK
The Biding collection is below
<fb:repeater id="shclj2List" parent-path="." row-path="shclj2Set">
<fb:on-bind>
<fb:value id="shclj2_csdh" path="id/shclj2Csdh"/>
<fb:value id="shclj2_csjc" path="shclj2Csjc"/>
<fb:value id="shclj2_cspm" path="shclj2Cspm"/>
<fb:value id="shclj2_coin" path="shclj2Coin"/>
<fb:value id="shclj2_price" path="shclj2Price"/>
<fb:value id="shclj2_cgl" path="shclj2Cgl"/>
</fb:on-bind>
<fb:on-delete-row>
<fb:delete-node/>
</fb:on-delete-row>
<fb:on-insert-row>
<fb:insert-bean classname="com.goodwillheater.Shclj2" addmethod="addToShclj2Set"/>
</fb:on-insert-row>
</fb:repeater>
When Load It's ok,But When save org.apache.avalon.framework.CascadingRuntimeException: InsertBean failed
If I don't use a PK class,the same error appear.
If I add a
<fb:identity>
<fb:value id="id" path="@id/shclj2Csdh"/>
</fb:identity>
the error happend
java.lang.RuntimeException: Tried to set value of output widget "shclj2List.0.id" with an object of an incorrect type: expected class java.lang.Long, received class java.lang.String
I do not write a hibernate session component in cocoon.xconf like the sample said.
Best Regards
Johnson