RE : bad sql on n-m relation to subclassed object
Hi jakob, I have not left the project because of OJB, of course ;) I have not succeeded to reproduce the behavior explained below. And, I think it is a mistake on our code. Best regards Nicolas DELAHAYE -Message d'origine- De : Jakob Braeuchi [mailto:[EMAIL PROTECTED] Envoyé : vendredi 10 mars 2006 19:09 À : OJB Users List Objet : Re: bad sql on n-m relation to subclassed object hi nicolas, please post the relevant parts of the repository.xml and eventually the generated sql. i hope you didn't leave the project because of ojb ;) jakob delahaye.nicolas schrieb: Hi jakob, Thank for your answer. I have see an other strange thing : I have a class B that inherit from A and a MN relationship between B and C. When i make a insert, the relation table is filled, but when i update the relation, the relation table is not updated ! Usually, the relation table for MN link is delete before new insert that represent the update. Why couldn't have the same behavior ? Best regards, Nicolas DELAHAYE PS: I have left the project that used OJB, but I have forwarded your email to the project manager. If I found time, i shall try to mount a unittest to show the different behavior already explained. hi nicolas, we recently fixed a problem concening findObjectByIdentity see 'OJB and the X-Files... :)' in this case the sql looked ok, but the wrong object was materialized. if the problem still persists, could yu please post a testcase so i can try to reproduce it. thanks jakob DELAHAYE Nicolas schrieb: hi Jakob Braeuchi I have this model : A link to A B, C, and D that inherit of A when i would like retreive a object A by findObjectByIdentity, the left out join make a link on A.id = A.idreftoA for each inherited classes. idreftoA is define as primary key and foreigner key of inherited classes. but A has not idreftoA field. I have tried with no link A to A, but it is the same behaviors. how do i make the mapping for A ? best regards Nicolas DELAHAYE Jakob Braeuchi wrote: hi nicolas, i'm pleased the latest version works for you. could you please post the error, or give me a hint where you found discussions about the bug. jakob delahaye.nicolas schrieb: Hi jakob, Ok, it is working with 1.0.4. But if i want retreive the super class alone, a wrong SLQ query is made, I have seen on the forum that is a bug. My question is : do you know if this defect will be fixed on 1.0.5 ? Best regards Nicolas DELAHAYE hi nicolas, ojb just release 1.0.4. could you please try this as well ? jakob Accédez au courrier électronique de La Poste : www.laposte.net ; 3615 LAPOSTENET (0,34 €/mn) ; tél : 08 92 68 13 50 (0,34€/mn) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: bad sql on n-m relation to subclassed object
hi nicolas, please post the relevant parts of the repository.xml and eventually the generated sql. i hope you didn't leave the project because of ojb ;) jakob delahaye.nicolas schrieb: Hi jakob, Thank for your answer. I have see an other strange thing : I have a class B that inherit from A and a MN relationship between B and C. When i make a insert, the relation table is filled, but when i update the relation, the relation table is not updated ! Usually, the relation table for MN link is delete before new insert that represent the update. Why couldn't have the same behavior ? Best regards, Nicolas DELAHAYE PS: I have left the project that used OJB, but I have forwarded your email to the project manager. If I found time, i shall try to mount a unittest to show the different behavior already explained. hi nicolas, we recently fixed a problem concening findObjectByIdentity see 'OJB and the X-Files... :)' in this case the sql looked ok, but the wrong object was materialized. if the problem still persists, could yu please post a testcase so i can try to reproduce it. thanks jakob DELAHAYE Nicolas schrieb: hi Jakob Braeuchi I have this model : A link to A B, C, and D that inherit of A when i would like retreive a object A by findObjectByIdentity, the left out join make a link on A.id = A.idreftoA for each inherited classes. idreftoA is define as primary key and foreigner key of inherited classes. but A has not idreftoA field. I have tried with no link A to A, but it is the same behaviors. how do i make the mapping for A ? best regards Nicolas DELAHAYE Jakob Braeuchi wrote: hi nicolas, i'm pleased the latest version works for you. could you please post the error, or give me a hint where you found discussions about the bug. jakob delahaye.nicolas schrieb: Hi jakob, Ok, it is working with 1.0.4. But if i want retreive the super class alone, a wrong SLQ query is made, I have seen on the forum that is a bug. My question is : do you know if this defect will be fixed on 1.0.5 ? Best regards Nicolas DELAHAYE hi nicolas, ojb just release 1.0.4. could you please try this as well ? jakob Accédez au courrier électronique de La Poste : www.laposte.net ; 3615 LAPOSTENET (0,34 €/mn) ; tél : 08 92 68 13 50 (0,34€/mn) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: bad sql on n-m relation to subclassed object
hi nicolas, we recently fixed a problem concening findObjectByIdentity see 'OJB and the X-Files... :)' in this case the sql looked ok, but the wrong object was materialized. if the problem still persists, could yu please post a testcase so i can try to reproduce it. thanks jakob DELAHAYE Nicolas schrieb: hi Jakob Braeuchi I have this model : A link to A B, C, and D that inherit of A when i would like retreive a object A by findObjectByIdentity, the left out join make a link on A.id = A.idreftoA for each inherited classes. idreftoA is define as primary key and foreigner key of inherited classes. but A has not idreftoA field. I have tried with no link A to A, but it is the same behaviors. how do i make the mapping for A ? best regards Nicolas DELAHAYE Jakob Braeuchi wrote: hi nicolas, i'm pleased the latest version works for you. could you please post the error, or give me a hint where you found discussions about the bug. jakob delahaye.nicolas schrieb: Hi jakob, Ok, it is working with 1.0.4. But if i want retreive the super class alone, a wrong SLQ query is made, I have seen on the forum that is a bug. My question is : do you know if this defect will be fixed on 1.0.5 ? Best regards Nicolas DELAHAYE hi nicolas, ojb just release 1.0.4. could you please try this as well ? jakob Accédez au courrier électronique de La Poste : www.laposte.net ; 3615 LAPOSTENET (0,34 €/mn) ; tél : 08 92 68 13 50 (0,34€/mn) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: bad sql on n-m relation to subclassed object
hi nicolas, you say A links to A. how is this done ? shouldn't there be a idreftoA in A as well ? jakob DELAHAYE Nicolas schrieb: hi Jakob Braeuchi I have this model : A link to A B, C, and D that inherit of A when i would like retreive a object A by findObjectByIdentity, the left out join make a link on A.id = A.idreftoA for each inherited classes. idreftoA is define as primary key and foreigner key of inherited classes. but A has not idreftoA field. I have tried with no link A to A, but it is the same behaviors. how do i make the mapping for A ? best regards Nicolas DELAHAYE Jakob Braeuchi wrote: hi nicolas, i'm pleased the latest version works for you. could you please post the error, or give me a hint where you found discussions about the bug. jakob delahaye.nicolas schrieb: Hi jakob, Ok, it is working with 1.0.4. But if i want retreive the super class alone, a wrong SLQ query is made, I have seen on the forum that is a bug. My question is : do you know if this defect will be fixed on 1.0.5 ? Best regards Nicolas DELAHAYE hi nicolas, ojb just release 1.0.4. could you please try this as well ? jakob Accédez au courrier électronique de La Poste : www.laposte.net ; 3615 LAPOSTENET (0,34 €/mn) ; tél : 08 92 68 13 50 (0,34€/mn) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: bad sql on n-m relation to subclassed object
Hi Jakob Braeuchi, The link A - A is made by an other field (linktoSelf) But i have try also without this link (A to A) and the part of query that made the left out join, link by : A.id = A.idreftoA. DB like : A [id, linktoSelft] ID is PK B [idreftoA, fielB ] idreftA is PK and FK C [idreftoA, fielC ] idreftA is PK and FK D [idreftoA, fielD ] idreftA is PK and FK +---+ +---+ | A | |--- | B | +---+ +---+ When i retreive B or C or D, all is good, no pb, good query, all field filled. Best regards Nicolas DELAHAYE Jakob Braeuchi wrote: hi nicolas, you say A links to A. how is this done ? shouldn't there be a idreftoA in A as well ? jakob DELAHAYE Nicolas schrieb: hi Jakob Braeuchi I have this model : A link to A B, C, and D that inherit of A when i would like retreive a object A by findObjectByIdentity, the left out join make a link on A.id = A.idreftoA for each inherited classes. idreftoA is define as primary key and foreigner key of inherited classes. but A has not idreftoA field. I have tried with no link A to A, but it is the same behaviors. how do i make the mapping for A ? best regards Nicolas DELAHAYE Jakob Braeuchi wrote: hi nicolas, i'm pleased the latest version works for you. could you please post the error, or give me a hint where you found discussions about the bug. jakob delahaye.nicolas schrieb: Hi jakob, Ok, it is working with 1.0.4. But if i want retreive the super class alone, a wrong SLQ query is made, I have seen on the forum that is a bug. My question is : do you know if this defect will be fixed on 1.0.5 ? Best regards Nicolas DELAHAYE hi nicolas, ojb just release 1.0.4. could you please try this as well ? jakob Accédez au courrier électronique de La Poste : www.laposte.net ; 3615 LAPOSTENET (0,34 €/mn) ; tél : 08 92 68 13 50 (0,34€/mn) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Nicolas DELAHAYE http://www.kalifeye.com/moncv_02.php?ncv=cv_krvfbQS3EY - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: bad sql on n-m relation to subclassed object
hi Jakob Braeuchi I have this model : A link to A B, C, and D that inherit of A when i would like retreive a object A by findObjectByIdentity, the left out join make a link on A.id = A.idreftoA for each inherited classes. idreftoA is define as primary key and foreigner key of inherited classes. but A has not idreftoA field. I have tried with no link A to A, but it is the same behaviors. how do i make the mapping for A ? best regards Nicolas DELAHAYE Jakob Braeuchi wrote: hi nicolas, i'm pleased the latest version works for you. could you please post the error, or give me a hint where you found discussions about the bug. jakob delahaye.nicolas schrieb: Hi jakob, Ok, it is working with 1.0.4. But if i want retreive the super class alone, a wrong SLQ query is made, I have seen on the forum that is a bug. My question is : do you know if this defect will be fixed on 1.0.5 ? Best regards Nicolas DELAHAYE hi nicolas, ojb just release 1.0.4. could you please try this as well ? jakob Accédez au courrier électronique de La Poste : www.laposte.net ; 3615 LAPOSTENET (0,34 €/mn) ; tél : 08 92 68 13 50 (0,34€/mn) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Nicolas DELAHAYE http://www.kalifeye.com/moncv_02.php?ncv=cv_krvfbQS3EY - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: bad sql on n-m relation to subclassed object
hi nicolas, i'm pleased the latest version works for you. could you please post the error, or give me a hint where you found discussions about the bug. jakob delahaye.nicolas schrieb: Hi jakob, Ok, it is working with 1.0.4. But if i want retreive the super class alone, a wrong SLQ query is made, I have seen on the forum that is a bug. My question is : do you know if this defect will be fixed on 1.0.5 ? Best regards Nicolas DELAHAYE hi nicolas, ojb just release 1.0.4. could you please try this as well ? jakob Accédez au courrier électronique de La Poste : www.laposte.net ; 3615 LAPOSTENET (0,34 €/mn) ; tél : 08 92 68 13 50 (0,34€/mn) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Re: bad sql on n-m relation to subclassed object
Hi jakob, Ok, it is working with 1.0.4. But if i want retreive the super class alone, a wrong SLQ query is made, I have seen on the forum that is a bug. My question is : do you know if this defect will be fixed on 1.0.5 ? Best regards Nicolas DELAHAYE hi nicolas, ojb just release 1.0.4. could you please try this as well ? jakob Accédez au courrier électronique de La Poste : www.laposte.net ; 3615 LAPOSTENET (0,34 /mn) ; tél : 08 92 68 13 50 (0,34/mn) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: bad sql on n-m relation to subclassed object
Sorry for multi posting, Otherwise, the version we use is 1.03 Jakob Braeuchi wrote: hi nicolas, i recommend not to cross-post, and to post the same message only once ;) further i recommend to tell us the version of ojb you're using. thank jakob -- Nicolas DELAHAYE - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: bad sql on n-m relation to subclassed object
hi nicolas, i recommend not to cross-post, and to post the same message only once ;) further i recommend to tell us the version of ojb you're using. thank jakob [EMAIL PROTECTED] schrieb: Hi, It seems when i use a n-m relation to a subclassed object, the sql produced by ojb is not good. The interesting part of our mapping : (note that the problem is because VersionJeuLimites inherits from Version not because VersionPdS inherits also from Version.) class-descriptor class=com.inetpsa.suq.referentiel.pds.model.Version table=SUQQTVER field-descriptor name=id column=VER_ID jdbc-type=INTEGER primarykey=true autoincrement=true access=readonly/ field-descriptor column=VER_NUMERO jdbc-type=INTEGER name=version/ /class-descriptor class-descriptor class=com.inetpsa.suq.referentiel.pds.model.limite.VersionJeuLimites table=SUQQTVJL field-descriptor name=id column=VJL_VER_IDREF jdbc-type=INTEGER primarykey=true autoincrement=true/ reference-descriptor name=super class-ref=com.inetpsa.suq.referentiel.pds.model.Version auto-retrieve=true auto-update=true auto-delete=true foreignkey field-ref=id/ /reference-descriptor field-descriptor column=VJL_VAL_NOMINAL jdbc-type=REAL name=valeurNominale/ field-descriptor column=VJL_VAL_SURV_SUP jdbc-type=REAL name=limiteSurveillanceSup/ field-descriptor column=VJL_VAL_SURV_INF jdbc-type=REAL name=limiteSurveillanceInf/ field-descriptor column=VJL_VAL_TOL_SUP jdbc-type=REAL name=limiteSup/ field-descriptor column=VJL_VAL_TOL_INF jdbc-type=REAL name=limiteInf/ /class-descriptor class-descriptor class=com.inetpsa.suq.referentiel.pds.model.VersionPdS table=SUQQTVPS field-descriptor name=id column=VPS_VER_IDREF jdbc-type=INTEGER primarykey=true/ reference-descriptor name=super class-ref=com.inetpsa.suq.referentiel.pds.model.Version auto-retrieve=true auto-update=true auto-delete=true foreignkey field-ref=id/ /reference-descriptor collection-descriptor name=versionsJeuLimite collection-class=org.apache.ojb.broker.util.collections.ManageableArrayList element-class-ref=com.inetpsa.suq.referentiel.pds.model.limite.VersionJeuLimites auto-retrieve=true auto-update=false auto-delete=false indirection-table=SUQQTL9P fk-pointing-to-this-class column=L9P_VPS_VER_IDREF/ fk-pointing-to-element-class column=L9P_VJL_VER_IDREF/ /collection-descriptor /class-descriptor When i load an instance of VersionPdS, ojb tries to load the collection of VersionJeuLimites. The bad sql produced is : SELECT A0.VJL_VER_IDREF,A0.VJL_JLM_IDREF,A0.VJL_VAL_NOMINAL,A0.VJL_VAL_SURV_SUP,A0.VJL_VAL_SURV_INF,A0.VJL_VAL_TOL_SUP,A0.VJL_VAL_TOL_INF FROM SUQQTVJL A0, SUQQTL9P INNER JOIN SUQQTVER A1,SUQQTL9P ON A0.VJL_VER_IDREF=A1.VER_ID WHERE (SUQQTL9P.L9P_VPS_VER_IDREF = ?) AND A0.VJL_VER_IDREF = SUQQTL9P.L9P_VJL_VER_IDREF; I suppose the good sql to produce would be : SELECT A0.VJL_VER_IDREF,A0.VJL_JLM_IDREF,A0.VJL_VAL_NOMINAL,A0.VJL_VAL_SURV_SUP,A0.VJL_VAL_SURV_INF,A0.VJL_VAL_TOL_SUP,A0.VJL_VAL_TOL_INF FROM SUQQTVJL A0 INNER JOIN SUQQTVER A1 ON A0.VJL_VER_IDREF=A1.VER_ID, SUQQTL9P WHERE (SUQQTL9P.L9P_VPS_VER_IDREF = ?) AND A0.VJL_VER_IDREF = SUQQTL9P.L9P_VJL_VER_IDREF; So, is it an ojb bug ? What do you recommend ? Nicolas DELAHAYE, Dimitri GOUX - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: bad sql on n-m relation to subclassed object
hi nicolas, ojb just release 1.0.4. could you please try this as well ? jakob DELAHAYE Nicolas schrieb: Sorry for multi posting, Otherwise, the version we use is 1.03 Jakob Braeuchi wrote: hi nicolas, i recommend not to cross-post, and to post the same message only once ;) further i recommend to tell us the version of ojb you're using. thank jakob - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]