RE: ReferenceDescriptor
Thanx, this is what i currenty doing, i just hopped for reference-descriptor in product solution. So i could get easier the products specials in my product, as i now that there is only one special per product. Claudio -Original Message- From: Armin Waibel [mailto:[EMAIL PROTECTED] Sent: Friday, August 06, 2004 10:58 AM To: OJB Users List Subject: Re: ReferenceDescriptor Claudio Romano wrote: If i have a Product associated 1:1 with an Special and it is modeled in the db such that the special table has a product_id (not primarykey!)... is there a way to map the Special with a ReferenceDescriptor in to the Product? well this sounds as Product has a 1:n relation with Special, because Special has an Product FK (product_id) and the Special has an 1:1 relation to Product. The FK 'product_id' have to represent the PK of Product. So you can declare a collection-descriptor in Product and an reference-descriptor in Special. regards, Armin thx Claudio - 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]
ReferenceDescriptor
If i have a Product associated 1:1 with an Special and it is modeled in the db such that the special table has a product_id (not primarykey!)... is there a way to map the Special with a ReferenceDescriptor in to the Product? thx Claudio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
M:N Mappings - OJB_BRANCH_1_0
Hi All, i just updated to OJB_BRANCH_1_0. Now i have some Problems with M:N mappings. (The categories_description has two primarkeys!!) I always get an exception when i try to get the CategoriesDesctiption from the Product. My Class-Descriptors: class-descriptor class=Products table=products field-descriptor id=1 name=id column=products_id jdbc-type=INTEGER autoincrement=true primarykey=true nullable=false length=11/ collection-descriptor element-class-ref=CategoriesDescription name=categoriesDesc indirection-table=products_to_categories auto-delete=false auto-update=false auto-retrieve=true refresh=true proxy=true fk-pointing-to-this-class column=products_id/ fk-pointing-to-element-class column=categories_id/ /collection-descriptor /class-descriptor class-descriptor class=CategoriesDescription table=categories_description field-descriptor id=1 name=categoriesId column=categories_id primarykey=true jdbc-type=INTEGER nullable=false length=11/ field-descriptor id=2 name=languageId column=language_id primarykey=true jdbc-type=INTEGER nullable=false length=11/ /class-descriptor class-descriptor class=ProductsToCategories table=products_to_categories field-descriptor id=1 name=productsId column=products_id jdbc-type=INTEGER primarykey=true nullable=false length=11 indexed=true/ field-descriptor id=2 name=categoriesId column=categories_id jdbc-type=INTEGER primarykey=true nullable=false length=11 indexed=true/ /class-descriptor The Exception java.lang.ArrayIndexOutOfBoundsException at java.lang.System.arraycopy(Native Method) at org.apache.ojb.broker.accesslayer.MtoNCollectionPrefetcher.associateBatc hed(MtoNCollectionPrefetcher.java:392) at org.apache.ojb.broker.accesslayer.MtoNCollectionPrefetcher.prefetchRelat ionship(MtoNCollectionPrefetcher.java:126) at org.apache.ojb.broker.core.QueryReferenceBroker$PBPrefetchingListener.pr efetch(QueryReferenceBroker.java:837) at org.apache.ojb.broker.core.QueryReferenceBroker$PBCollectionProxyListene r.beforeLoading(QueryReferenceBroker.java:894) at org.apache.ojb.broker.accesslayer.CollectionProxy.beforeLoading(Collecti onProxy.java:173) at org.apache.ojb.broker.accesslayer.CollectionProxy.getData(CollectionProx y.java:400) at org.apache.ojb.broker.accesslayer.CollectionProxy.iterator(CollectionPro xy.java:230) at Products.getCategoriesName(Products.java:198) I something wrong with my mapping? thanks in advance Claudio Romano www.lindos.ch yourshopadmin.sourceforge.net - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
SequenceManagerMySQLImpl
Hi all, i updated OJB from the rc3 to rc5. Now i have a problem with tables without an auto increment field. The Method afterStore in the SequenceManagerMySQLImpl class alway throws ArrayIndexOutOfBoundsException on these tables. Am i doing something wrong? This change causes my exception: diff -u -r1.14 -r1.15 public void afterStore(JdbcAccess dbAccess, ClassDescriptor cld, Object obj) throws SequenceManagerException { -FieldDescriptor fd = cld.getAutoIncrementField(); +FieldDescriptor fd = cld.getAutoIncrementFields()[0]; Thanks Claudio Romano - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: SequenceManagerMySQLImpl
Hi Thomas, thanks for the quick anwer! The tables that throws this exceptions don't have any autoincrement field on the database! So i can't declare this attribute?! Or am i missing something? Thanks Claudio Romano -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 11:47 AM To: OJB Users List Subject: Re: SequenceManagerMySQLImpl Hi Claudio, To work with sequence numbering you have to declare the respective attribute as autoincrement=true. If you don't do this you can not expect the sequence manager to work for those tables! Thomas Claudio Romano wrote: Hi all, i updated OJB from the rc3 to rc5. Now i have a problem with tables without an auto increment field. The Method afterStore in the SequenceManagerMySQLImpl class alway throws ArrayIndexOutOfBoundsException on these tables. Am i doing something wrong? This change causes my exception: diff -u -r1.14 -r1.15 public void afterStore(JdbcAccess dbAccess, ClassDescriptor cld, Object obj) throws SequenceManagerException { -FieldDescriptor fd = cld.getAutoIncrementField(); +FieldDescriptor fd = cld.getAutoIncrementFields()[0]; Thanks Claudio Romano - 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]
Sequence Manager
Hello ALL, i have a little question concerning OJB + MySQL + MySQLSequenceManager: How can i get the last inserted primarykey of a table? thank Claudio Romano - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Update and Save Problem
Hi i have a problem to update and/or save my class to the database. The repository and the class seems to be ok. But everytime i save or update my Class i become the following error: Cannot convert class java.lang.Integer to SQL type requested due to java.lang.ArrayIndexOutOfBoundsException - 2 can someone tell me when this happens?? or what im doing wrong? thanks Claudio Romano - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Update and Save Problem
and Save Problem hi claudio, a little bit more information could be useful. jakob Claudio Romano wrote: - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]