You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by "Manukyan, Sergey" <SM...@lear.com> on 2005/10/21 16:49:01 UTC

bug in OJB?

Folks,



When I have :



<class-descriptor class="com.lear.app.sqs.beans.MyClass">

...

<collection-descriptor name="allUsers"


collection-class="org.apache.ojb.broker.util.collections.ManageableArray
List"


element-class-ref="com.lear.app.sqs.beans.MyUser"

                        auto-update="link"

                        indirection-table="CLASS">



                        <fk-pointing-to-this-class column="SPUNIT" />

                        <fk-pointing-to-this-class column="SPCLASS" />

                       

                        <fk-pointing-to-element-class column="SPUNIT" />

                        <fk-pointing-to-element-class column="SPUSER" />

            </collection-descriptor>

</class-descriptor>



And then call create(myClass) on Persistent Broker, when storing link
for a collection it generates INSERT SQL with duplicated field SPUNIT ->
results in SQL exception:



[org.apache.ojb.broker.accesslayer.StatementsForClassImpl] ERROR:
[SQL0121] Duplicate name SPUNIT not allowed.



INSERT INTO CLASS (SPUNIT, SPCLASS, SPUNIT,SPUSER) VALUES (?,?,?,?)



Any workaround ideas?



Thank you,



Sergey





**********************
** LEGAL DISCLAIMER **
**********************

This E-mail message and any attachments may contain
legally privileged, confidential or proprietary
information. If you are not the intended recipient(s),
or the employee or agent responsible for delivery of
this message to the intended recipient(s), you are
hereby notified that any dissemination, distribution
or copying of this E-mail message is strictly
prohibited. If you have received this message in
error, please immediately notify the sender and
delete this E-mail message from your computer.

Re: bug in OJB?

Posted by Armin Waibel <ar...@apache.org>.
Hi Sergey,

which version of OJB do you use?
Could you post the whole class-descriptor for MyClass and the m-side class.
Is the wrong sql-statement only be generated with auto-update="link" or 
for "object" too?

regards,
Armin


Manukyan, Sergey wrote:
> Folks,
> 
> 
> 
> 
> When I have :
> 
> 
> 
> 
> <class-descriptor class="com.lear.app.sqs.beans.MyClass">
> 
> ...
> 
> <collection-descriptor name="allUsers"
> 
> 
> 
> collection-class="org.apache.ojb.broker.util.collections.ManageableArray
> List"
> 
> 
> 
> element-class-ref="com.lear.app.sqs.beans.MyUser"
> 
> 
>                         auto-update="link"
> 
> 
>                         indirection-table="CLASS">
> 
> 
> 
> 
>                         <fk-pointing-to-this-class column="SPUNIT" />
> 
>                         <fk-pointing-to-this-class column="SPCLASS" />
> 
>                        
> 
> 
>                         <fk-pointing-to-element-class column="SPUNIT" />
> 
>                         <fk-pointing-to-element-class column="SPUSER" />
> 
>             </collection-descriptor>
> 
> </class-descriptor>
> 
> 
> 
> 
> And then call create(myClass) on Persistent Broker, when storing link
> for a collection it generates INSERT SQL with duplicated field SPUNIT ->
> results in SQL exception:
> 
> 
> 
> 
> [org.apache.ojb.broker.accesslayer.StatementsForClassImpl] ERROR:
> [SQL0121] Duplicate name SPUNIT not allowed.
> 
> 
> 
> 
> INSERT INTO CLASS (SPUNIT, SPCLASS, SPUNIT,SPUSER) VALUES (?,?,?,?)
> 
> 
> 
> 
> Any workaround ideas?
> 
> 
> 
> 
> Thank you,
> 
> 
> 
> 
> Sergey
> 
> 
> 
> 
> 
> 
> **********************
> ** LEGAL DISCLAIMER **
> **********************
> 
> This E-mail message and any attachments may contain
> 
> legally privileged, confidential or proprietary
> 
> information. If you are not the intended recipient(s),
> or the employee or agent responsible for delivery of
> 
> this message to the intended recipient(s), you are
> 
> hereby notified that any dissemination, distribution
> 
> or copying of this E-mail message is strictly
> 
> prohibited. If you have received this message in
> 
> error, please immediately notify the sender and
> 
> delete this E-mail message from your computer.

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org