RE: storing objects
Hi Armin, Can I be included on that list? And how to become the developer/contributor of OJB in general? Thanks, -Sergey -Original Message- From: Armin Waibel [mailto:[EMAIL PROTECTED] Sent: Friday, September 14, 2007 8:00 PM To: OJB Users List Subject: Re: storing objects Hi Sergey, Manukyan, Sergey wrote: Hi, About mandragora... it looks like it is a layer on top of PerstenceBroker... my suggestion would be why not to integrate it into OJB and call it something like Simplified API for Persistance Broker (SAP)... ? I only checked the methods of the it.aco.mandragora.dao.DAO interface. If OJB user find these methods useful I agree to integrate it (in some way) in OJB. I suggest to discuss the details on the dev-list. regards, Armin It will help improve OJB in the next releases. As frankly speaking I see a need in it, as I myself developed some kind of OJB façade class that simplifies OJB operations with a simplified API. Just my 2 cents, -Sergey - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ** ** 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: storing objects
Hi, About mandragora... it looks like it is a layer on top of PerstenceBroker... my suggestion would be why not to integrate it into OJB and call it something like Simplified API for Persistance Broker (SAP)... ? It will help improve OJB in the next releases. As frankly speaking I see a need in it, as I myself developed some kind of OJB façade class that simplifies OJB operations with a simplified API. Just my 2 cents, -Sergey -Original Message- From: Alessandro Colantoni [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 12, 2007 7:19 AM To: OJB Users List Subject: Re: storing objects Hi! Mandragora is not part of the ojb project, but up now it is based on it and use Ojb Persistence broker as persistence engine. It is just a small project to provide you lots of the must common business and Dao methods. Just have a look. I hope improve documentation soon. Anyway it provides you a very easy mechanism based on Factory pattern to write and use your methods. If you download it you have these methods available, and can add yours to have a library very easy to reuse, and if you want, to share The future? I'm the only one in the team up now, and I will give you all support i can. Anyway don't look at it as a big and complicate project that if a day close you get in trouble. Mandragora want just to be a set of reusable business and Dao methods (based on ojb). For example I had the same problem of you with trees, or collection. You solved it writing your own method to delete object in the database not present in your reference collection. I solved it with a generic method, so I will use it again and again. You can write other methods and sharing On 9/12/07, Hans Novak [EMAIL PROTECTED] wrote: aha .!? H... is the mandragora Project a part of the ojb project ? How looks ist for the future with it ? I ask this, because, i dontwant to use it and sometime it will be cancel'ed. Hans Alessandro Colantoni schrieb: Hi Yes it is normal. When you have a main object that has a collection attribute, Ojb works just on value objects that are in the collection. I developed a framework based on Ojb called mandragora ( http://mandragora.sourceforge.net) that provides lots of method that can help. The methods updateCollectionReference, updateCollectionReferences and updateCreateTrees do just what you need http://mandragora.sourceforge.net/referenceguide/bd-api-guide.html Have a look. Documentation is very poor but in the following days I will upload something more I hope this can help Best Regards Alessandro On 9/12/07, Alessandro Colantoni [EMAIL PROTECTED] wrote: On 9/12/07, Hans Novak [EMAIL PROTECTED] wrote: Hi, i am not shure, but is ist correct when i have an object, witch is a tree of some other objects (colletions) and i delete a part of the tree and then store the hole object (tree) - in the database the deleted object will also be deleted ? Everything works fine, when i store or update the object, but not when i delete. The deleted part of the object will not be deleted in the database. I can remove it by hand, when i run a remove.object (the part of the tree) and then store the (changed) tree. Is this normal ? Hans - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Repcom Datentechnik GmbH http://www.repcom.de/ Hauptstr. 103 - 63110 Rodgau Tel. 06106-638081 Fax 06106-638083 Steuernummer 03524225030 Ust-IdNr.: DE151061445 Bankverbindung: Deutsche Bank Dietzenbach, Kto. 1516400 BLZ 50570024 , Inhaber Repcom Datentechnik Internationale Zahlungen Kto. 1510304 BLZ 50570024, Inhaber J. Novak de54505700240151030400 BIC deutdedb538 Öffnungszeiten: Mo.-Fr. 14.00-18.30 Uhr Tel. Hotline Mo.-Fr. 10.00-18.30 Uhr Sie finden uns hier: Anfahrtsbeschreibung http://www.repcom.de/images/repcom/anfahrt.jpg Messenger Yahoo ICQ : bforpc : 174290900 MSN Skype : [EMAIL PROTECTED] : bforpc Unsere primären Web Adressen www.repcom.de http://www.repcom.de/ und www.dataportal.de http://www.dataportal.de/ Unsere AGB's finden Sie hier http://www.repcom.de/index.php?main_page=conditions. Vertraulichkeitshinweis Der Inhalt dieser E-Mail, einschliesslich etwaiger Anhäge, ist vertraulich und nur für den oben bezeichneten Adressaten bestimmt. Wenn Sie nicht dieser Adressat oder dessen Empfangsvertreter sein sollten, so beachten Sie bitte, dass jede Form der Kenntnisnahme, Veröffentlichung, Vervielfältigung, Weitergabe oder eines anderen Gebrauchs des Inhalts nicht gestattet ist und gesetzeswidrig sein kann. Bitte informieren Sie in diesem Fall unverzglich den Absender und vernichten Sie dieses E-Mail nebst Anhängen und aller Kopien.
what's with OJB Project?
Folks, It has been a while since last release of 1.0.4. I have been a user of ojb since 1.0.2... for about 4 years... but going forward concerns me. With no new releases I would like to ask how does the perspective looks for this project? Is work currently being done? Why such a big gap in releases? Are there still plans to ship 1.1? Regards, -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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
anonymous keys and PK in 1.0.4
Folks, Just stumbled on the issue with using anonymous keys which make a compound PK of the class. class-descriptor class=com.lear.ojb.beans.AmortizedToolingSchedulePO table=SVZATSDTL !-- PK { FK (class=com.lear.ojb.beans.AmortizedToolingSchedule) } -- field-descriptor name=scheduleId column=SCHEDULE jdbc-type=DECIMAL length=11 primarykey=true nullable=false access=anonymous/ !-- PK { FK (class=com.lear.ojb.beans.Requisition) } -- field-descriptor name=reqNumber column=REQ# jdbc-type=DECIMAL length=7 primarykey=true nullable=false access=anonymous/ field-descriptor name=reqType column=POTYPE jdbc-type=VARCHAR length=5 primarykey=true nullable=false access=anonymous/ reference-descriptor name=amortizedToolingSchedule class-ref=com.lear.ojb.beans.AmortizedToolingSchedule auto-retrieve=false foreignkey field-ref=scheduleId / /reference-descriptor reference-descriptor name=requisition class-ref=com.lear.ojb.beans.Requisition auto-retrieve=false foreignkey field-ref=reqNumber / foreignkey field-ref=reqType / /reference-descriptor /class-descriptor So I have a class that has two references, and using PersistentBroker.delete(new AmortizedToolingSchedulePO(amortizedToolingSchedule, requisition)) It gives me error: [11:20:38,160] ERROR (PersistenceBrokerImpl) - Cannot delete object without valid PKs. All references are valid objects... PK are anponymous... so what is wrong? Thank you in advance, -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.
anonymous keys
Folks, I have a question regarding anonymous keys. Without them I was successfully using QueryByIdentity to find an object by his PK: Query query = new QueryByIdentity(example); retVal = broker.getObjectByQuery(query); But when I enabled primary keys this approach stopped to work. Any suggestions to how can I use anonymous keys and be able to find object by his PK? -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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: primary key field null after update
Hi, make sure you have correctly defined the primary keys... Sergey -Original Message- From: Guido Beutler [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 05, 2006 8:42 AM To: ojb-user@db.apache.org Subject: primary key field null after update Hi, I am using OJB 1.0.4 inside of jboss 3.2.5. I updated from OJB 1.0.0 to 0.4 . Now I am running is a strange problem which did not occur in 1.0.0. When I update a object the primary key field is null after the store although the update is executed and succeed. The update sql statement is executed correctly, only the pk field at the value object is null after returning from ojb. When I insert a object of the same type with a null value at the primary ey field the sequence fills the field correctly and the primary key field at the object ist set correctly. The object has many references which have autoload and refresh set to true but auto update set to false. Has anybody seen this before? Thanks in advance, Guido ** ** 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
quiet setPathOuterJoin(wrongPath)
Folks, Method ReportQueryByCriteria.setPathOuterJoin(someWrongPath) , when invoked with wrong path argument does nothing to notify the caller about an error. IMHO it would be nice to have him throw a runtime exception in that case. Could have saved me half a day of debugging time... Thanks! 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: solution for subqueries returning values
Hi Jacob, Every relation is defined. But in the report queries I can only specify the columns in String[] {}, I wish I could specify the queries as well and pass it in Object[] {}, just like it is done for Criteria methods. F.e : Query qB = QueryFactory.newReportQuery(B.class); // SELECT COUNT(*) FROM B Query qC = QueryFactory.newReportQuery(C.class); // SELECT AVG(C.FF) FROM C Query qD = QueryFactory.newReportQuery(D.class); // SELECT MAX(D.FFF) FROM D ReportQueryByCriteria q = QueryFactory.newReportQuery(A.class); q.setAttributes( new Object[] { F, qB, qC, qD } ) Is this functionality is planned in the roadmap of OJB? -Sergey -Original Message- From: Jakob Braeuchi [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 31, 2006 3:53 PM To: OJB Users List Subject: Re: solution for subqueries returning values hi sergey, this looks like a report query to me. do you have relationships defined between A, B, C, D ? jakob Manukyan, Sergey schrieb: Folks, Could you please advice an OJB solution for this SQL query: SELECT A.F, (SELECT COUNT(*) FROM B INNER JOIN A ON A.F = B.F), (SELECT AVG(C.FF) FROM C INNER JOIN A ON A.F = C.F), (SELECT MAX(D.FFF) FROM D INNER JOIN A ON A.F = D.F) FROM A The OJB subqueries mechanism doesn't work in this case or... am I missing anything? -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: [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]
solution for subqueries returning values
Folks, Could you please advice an OJB solution for this SQL query: SELECT A.F, (SELECT COUNT(*) FROM B INNER JOIN A ON A.F = B.F), (SELECT AVG(C.FF) FROM C INNER JOIN A ON A.F = C.F), (SELECT MAX(D.FFF) FROM D INNER JOIN A ON A.F = D.F) FROM A The OJB subqueries mechanism doesn't work in this case or... am I missing anything? -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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: exception in JDBC driver
Thank you Armin, Can I get a nightly build of 1.0.5 somehow? Sergey -Original Message- From: Armin Waibel [mailto:[EMAIL PROTECTED] Sent: Saturday, January 21, 2006 12:31 PM To: OJB Users List Subject: Re: exception in JDBC driver Armin Waibel wrote: Hi Sergey, Manukyan, Sergey wrote: Hi Everybody, We upgraded to 1.0.4 and using JT400-4.4 JDBC driver for AS400 data source. See now our JDBC driver throwing exceptions when OJB askes him for field named OJB_CLAZZ, that the result set doesn't have, and it happens for every row. Is it possible to avoid OJB to check for this field from result set? First, thanks much! This was an important hint to unravel the mystery of slowdown of query performance between 1.0.3 and 1.0.4. Currently OJB checks each row of a result set for this column. The check was needed to resolve real class names when inheritance was used. http://db.apache.org/ojb/docu/guides/advanced-technique.html#Mapping+Eac h+Subclass+to+a+Distinct+Table+%28table+per+subclass%29 I will check in a improved version tomorrow. This version will only ask for the column when it really exists, thus no exceptions should occur. It's fixed in SVN OJB_1_0_RELEASE branch. regards, Armin regards, Armin -Sergey -Original Message- From: Armin Waibel [mailto:[EMAIL PROTECTED] Sent: Friday, January 20, 2006 12:58 PM To: OJB Users List Subject: Re: store object without references Hi Sergey, Manukyan, Sergey wrote: Folks, I am using 1.0.4. Could you please advice if there is a way to store an object of some class without storing references although I defined in the descriptor of the class to store references as well. I am looking for a workaround that will enable me to do it in some cases... Something like: PersistenceBroker.store(object, some flag to indicate not to store references) you can use a method defined in PersistenceBrokerInternal, simply cast the used PB instance to PBI. public void store(Object obj, Identity oid, ClassDescriptor cld, boolean insert, boolean ignoreReferences) This method will ignore the auto-update settings when flag 'ignoreReferences' is true. http://db.apache.org/ojb/api/org/apache/ojb/broker/PersistenceBrokerInte rnal.html Build the Identity via IdentityFactory (service method in PB), lookup the ClassDescriptor via PB. regards, Armin 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: [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] - 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]
store object without references
Folks, I am using 1.0.4. Could you please advice if there is a way to store an object of some class without storing references although I defined in the descriptor of the class to store references as well. I am looking for a workaround that will enable me to do it in some cases... Something like: PersistenceBroker.store(object, some flag to indicate not to store references) 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
exception in JDBC driver
Hi Everybody, We upgraded to 1.0.4 and using JT400-4.4 JDBC driver for AS400 data source. See now our JDBC driver throwing exceptions when OJB askes him for field named OJB_CLAZZ, that the result set doesn't have, and it happens for every row. Is it possible to avoid OJB to check for this field from result set? -Sergey -Original Message- From: Armin Waibel [mailto:[EMAIL PROTECTED] Sent: Friday, January 20, 2006 12:58 PM To: OJB Users List Subject: Re: store object without references Hi Sergey, Manukyan, Sergey wrote: Folks, I am using 1.0.4. Could you please advice if there is a way to store an object of some class without storing references although I defined in the descriptor of the class to store references as well. I am looking for a workaround that will enable me to do it in some cases... Something like: PersistenceBroker.store(object, some flag to indicate not to store references) you can use a method defined in PersistenceBrokerInternal, simply cast the used PB instance to PBI. public void store(Object obj, Identity oid, ClassDescriptor cld, boolean insert, boolean ignoreReferences) This method will ignore the auto-update settings when flag 'ignoreReferences' is true. http://db.apache.org/ojb/api/org/apache/ojb/broker/PersistenceBrokerInte rnal.html Build the Identity via IdentityFactory (service method in PB), lookup the ClassDescriptor via PB. regards, Armin 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: [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: store object without references
Thank you Armin. -Original Message- From: Armin Waibel [mailto:[EMAIL PROTECTED] Sent: Friday, January 20, 2006 12:58 PM To: OJB Users List Subject: Re: store object without references Hi Sergey, Manukyan, Sergey wrote: Folks, I am using 1.0.4. Could you please advice if there is a way to store an object of some class without storing references although I defined in the descriptor of the class to store references as well. I am looking for a workaround that will enable me to do it in some cases... Something like: PersistenceBroker.store(object, some flag to indicate not to store references) you can use a method defined in PersistenceBrokerInternal, simply cast the used PB instance to PBI. public void store(Object obj, Identity oid, ClassDescriptor cld, boolean insert, boolean ignoreReferences) This method will ignore the auto-update settings when flag 'ignoreReferences' is true. http://db.apache.org/ojb/api/org/apache/ojb/broker/PersistenceBrokerInte rnal.html Build the Identity via IdentityFactory (service method in PB), lookup the ClassDescriptor via PB. regards, Armin 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: [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: uses OUTER JOIN by default... -- BUG or FUNCTIONALITY ?
Hi Jacob, Well, see yourself if it is a clever behavior: Here is a simplified repository data: class-descriptor class=Supplier table=SUPPLIER field-descriptor name=pkField primarykey=true / field-descriptor name=fkField / collection-descriptor name=allChildren element-class-ref=Supplier inverse-foreignkey field-ref=fkField /collection-descriptor !-- here are types I am interested to reytrieve per parent -- collection-descriptor name=allTypes element-class-ref=Type inverse-foreignkey field-ref=pkField /collection-descriptor ... /class-descriptor And using a ReportQuery with fields: {pkField,allChildren.allTypes.typeDescription} It generates SQL: SELECT ... FROM SUPPLIER A0 LEFT OUTER JOIN (SUPPLIER A1 INNER JOIN TYPES A2 ON ...) ON ... Again I am not specifying it to do LEFT OUTER JOIN for allChildren relationship or any other relationship. It does that way when: - there are present two relations together. In case I am retrieving just {pkField,allChildren.pkField} it workes correctly. - and both sides of relationship represent same class. When children are located in other class it also workes correctly. To me it is an unexpected cleverness without legal way to disable or control it which is kind of frustrating... -Sergey -Original Message- From: Jakob Braeuchi [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 11, 2006 1:06 PM To: OJB Users List Subject: Re: uses OUTER JOIN by default... -- BUG or FUNCTIONALITY ? hi sergey, ojb just tries to be clever ;) outer joins are created when there are extents etc. could you please post the relevant parts of your mapping file and the generated sql. jakob Manukyan, Sergey schrieb: After some tests found out that OJB generates LEFT OUTER JOIN instead of INNER JOIN in a 1:N relationship if both ends are same class. Is that a planned functionality or a bug? In my case I need 1:N relationship to be made from MyClass to Collection of MyClasses... How can I force then OJB to generate INNER JOIN in that case? -Sergey -Original Message- From: Manukyan, Sergey [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 10, 2006 9:00 AM To: OJB Users List Subject: uses OUTER JOIN by default... Hi, I just moved to OJB 1.0.4. One thing I noticed is that it started generating OUTER JOIN although I didn't specify it to do so. In my case with ReportQuery with following columns: String[] queryColumns = new String[] { allChildren.addressLine1, allChildren.addressLine2, allChildren.addressLine4, allChildren.addressLine5, allChildren.allRequisitionTypesOfSupplier.reqType }; It generates OUTER JOIN for allChildren and INNER JOIN for allRequisitionTypesOfSupplier when I need only INNER JOINS. Please advice, is it a bug or should I somehow specifically tell OJB to use INNER JOIN? 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: [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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
uses OUTER JOIN by default...
Hi, I just moved to OJB 1.0.4. One thing I noticed is that it started generating OUTER JOIN although I didn't specify it to do so. In my case with ReportQuery with following columns: String[] queryColumns = new String[] { allChildren.addressLine1, allChildren.addressLine2, allChildren.addressLine4, allChildren.addressLine5, allChildren.allRequisitionTypesOfSupplier.reqType }; It generates OUTER JOIN for allChildren and INNER JOIN for allRequisitionTypesOfSupplier when I need only INNER JOINS. Please advice, is it a bug or should I somehow specifically tell OJB to use INNER JOIN? 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
uses OUTER JOIN by default... -- BUG or FUNCTIONALITY ?
After some tests found out that OJB generates LEFT OUTER JOIN instead of INNER JOIN in a 1:N relationship if both ends are same class. Is that a planned functionality or a bug? In my case I need 1:N relationship to be made from MyClass to Collection of MyClasses... How can I force then OJB to generate INNER JOIN in that case? -Sergey -Original Message- From: Manukyan, Sergey [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 10, 2006 9:00 AM To: OJB Users List Subject: uses OUTER JOIN by default... Hi, I just moved to OJB 1.0.4. One thing I noticed is that it started generating OUTER JOIN although I didn't specify it to do so. In my case with ReportQuery with following columns: String[] queryColumns = new String[] { allChildren.addressLine1, allChildren.addressLine2, allChildren.addressLine4, allChildren.addressLine5, allChildren.allRequisitionTypesOfSupplier.reqType }; It generates OUTER JOIN for allChildren and INNER JOIN for allRequisitionTypesOfSupplier when I need only INNER JOINS. Please advice, is it a bug or should I somehow specifically tell OJB to use INNER JOIN? 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
is it a bug?
Hi, Here is my case: (I am using OJB 1.0.3) class-descriptor class=Parent field-descriptor name=firstName column=... jdbc-type=VARCHAR primarykey=true / field-descriptor name=lastName column=... jdbc-type=VARCHAR primarykey=true / collection-descriptor name=allChildren collection-class=org.apache.ojb.broker.util.collections.ManageableArray List element-class-ref=Child inverse-foreignkey field-ref=lastName / /collection-descriptor /class-descriptor class-descriptor class=Child field-descriptor name=firstName column=... jdbc-type=VARCHAR primarykey=true / field-descriptor name=lastName column=... jdbc-type=VARCHAR primarykey=true / /class-descriptor And here is a problem: When retrieving ReportQueryByCriteria qry = QueryFactory.newReportQuery(Parent.class, new String[] {firstName,allChildren.firstName}, criteria, false); The query fails with Exception: java.lang.ArrayIndexOutOfBoundsException 1 Stack Trace: * org.apache.ojb.broker.accesslayer.sql.SqlQueryStatement$Join.appendJoinE qualities(SqlQueryStatement.java:2059) * org.apache.ojb.broker.accesslayer.sql.SqlQueryStatement.appendJoinSQL92( SqlQueryStatement.java:1555) * org.apache.ojb.broker.accesslayer.sql.SqlQueryStatement.appendTableWithJ oins(SqlQueryStatement.java:1498) * org.apache.ojb.broker.accesslayer.sql.SqlSelectStatement.getStatement(Un known Source) * org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl.getPrepare dSelectStatement(Unknown Source) * org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeQuery(Unknown Source) * org.apache.ojb.broker.accesslayer.RsQueryObject.performQuery(Unknown Source) * org.apache.ojb.broker.accesslayer.RsIterator.init(Unknown Source) * org.apache.ojb.broker.accesslayer.ReportQueryRsIterator.init(Unknown Source) * org.apache.ojb.broker.core.ReportRsIteratorFactoryImpl.createRsIterator( Unknown Source) * org.apache.ojb.broker.core.PersistenceBrokerImpl.getRsIteratorFromQuery( Unknown Source) * org.apache.ojb.broker.core.PersistenceBrokerImpl.getReportQueryIteratorF romQuery(Unknown Source) * org.apache.ojb.broker.core.PersistenceBrokerImpl.getReportQueryIteratorB yQuery(Unknown Source) * org.apache.ojb.broker.core.DelegatingPersistenceBroker.getReportQueryIte ratorByQuery(Unknown Source) * org.apache.ojb.broker.core.DelegatingPersistenceBroker.getReportQueryIte ratorByQuery(Unknown Source) The additional debugging revealed that inside of appendJoinEqualities(): Join.appendJoinEqualities(SELECT A0.FNAME,A1.FNAME FROM PARENT_TABLE A0 INNER JOIN CHILD_TABLE A1 ON ) leftKeys.length = 2 rightKeys.length = 1 The same configuration works fine when I am doing Parent p = new Parent(Silvester,Stallone); Query query = new QueryByIdentity(p); p = broker.getObjectByQuery(query); p.getAllChildren() - SUCCESS!!! Please advice if it is a bug or... I am not doing something right, 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.
Just wanted to share one review.
http://services.dfa.cornell.edu:8080/confluence/display/Kuali/Hibernate+ vs.+OJB ** ** 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: bug in OJB?
Hi Armin, Just added the issue: http://issues.apache.org/jira/browse/OJB-76 Thank you, Sergey -Original Message- From: Armin Waibel [mailto:[EMAIL PROTECTED] Sent: Monday, October 24, 2005 6:52 PM To: OJB Users List Subject: Re: bug in OJB? Hi Sergey, now I get your point, you are right this is a bug. Your attached patch was removed by the apache-server (I don't get it), please open an issue in jira http://issues.apache.org/jira/browse/OJB and add your patch. I will integrate it ASAP. Thanks much! regards, Armin Manukyan, Sergey wrote: Hi Armin, I am using OJB 1.0.3 and only used link, didn't try object. I made a quick fix in MtoNBroker, that looks like it works for me now, please see the attached file. And find it under FIXED comment, The example I gave is simplified from the real. But I think it gives the idea where problem is- OJB assumes that (M to N) table has only different fields for M key and N key when actually in my case both keys are composite and some fields are common. M key: k1,m1 N key: k1,n1 So (M to N) table has only 3 keys: k1,m1,n1 , not 4: k1,m1,k1,n1. If you still need a full descriptor let me know, and I will send it to you... Regards, Sergey -Original Message- From: Armin Waibel [mailto:[EMAIL PROTECTED] Sent: Monday, October 24, 2005 1:09 PM To: OJB Users List Subject: Re: bug in OJB? 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: [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] ** ** 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: bug in OJB?
Hi Armin, I am using OJB 1.0.3 and only used link, didn't try object. I made a quick fix in MtoNBroker, that looks like it works for me now, please see the attached file. And find it under FIXED comment, The example I gave is simplified from the real. But I think it gives the idea where problem is- OJB assumes that (M to N) table has only different fields for M key and N key when actually in my case both keys are composite and some fields are common. M key: k1,m1 N key: k1,n1 So (M to N) table has only 3 keys: k1,m1,n1 , not 4: k1,m1,k1,n1. If you still need a full descriptor let me know, and I will send it to you... Regards, Sergey -Original Message- From: Armin Waibel [mailto:[EMAIL PROTECTED] Sent: Monday, October 24, 2005 1:09 PM To: OJB Users List Subject: Re: bug in OJB? 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
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: problems with autoincrement tables
Hi Matthieu, Did you try to use cascade-update=true on a reference to the collection of objects (M part in 1:M relationship) you are trying to update? Sergey -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, October 07, 2005 7:53 AM To: ojb-user@db.apache.org Subject: problems with autoincrement tables Dear fellow ojb users, i faced a problem with ojb: if you have a class A with the id of the column which is autoincremented, when you create a new object foo instance of A . OJB insert all the column excepted the autoincremented one, then fetch in the database the id of the newly stored object and set the Id in the object. When you insert an object with an id, OJB insert the object without the ID specified so the id is not the same in the database and in the object because in this case OJB don't fetch the new ID and don't update the object. With our DB2 z/OS database we are sometimes obliged to delete/insert object instead of updating the object (it's mandatory when of the updated column is a key of a partitionned table). In this case we fetch our object from the database, delete it, update the bean and store the object in the database. As it has been deleted OJB realize that the object need to be inserted (and not updated) but doesn't update the id of the java object. In a 1 to N relation this side effect is harmless but if you have inheritance in the database or a M to N relation then it's a big problem because when you insert the whole relation there are foreign key violation because of the difference of value between the bean and the database. Is this problem easy to solve ? Matthieu PATOU DINQ/DSIN/SIDM/VNVO/VOIN Téléphone 01 30 19 17 91 (29 17 91) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ** ** 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: subQueries in SELECT
Hi Jacob, I had a look, all test cases describe cases when subquery is used to check against condition in the where clause. There was no example how to use data from subquery in the main query result set... So I found examples that retrieve F1 from this query: select F1 from T1 where T1.F1 in (select F1 from T2) But I need something that retrieves F2: select F1 , (select F2 from T2 where T1.F1 = T2.F1) from T1 .. any ideas? Sergey -Original Message- From: Jakob Braeuchi [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 27, 2005 3:47 PM To: OJB Users List Subject: Re: subQueries in SELECT hi sergey, please have a look at the subquery-testcases in org.apache.ojb.broker.QueryTest. jakob Manukyan, Sergey schrieb: Folks, Can I represent in OJB this SQL statement: SELECT C.cust_id, (SELECT count(*) FROM purchases P WHERE P.cust_id = C.cust_id) FROM customer C ? It looks like this kind of SQL is much faster then when using SELECTS with GROUP BY and I would like to express it in OJB but didn't find how in documentation, 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: [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]
subQueries in SELECT
Folks, Can I represent in OJB this SQL statement: SELECT C.cust_id, (SELECT count(*) FROM purchases P WHERE P.cust_id = C.cust_id) FROM customer C ? It looks like this kind of SQL is much faster then when using SELECTS with GROUP BY and I would like to express it in OJB but didn't find how in documentation, 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: ArrayIndexOutOfBoundsException Exception
Hi Samuel, Had similar problem and the answer was that I was trying to map more columns in indirection table then existed in a class I was referring to, like f.e. I had : Class1(PK1) Class2(PK2,PK3) and IndirectionTable1(PK1,PK2,PK3) The the wrong thing I did was: Class1.Relation1(using IndirectionTable1)({PK1},{PK1,PK2,PK3}) - WRONG! - resulting in ArrayIndexOutOfBoundsException. As there are just two keys in Class2 not three!!! Class1.Relation1(using IndirectionTable1)({PK1},{PK2,PK3}) - CORRECT! Hope it helps, -Sergey -Original Message- From: Gru Samuel [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 14, 2005 3:11 AM To: 'OJB Users List' Subject: RE: ArrayIndexOutOfBoundsException Exception Hi, Last month, i had no aswer, so i already send my pb. ;-) Please help me. Thanks Samuel -Message d'origine- De : Gru Samuel [mailto:[EMAIL PROTECTED] Envoyé : vendredi 26 août 2005 10:45 À : Liste Ojb (E-mail) Objet : ArrayIndexOutOfBoundsException Exception Hi, We want to use the ojb 1.0.3 (actually, we have the 1.0.rc5 version) When i use this version, i have an ArrayIndexOutOfBoundsException exception. my descriptors are : class-descriptor class=fr.ouestfrance.xxx.ProcedureServeur table=proc collection-descriptor name=_Fonctions element-class-ref=fr.ouestfrance.xxx.FonctionParametreServeur auto-retrieve=true auto-update=true auto-delete=true orderby=nb_ordre sort=ASC indirection-table=procedurefonction fk-pointing-to-this-class column=id_proc/ fk-pointing-to-element-class column=id_fonctionparametree/ /collection-descriptor /class-descriptor class-descriptor class=fr.ouestfrance.xxx.FonctionParametreServeur table=fonctionparametree field-descriptor name=_Id column=id_fonctionparametree jdbc-type=numeric primarykey=true autoincrement=true access=readonly / collection-descriptor name=_Parametres element-class-ref=ParametreValoriseServeur auto-update=true auto-delete=true auto-retrieve=true orderby=nb_ordre sort=ASC indirection-table=fonctionparametrevalorise fk-pointing-to-this-class column=id_fonctionparametree/ fk-pointing-to-element-class column=id_parametrevalorise/ /collection-descriptor reference-descriptor name=_FonctionInstanciee class-ref=fr.ouestfrance.xxx.FonctionServeur auto-retrieve=true auto-update=false auto-delete=false foreignkey field-ref=_FonctionInstanciee::_Id / /reference-descriptor /class-descriptor class-descriptor class=fr.ouestfrance.xxx.ParametreValoriseServeur table=parametrevalorise field-descriptor name=_Id column=id_parametrevalorise jdbc-type=numeric primarykey=true autoincrement=true access=readonly/ ... /class-descriptor java.lang.ArrayIndexOutOfBoundsException: 2 at org.apache.ojb.broker.accesslayer.MtoNCollectionPrefetcher.buildMtoNImplemen torQuery(Unknown Source) at org.apache.ojb.broker.accesslayer.MtoNCollectionPrefetcher.buildMtoNImplemen torQueries(Unknown Source) at org.apache.ojb.broker.accesslayer.MtoNCollectionPrefetcher.prefetchRelations hip(Unknown Source) at org.apache.ojb.broker.core.QueryReferenceBroker.performRetrievalTasks(Unknow n Source) at org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(Unknown Source) at org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(Unknown Source) at org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(Unknown Source) at org.apache.ojb.broker.core.PersistenceBrokerImpl.getCollectionByQuery(Unknow n Source) at org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionByQuery( Unknown Source) at org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionByQuery( Unknown Source) Can you explain me where the error is in my descriptor ? When i read the src of the class, i see : String[] indFkCols = getFksToThisClass(); String[] indItemFkCols = getFksToItemClass(); FieldDescriptor[] pkFields = getOwnerClassDescriptor().getPkFields(); FieldDescriptor[] itemPkFields = getItemClassDescriptor().getPkFields(); String[] cols = new String[indFkCols.length + indItemFkCols.length]; int[] jdbcTypes = new int[indFkCols.length + indItemFkCols.length]; Do you think the last line is correct ? Why it isnt int[] jdbcTypes = new int[pkFields .length + itemPkFields .length]; ? Thanks, Samuel -- Les informations ou pièces jointes contenues dans ce message sont confidentielles. Seul
RE: ArrayIndexOutOfBoundsException Exception
Samuel: I am glad it helped it took me a while to figure it out myself... To OJB developers: Maybe it would be better to supply some kind of more meaningful error message like amount of columns in indirection table doesn't match amount of columns in a reference table? -Sergey -Original Message- From: Gru Samuel [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 14, 2005 10:17 AM To: 'OJB Users List' Subject: RE: ArrayIndexOutOfBoundsException Exception Thanks a lot, i think you give me the way to find the mistake. And i found a pb in a descriptor. I have a descriptor with two PKs, but in my database the associated table has just 1 PK. I ll modify it and will try to use the 1.0.3. Samuel. -Message d'origine- De : Manukyan, Sergey [mailto:[EMAIL PROTECTED] Envoyé : mercredi 14 septembre 2005 14:26 À : OJB Users List Objet : RE: ArrayIndexOutOfBoundsException Exception Hi Samuel, Had similar problem and the answer was that I was trying to map more columns in indirection table then existed in a class I was referring to, like f.e. I had : Class1(PK1) Class2(PK2,PK3) and IndirectionTable1(PK1,PK2,PK3) The the wrong thing I did was: Class1.Relation1(using IndirectionTable1)({PK1},{PK1,PK2,PK3}) - WRONG! - resulting in ArrayIndexOutOfBoundsException. As there are just two keys in Class2 not three!!! Class1.Relation1(using IndirectionTable1)({PK1},{PK2,PK3}) - CORRECT! Hope it helps, -Sergey -Original Message- From: Gru Samuel [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 14, 2005 3:11 AM To: 'OJB Users List' Subject: RE: ArrayIndexOutOfBoundsException Exception Hi, Last month, i had no aswer, so i already send my pb. ;-) Please help me. Thanks Samuel -Message d'origine- De : Gru Samuel [mailto:[EMAIL PROTECTED] Envoyé : vendredi 26 août 2005 10:45 À : Liste Ojb (E-mail) Objet : ArrayIndexOutOfBoundsException Exception Hi, We want to use the ojb 1.0.3 (actually, we have the 1.0.rc5 version) When i use this version, i have an ArrayIndexOutOfBoundsException exception. my descriptors are : class-descriptor class=fr.ouestfrance.xxx.ProcedureServeur table=proc collection-descriptor name=_Fonctions element-class-ref=fr.ouestfrance.xxx.FonctionParametreServeur auto-retrieve=true auto-update=true auto-delete=true orderby=nb_ordre sort=ASC indirection-table=procedurefonction fk-pointing-to-this-class column=id_proc/ fk-pointing-to-element-class column=id_fonctionparametree/ /collection-descriptor /class-descriptor class-descriptor class=fr.ouestfrance.xxx.FonctionParametreServeur table=fonctionparametree field-descriptor name=_Id column=id_fonctionparametree jdbc-type=numeric primarykey=true autoincrement=true access=readonly / collection-descriptor name=_Parametres element-class-ref=ParametreValoriseServeur auto-update=true auto-delete=true auto-retrieve=true orderby=nb_ordre sort=ASC indirection-table=fonctionparametrevalorise fk-pointing-to-this-class column=id_fonctionparametree/ fk-pointing-to-element-class column=id_parametrevalorise/ /collection-descriptor reference-descriptor name=_FonctionInstanciee class-ref=fr.ouestfrance.xxx.FonctionServeur auto-retrieve=true auto-update=false auto-delete=false foreignkey field-ref=_FonctionInstanciee::_Id / /reference-descriptor /class-descriptor class-descriptor class=fr.ouestfrance.xxx.ParametreValoriseServeur table=parametrevalorise field-descriptor name=_Id column=id_parametrevalorise jdbc-type=numeric primarykey=true autoincrement=true access=readonly/ ... /class-descriptor java.lang.ArrayIndexOutOfBoundsException: 2 at org.apache.ojb.broker.accesslayer.MtoNCollectionPrefetcher.buildMtoNImplemen torQuery(Unknown Source) at org.apache.ojb.broker.accesslayer.MtoNCollectionPrefetcher.buildMtoNImplemen torQueries(Unknown Source) at org.apache.ojb.broker.accesslayer.MtoNCollectionPrefetcher.prefetchRelations hip(Unknown Source) at org.apache.ojb.broker.core.QueryReferenceBroker.performRetrievalTasks(Unknow n Source) at org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(Unknown Source) at org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(Unknown Source) at org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(Unknown Source) at org.apache.ojb.broker.core.PersistenceBrokerImpl.getCollectionByQuery(Unknow n Source) at org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionByQuery( Unknown Source
RE: Réf. : complex group, or subquery, or ... ?
Hi Mattieu, Thank you for reply but this approach doesn't work, I wasn't descriptive enough in my mail but that is exactly what I tried to do, Regards, Sergey -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, September 01, 2005 5:13 AM To: OJB Users List Subject: Réf. : complex group, or subquery, or ... ? Hi, you need to define relationship between T1 / T2 and T1/T3 then use the attribute name for the field (as defined in your repository_user.xml). For instance : T1: class Foo, attribute id -- F1, with a relationship fooBar1 to the class Bar1 and with a relationship fooBar2 to the class Bar2 T2: class Bar1, T3: class Bar2, your attributes for the reportQuery are : String [] attributes ={id,count(fooBar1),count(fooBar2)}; Cordialement Matthieu PATOU DINQ/DSIN/SIDM/VNVO/VOIN Téléphone 01 30 19 17 91 (29 17 91) Manukyan, Sergey [EMAIL PROTECTED] Pour com ojb-user@db.apache.org cc 30/08/2005 18:33 Objet complex group, or subquery, or ... Veuillez ? répondre à OJB Users List [EMAIL PROTECTED] che.org Folks, I have three tables: TABLE (FIELDS,...) : {(DATA),...} -- T1 (F1) : {(1)} T2 (F1,F2) : {(1,1),(1,2)} T3 (F1,F3) : {(1,10),(1,20),(1,30)} Need to make a report query to select : F1, count(T2), count(T3), So in given example need a result to be: 1, 2 , 3 I attempted to do it in the flowing way but it evidently didn't' work: ReportQueryByCriteria qry = QueryFactory.newReportQuery(T1.class, null); qry.setColumns(new String[] { F1, count(T2.*), count(T3.*) } qry.addGroupBy(new String[] { F1 } Can I use subqueries to do it? If so can anyone please give me a hint how I can do it, or point me in some other way I can do it with OJB, Thank you in advance, 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
complex group, or subquery, or ... ?
Folks, I have three tables: TABLE (FIELDS,...) : {(DATA),...} -- T1 (F1) : {(1)} T2 (F1,F2) : {(1,1),(1,2)} T3 (F1,F3) : {(1,10),(1,20),(1,30)} Need to make a report query to select : F1, count(T2), count(T3), So in given example need a result to be: 1, 2 , 3 I attempted to do it in the flowing way but it evidently didn't' work: ReportQueryByCriteria qry = QueryFactory.newReportQuery(T1.class, null); qry.setColumns(new String[] { F1, count(T2.*), count(T3.*) } qry.addGroupBy(new String[] { F1 } Can I use subqueries to do it? If so can anyone please give me a hint how I can do it, or point me in some other way I can do it with OJB, Thank you in advance, 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.
OJB report query
Folks, I am repeating my question here as obviously it stands as a problem for me now and either: 1. it cannot be solved by current OJB implementation 2. there is a solution I don't know about How can I specify expressions in OJB report query? F.e. I am making a report that as a column should produce addition of two table columns : qry.setColumns( new String[] { materialVariance + laborVariance } materialVariance and laborVariance are defined as field names in OJB repository, unfortunately this code doesn't work as OJB failes to make a mapping to actual table column names in SQL generation and makes SQL like: SELECT materialVariance + laborVariance FROM And of course there are no such columns in database table, Now I am forced to make substitution and instead of field names include column names in OJB query: qry.setColumns( new String[] { MATVAR + LABVAR } Which is evidently a bad way of using OJB that is increasing future maintenance. I am using RC4. Please tell me if there is or there is no solution for this problem in OJB as it looks like limitation for me, 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: OJB report query
thank you jacob, I have scarab account and am associated with OJB module, sergey -Original Message- From: Jakob Braeuchi [mailto:[EMAIL PROTECTED] Sent: Monday, March 22, 2004 3:29 PM To: OJB Users List Subject: Re: OJB report query hi sergey, do you have a scarab-account ? btw. this is what OJB242 is all about: OJB can not resolve criteria or columns containing multiple attributes. ie: upper(col1 || col2) this leads to problems with distinct count-queries, where we need concatenation to construct one distinct value based on the pks: SELECT count(distinct (key1 || key2 || key3)) jakob Manukyan, Sergey wrote: thank you jakob, scarab tells me: You do not have permission to view an issue with that ID. If you believe it is a valid ID, check with the project owner or system administrator any help? Sergey (I am associated with OJB module) -Original Message- From: Jakob Braeuchi [mailto:[EMAIL PROTECTED] Sent: Monday, March 22, 2004 2:16 PM To: OJB Users List Subject: Re: OJB report query hi sergey, ojb currently cannot handle multiple columns in one criteria. see http://nagoya.apache.org/scarab/issues/id/OJB242 jakob Manukyan, Sergey wrote: Folks, I am repeating my question here as obviously it stands as a problem for me now and either: 1. it cannot be solved by current OJB implementation 2. there is a solution I don't know about How can I specify expressions in OJB report query? F.e. I am making a report that as a column should produce addition of two table columns : qry.setColumns( new String[] { materialVariance + laborVariance } materialVariance and laborVariance are defined as field names in OJB repository, unfortunately this code doesn't work as OJB failes to make a mapping to actual table column names in SQL generation and makes SQL like: SELECT materialVariance + laborVariance FROM And of course there are no such columns in database table, Now I am forced to make substitution and instead of field names include column names in OJB query: qry.setColumns( new String[] { MATVAR + LABVAR } Which is evidently a bad way of using OJB that is increasing future maintenance. I am using RC4. Please tell me if there is or there is no solution for this problem in OJB as it looks like limitation for me, 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: [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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ** ** 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: OJB report query
hi jacob, By some miracle now I can see both issues ;) thank you again, sergey -Original Message- From: Jakob Braeuchi [mailto:[EMAIL PROTECTED] Sent: Monday, March 22, 2004 3:44 PM To: OJB Users List Subject: Re: OJB report query hi sergey, can you see other ojb issues ie. OJB179 ? can you access OJB242 when you do not use the link i posted ? jakob Manukyan, Sergey wrote: thank you jacob, I have scarab account and am associated with OJB module, sergey -Original Message- From: Jakob Braeuchi [mailto:[EMAIL PROTECTED] Sent: Monday, March 22, 2004 3:29 PM To: OJB Users List Subject: Re: OJB report query hi sergey, do you have a scarab-account ? btw. this is what OJB242 is all about: OJB can not resolve criteria or columns containing multiple attributes. ie: upper(col1 || col2) this leads to problems with distinct count-queries, where we need concatenation to construct one distinct value based on the pks: SELECT count(distinct (key1 || key2 || key3)) jakob Manukyan, Sergey wrote: thank you jakob, scarab tells me: You do not have permission to view an issue with that ID. If you believe it is a valid ID, check with the project owner or system administrator any help? Sergey (I am associated with OJB module) -Original Message- From: Jakob Braeuchi [mailto:[EMAIL PROTECTED] Sent: Monday, March 22, 2004 2:16 PM To: OJB Users List Subject: Re: OJB report query hi sergey, ojb currently cannot handle multiple columns in one criteria. see http://nagoya.apache.org/scarab/issues/id/OJB242 jakob Manukyan, Sergey wrote: Folks, I am repeating my question here as obviously it stands as a problem for me now and either: 1. it cannot be solved by current OJB implementation 2. there is a solution I don't know about How can I specify expressions in OJB report query? F.e. I am making a report that as a column should produce addition of two table columns : qry.setColumns( new String[] { materialVariance + laborVariance } materialVariance and laborVariance are defined as field names in OJB repository, unfortunately this code doesn't work as OJB failes to make a mapping to actual table column names in SQL generation and makes SQL like: SELECT materialVariance + laborVariance FROM And of course there are no such columns in database table, Now I am forced to make substitution and instead of field names include column names in OJB query: qry.setColumns( new String[] { MATVAR + LABVAR } Which is evidently a bad way of using OJB that is increasing future maintenance. I am using RC4. Please tell me if there is or there is no solution for this problem in OJB as it looks like limitation for me, 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: [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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ** ** 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe
RE: OJB report query
Jacob, Can we increase the priority-severity of this issue, as it really makes me now write ugly code... I can devote my time to work on it as well... Sergey -Original Message- From: Jakob Braeuchi [mailto:[EMAIL PROTECTED] Sent: Monday, March 22, 2004 3:44 PM To: OJB Users List Subject: Re: OJB report query hi sergey, can you see other ojb issues ie. OJB179 ? can you access OJB242 when you do not use the link i posted ? jakob Manukyan, Sergey wrote: thank you jacob, I have scarab account and am associated with OJB module, sergey -Original Message- From: Jakob Braeuchi [mailto:[EMAIL PROTECTED] Sent: Monday, March 22, 2004 3:29 PM To: OJB Users List Subject: Re: OJB report query hi sergey, do you have a scarab-account ? btw. this is what OJB242 is all about: OJB can not resolve criteria or columns containing multiple attributes. ie: upper(col1 || col2) this leads to problems with distinct count-queries, where we need concatenation to construct one distinct value based on the pks: SELECT count(distinct (key1 || key2 || key3)) jakob Manukyan, Sergey wrote: thank you jakob, scarab tells me: You do not have permission to view an issue with that ID. If you believe it is a valid ID, check with the project owner or system administrator any help? Sergey (I am associated with OJB module) -Original Message- From: Jakob Braeuchi [mailto:[EMAIL PROTECTED] Sent: Monday, March 22, 2004 2:16 PM To: OJB Users List Subject: Re: OJB report query hi sergey, ojb currently cannot handle multiple columns in one criteria. see http://nagoya.apache.org/scarab/issues/id/OJB242 jakob Manukyan, Sergey wrote: Folks, I am repeating my question here as obviously it stands as a problem for me now and either: 1. it cannot be solved by current OJB implementation 2. there is a solution I don't know about How can I specify expressions in OJB report query? F.e. I am making a report that as a column should produce addition of two table columns : qry.setColumns( new String[] { materialVariance + laborVariance } materialVariance and laborVariance are defined as field names in OJB repository, unfortunately this code doesn't work as OJB failes to make a mapping to actual table column names in SQL generation and makes SQL like: SELECT materialVariance + laborVariance FROM And of course there are no such columns in database table, Now I am forced to make substitution and instead of field names include column names in OJB query: qry.setColumns( new String[] { MATVAR + LABVAR } Which is evidently a bad way of using OJB that is increasing future maintenance. I am using RC4. Please tell me if there is or there is no solution for this problem in OJB as it looks like limitation for me, 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: [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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ** ** 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED
OJB report query
Folks, How can I specify expressions in OJB report query? I want it to select not a column but the sum of several columns, The code here doesn't work, it failes to recognize the names of field-descriptors. I use RC4. Thank you, -Sergey - ReportQueryByCriteria qry = QueryFactory.newReportQuery(PartQuote.class, criteria); qry.addOrderByAscending(partNum); qry.setColumns( new String[] { partNum, part.partDescription, supplierReviewedQuote, materialVariance + laborVariance + burdenVariance + sellGenAdminVariance + profitVariance + toolingVariance + packagingVariance + freightVariance + editVariance, annualVolume, supplierDeclinedQuote, toolingRequired }); Collection report = OJBBeanManager.getInstance().getReportByQuery(PartQuote.class, qry); ** ** 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
insert object, and don't specify a value for one of the fields
Folks, The thing is I need to insert a record where for one of the fields I want to omit value, not specify at all, not even null, nothing. So that in INSERT operation it will not be present at all and will be populated by the default value from database. Is there a way how I can do that? 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: insert object, and don't specify a value for one of the fields
Hi Armin, If I declare this field as readonly, then it will be always readonly, but I need to update on UPDATE operations, and omit on INSERT operations. I guess the possible solution I am seeking for could be to declare something like this: field-descriptor name=dateChanged column=DATECH jdbc-type=DATE use-database-default-if-null-on-insert-operations = true / Or can I somehow dynamically exclude this field from participating in operation, whatever this operation might be? Similar to ObjectModification class mechanism, but that will exclude this field from operation only for this Broker? I know I can dynamically change the class descriptor and set this field to anonymous and then revert it back to normal, but I am afraid this will impact other Brokers operations with this class, -Sergey -Original Message- From: Armin Waibel [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 04, 2004 11:30 AM To: OJB Users List Subject: Re: insert object, and don't specify a value for one of the fields Hi Sergey, Manukyan, Sergey wrote: Folks, The thing is I need to insert a record where for one of the fields I want to omit value, not specify at all, not even null, nothing. So that in INSERT operation it will not be present at all and will be populated by the default value from database. Is there a way how I can do that? you can try to declare field as access=readonly. regards, Armin 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: [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: insert object, and don't specify a value for one of the fields
Maybe I should give you my manager's phone number and you will explain it to him ... ;) I think in anyway we should have a mechanism to control what fields take part in operations. Regards. Sergey. -Original Message- From: Andy Malakov [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 04, 2004 2:24 PM To: OJB Users List Subject: Re: insert object, and don't specify a value for one of the fields Simplest solution may be to change business logic. Since you want it to be writable from OJB side, who said dateChanged should be initially set by database? Sorry :-) - Original Message - From: Manukyan, Sergey [EMAIL PROTECTED] To: 'OJB Users List' [EMAIL PROTECTED] Sent: Wednesday, February 04, 2004 1:31 PM Subject: RE: insert object, and don't specify a value for one of the fields Hi Armin, If I declare this field as readonly, then it will be always readonly, but I need to update on UPDATE operations, and omit on INSERT operations. I guess the possible solution I am seeking for could be to declare something like this: field-descriptor name=dateChanged column=DATECH jdbc-type=DATE use-database-default-if-null-on-insert-operations = true / Or can I somehow dynamically exclude this field from participating in operation, whatever this operation might be? Similar to ObjectModification class mechanism, but that will exclude this field from operation only for this Broker? I know I can dynamically change the class descriptor and set this field to anonymous and then revert it back to normal, but I am afraid this will impact other Brokers operations with this class, -Sergey -Original Message- From: Armin Waibel [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 04, 2004 11:30 AM To: OJB Users List Subject: Re: insert object, and don't specify a value for one of the fields Hi Sergey, Manukyan, Sergey wrote: Folks, The thing is I need to insert a record where for one of the fields I want to omit value, not specify at all, not even null, nothing. So that in INSERT operation it will not be present at all and will be populated by the default value from database. Is there a way how I can do that? you can try to declare field as access=readonly. regards, Armin 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: [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] - 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: insert object, and don't specify a value for one of the fields
Thank you Axel, I was thinking doing that if there is no other solution, -Sergey -Original Message- From: Guerrero, Axel [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 04, 2004 2:04 PM To: OJB Users List Subject: RE: insert object, and don't specify a value for one of the fields Another thing you can try is declare a second object to the same table... So that in you code you need to check whether you want to use the default values then you use this second object. If you need to fill all columns you use the original object. I have a table for persons which includes a blob (a photo).. I created several objects mapped to the same table.. one object has all the columns (except photo). another object has pk and photo. some objects only fetch (and save) a subset of data. It works because the layout of my application is such that this is possible. Axel Guerrero -Original Message- From: Manukyan, Sergey [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 04, 2004 12:31 PM To: 'OJB Users List' Subject: RE: insert object, and don't specify a value for one of the fields Hi Armin, If I declare this field as readonly, then it will be always readonly, but I need to update on UPDATE operations, and omit on INSERT operations. I guess the possible solution I am seeking for could be to declare something like this: field-descriptor name=dateChanged column=DATECH jdbc-type=DATE use-database-default-if-null-on-insert-operations = true / Or can I somehow dynamically exclude this field from participating in operation, whatever this operation might be? Similar to ObjectModification class mechanism, but that will exclude this field from operation only for this Broker? I know I can dynamically change the class descriptor and set this field to anonymous and then revert it back to normal, but I am afraid this will impact other Brokers operations with this class, -Sergey -Original Message- From: Armin Waibel [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 04, 2004 11:30 AM To: OJB Users List Subject: Re: insert object, and don't specify a value for one of the fields Hi Sergey, Manukyan, Sergey wrote: Folks, The thing is I need to insert a record where for one of the fields I want to omit value, not specify at all, not even null, nothing. So that in INSERT operation it will not be present at all and will be populated by the default value from database. Is there a way how I can do that? you can try to declare field as access=readonly. regards, Armin 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: [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] - 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: insert object, and don't specify a value for one of the fields
Unfortunately my boss is not OK with this solution. Thank you in any case, I will try to do per thread copying. One more solution could be to mimic the functionality of database on OJB level. That is to specify the default value that will be assigned to a field at creation of the object. I could have done it in the class's constructor but think this should be externalized in a class config file like init-value: field-descriptor name=dateChanged column=DATECH jdbc-type=DATE init-value = 0001-01-01 / -Sergey -Original Message- From: Andy Malakov [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 04, 2004 2:42 PM To: [EMAIL PROTECTED] Subject: Re: insert object, and don't specify a value for one of the fields That was friendly advise. At least in my case I found that my boss/our customers doesn't care of such details providing that their requirements are still OK. OJB is clearly missing fine-grained control here. Thus any workaround would be ugly. If all inserts happen in separated context you may also consider local patch to class registry (remove that attribute from per-thread copy of class metadata). - Original Message - From: Manukyan, Sergey [EMAIL PROTECTED] To: 'OJB Users List' [EMAIL PROTECTED] Sent: Wednesday, February 04, 2004 2:22 PM Subject: RE: insert object, and don't specify a value for one of the fields Maybe I should give you my manager's phone number and you will explain it to him ... ;) I think in anyway we should have a mechanism to control what fields take part in operations. Regards. Sergey. -Original Message- From: Andy Malakov [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 04, 2004 2:24 PM To: OJB Users List Subject: Re: insert object, and don't specify a value for one of the fields Simplest solution may be to change business logic. Since you want it to be writable from OJB side, who said dateChanged should be initially set by database? Sorry :-) - Original Message - From: Manukyan, Sergey [EMAIL PROTECTED] To: 'OJB Users List' [EMAIL PROTECTED] Sent: Wednesday, February 04, 2004 1:31 PM Subject: RE: insert object, and don't specify a value for one of the fields Hi Armin, If I declare this field as readonly, then it will be always readonly, but I need to update on UPDATE operations, and omit on INSERT operations. I guess the possible solution I am seeking for could be to declare something like this: field-descriptor name=dateChanged column=DATECH jdbc-type=DATE use-database-default-if-null-on-insert-operations = true / Or can I somehow dynamically exclude this field from participating in operation, whatever this operation might be? Similar to ObjectModification class mechanism, but that will exclude this field from operation only for this Broker? I know I can dynamically change the class descriptor and set this field to anonymous and then revert it back to normal, but I am afraid this will impact other Brokers operations with this class, -Sergey -Original Message- From: Armin Waibel [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 04, 2004 11:30 AM To: OJB Users List Subject: Re: insert object, and don't specify a value for one of the fields Hi Sergey, Manukyan, Sergey wrote: Folks, The thing is I need to insert a record where for one of the fields I want to omit value, not specify at all, not even null, nothing. So that in INSERT operation it will not be present at all and will be populated by the default value from database. Is there a way how I can do that? you can try to declare field as access=readonly. regards, Armin 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: [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: Do I need to create reference objects when storing object?
Armin, It is the same problem I am running into, I hoped anonymous keys can solve this but they didn't. Jure, thank you for the solution to call broker.retrieveAllReferences(mg21); Here is what I did as a fast workaround of this bug: Class Parent { private String foreignKey; private Child child; public void setForeignKey(String key){ this. foreignKey = key; child. setForeignKey(key); } } In this case you avoid the cost of calling broker.retrieveAllReferences(mg21); When all you want is to store the object in DB. -Sergey -Original Message- From: Armin Waibel [mailto:[EMAIL PROTECTED] Sent: Monday, January 26, 2004 5:04 AM To: OJB Users List Subject: Re: Do I need to create reference objects when storing object? Hi Jure, in a first scan I found - an 'access' attribute in reference-descriptor of Bmg21. I think reference-descriptor doesn't support such an attribute. - in reference-descriptor you set auto-update 'false'. Thus OJB will not store references automatic and set mg21_id, mg21_str to null. Think the problem is that OJB override the FK fields values with null, because the reference object Bmt05 was not found. I'm not sure, but this sounds like a bug. If the FK fields are set (non null), then OJB shouldn't override these values on insert. But if I add broker.retrieveAllReferences(mg21); before calling broker.store(mg21) then the object mg21 is stored without any errors. I assume Bmt05 object already exists. broker.retrieveAllReferences(mg21); materialize the Bmt05 reference in mg21. Now OJB find FK values for mg21_id, mg21_str in the materialized Bmt05 object. regards, Armin Jurica Viskovic wrote: Thanks Armin for taking the time Ok, this is my reporitory_user.xml class-descriptor class=model.obrazci.Bmg21 table=MG21 field-descriptor id=1 name=mg21_xx column=MG21_XX jdbc- type=INTEGER primarykey=true/ field-descriptor id=2 name=mg21_id column=MG21_ID jdbc- type=VARCHAR/ field-descriptor id=3 name=mg21_str column=MG21_STR jdbc- type=VARCHAR/ field-descriptor id=4 name=mg21_stat column=MG21_STAT jdbc- type=INTEGER/ field-descriptor id=5 name=mg21_user column=MG21_USER jdbc- type=VARCHAR/ field-descriptor id=6 name=mg21_used column=MG21_USED jdbc- type=TIMESTAMP/ field-descriptor id=7 name=mg21_rowf column=MG21_ROWF jdbc- type=INTEGER/ field-descriptor id=8 name=mg21_comf column=MG21_COMF jdbc- type=INTEGER/ field-descriptor id=9 name=mg21_shif column=MG21_SHIF jdbc- type=VARCHAR/ reference-descriptor name=mt05 class-ref=model.items.Bmt05 refresh=true auto-retrieve=true auto-update=false access=readonly foreignkey field-ref=mg21_id / foreignkey field-ref=mg21_str / /reference-descriptor class-descriptor class=model.items.Bmt05 table=MT05 field-descriptor id=1 name=mt05_id column=MT05_ID jdbc- type=VARCHAR primarykey=true / field-descriptor id=2 name=mt05_str column=MT05_STR jdbc- type=VARCHAR primarykey=true / field-descriptor id=3 name=mt05_koo column=MT05_KOO jdbc- type=VARCHAR/ field-descriptor id=4 name=mt05_mid column=MT05_MID jdbc- type=VARCHAR/ field-descriptor id=5 name=mt05_name column=MT05_NAME jdbc- type=VARCHAR/ field-descriptor id=6 name=mt05_rowf column=MT05_ROWF jdbc- type=INTEGER/ field-descriptor id=7 name=mt05_sfi column=MT05_SFI jdbc- type=VARCHAR/ /class-descriptor --- -- When I create Bmg21 mg21 = new Bmg21(); mg21.setMg21_xx(100); mg21.setMg21_id(BLABLA); mg21.setMg21_str(ZLS); and than try to save this object OJB sets mg21_id and mg21_str to null and I get exception that I can't insert null into MG21_ID. This is the source code try{ broker.beginTransaction(); broker.store(mg21); broker.commitTransaction(); }catch(PersistenceBrokerException e){ broker.abortTransaction(); broker.close(); logger.error(ERROR +e.getMessage()); return false; } But if I add broker.retrieveAllReferences(mg21); before calling broker.store(mg21) then the object mg21 is stored without any errors. This is the source code try{ broker.beginTransaction(); broker.retrieveAllReferences(mg21); broker.store(mg21); broker.commitTransaction();
multiple databases
Folks, Is there a way how I can simultaneously use multiple databases from OJB? 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.