Re: RE: Another silly newbie mapping question
So, I iterated through the Collection of orderItems I had retrieved and extracted the offers attached by each manually and it worked. I guess I am to the point where I don't know why the getCollectionByQuery() won't pull automagically each Offer. Manual means work, but are very inefficient and I want to understand this just for the sake of understanding. JohnE - Original Message - From: [EMAIL PROTECTED] Date: Sunday, November 2, 2003 5:24 pm Subject: Re: RE: Another silly newbie mapping question > Still no clue on what is wrong with this. > > > > > - Original Message - > From: [EMAIL PROTECTED] > Date: Friday, October 31, 2003 3:19 pm > Subject: Re: RE: Another silly newbie mapping question > > > Thank you Robert, but Offers are permanent pieces of information > > in the database whereas OrderItems come and go. > > > > > > The site holds numerous Offers which are stored permanently in > the > > database. The customer has a shopping cart which is basically > an > > OrderItem based on those Offers. So when I get an OrderItem > from > > the database I just wanted to also be able to pull the > associated > > Offer though I would never want Offer to change. > > > > I have looked in the ojb's repository_junit.xml test cases which > > have always helped me in the past, but i think I am just missing > > something. The Collection of OrderItems pull, but not these > > attached Offer objects. I have verified the database, etc. > The > > messages don't seem to show it even attempting to pull the Offer. > > > > I have a similar reference for Member and Location that is > working > > so it is confusing to me. Thank you for any ideas as I am about > > plum out of them. > > > > JohnE > > > > > > > > > > > > > > > > - Original Message - > > From: Robert J Celestino <[EMAIL PROTECTED]> > > Date: Friday, October 31, 2003 10:11 am > > Subject: RE: Another silly newbie mapping question > > > > > Hello John, > > > > > > I think you want auto-update="true" instead of "false" here: > > > > > > > > > > > > > >name="offer" > > > > > >class- > > ref="com.jobbank.jobbank.model.offer.OfferVO"> > > > > > auto-retrieve="true" > > > > > >auto-update="false" > > > > > >auto-delete="false"> > > > > > > > > > > > > > > > > > > my thinking is that when you store the OrderItem the Offer is > > not > > > writen bacause auto-update is false. Then when reading the > > > OrderItem back out, the Offer is not there. > > > > > > Bob c > > > > > > > > > --- > - > > > Bob Celestino > > > SAS Research and Development > > > 919 - 531 - 9425 > > > [EMAIL PROTECTED] > > > > > > SAS - The Power to Know > > > > > > > > > > -Original Message- > > > > From: [EMAIL PROTECTED] [EMAIL PROTECTED] > > > > Sent: Friday, October 31, 2003 5:01 AM > > > > To: OJB Users List > > > > Subject: Re: Another silly newbie mapping question > > > > > > > > > > > > I give up for the night. BTW I am using Release Candidate 2. > > > > > > > > Not sure it matters, but I am using > > > > PersistentFieldClass=org.apache.ojb.broker.metadata.fieldacc > > > > ess.PersistentNestedFieldMaxPerformanceImpl so that I could > > > > use '->' Single Table Aggregation as it wasn't implemented > > > > in the default implementation. > > > > > > > > From the archives it seemed ok to map multiple primary keys > > > > to one primary key. > > > > > > > > > > > > - Original Message - > > > > From: [EMAIL PROTECTED] > > > > Date: Friday, October 31, 2003 2:49 am > > > > Subject: Re: Another silly newbie mapping question > > > > > > > > > Still no luck. I noticed that my primary key order might > have> > > > something to do with it so I switched the order > within the > > > > > OrderItemVO mapping, but it didn't seem to help. I > > > > realized that > > > > > based on the logging that OJB does not seem to even be > > > trying to > > > > > materialize the OfferVO object as no notice is printed > > about > > > it > > > > > trying. Here is my logging: > > > > > > > > > > > > > > > [org.apache.ojb.broker.accesslayer.JdbcAccessImpl] DEBUG: > > > > > executeQuery : Query from class > > > > > com.jobbank.jobbank.model.order.OrderItemVO where > > > > > > > > > [EMAIL PROTECTED] > > > > oker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG: > > > > SQL:SELECT A0.modified,A0.offerid,A0.disabled,A0.mid,A0.offerq > > > > > uantity,A0.orderid,A0.buylater,A0.added FROM orderitem A0 > > > WHERE > > > > > (mid = ? ) AND orderid = ? > > > > > [org.apache.ojb.broker.accesslayer.JdbcAccessImpl] DEBUG: > > > > > executeQuery: [EMAIL PROTECTED]: > > > SELECT > > > > > > > > > A0.modified,A0.offerid,A0.disabled,A0.mid,A0.offerquantity,A > > > > 0.orderid,A0.buylater,A0.added FROM order
ERROR: Can't find member auth_resource in test.Auth_permission
Hi: I cannot find the source of my problem. :-( Is there a problem is the table has a name: "auth_resource"? (note the "_") What can be the cause of the error? Please help me. :-D The beans is pretty simple: public class Auth_permission implements java.io.Serializable { private Integerrol_id; private Integerres_id; public Integer getRol_id() { return rol_id; } public void setRol_id(Integer rol_id) { this.rol_id = rol_id; } //--- public Integer getRes_id() { return res_id; } public void setRes_id(Integer res_id) { this.res_id = res_id; } } The fragment in the repository is: This is the other class that said that cannot find: - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
XDoclet module support for latest DTD
Hi, I was wondering if the XDoclet module for OJB now supports the new element 'object-cache' ? e.g. ___ http://article.gmane.org/gmane.comp.jakarta.ojb.devel/3763 Regards Dougall Squair - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Inheritance & delete
Hello, sometime I'm back with the same question: I've 2 tables Transaction and ShopTransaction. ShopTransaction extends Transaction. I've the code public void apply() { logger.debug("apply"); logger.debug("transaction_id :" + transaction_id); transaction = new ShopTransaction(); transaction.setTransaction_id(transaction_id); Criteria crit = new Criteria(); crit.addEqualTo("transaction_id", new Integer(transaction_id)); Query query = QueryFactory.newQuery(ShopTransaction.class,crit); broker.beginTransaction(); broker.delete(transaction); broker.commitTransaction(); } I've the log 310 [main] DEBUG mascheroni.vendite.UCRollbackShopTransaction - transaction_id :2041 [org.apache.ojb.broker.accesslayer.JdbcAccessImpl] DEBUG: executeDelete : [EMAIL PROTECTED] [org.apache.ojb.broker.accesslayer.JdbcAccessImpl] DEBUG: executeDelete: [EMAIL PROTECTED]: DELETE FROM v4s_transaction WHERE transaction_id = 2022 [org.apache.ojb.broker.accesslayer.JdbcAccessImpl] DEBUG: executeDelete : [EMAIL PROTECTED] [org.apache.ojb.broker.accesslayer.JdbcAccessImpl] DEBUG: executeDelete: [EMAIL PROTECTED]: DELETE FROM fCO_transaction WHERE transaction_id = 2042 Why?!?!?!! This time I hope someone could help me - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: RE: Another silly newbie mapping question
Still no clue on what is wrong with this. - Original Message - From: [EMAIL PROTECTED] Date: Friday, October 31, 2003 3:19 pm Subject: Re: RE: Another silly newbie mapping question > Thank you Robert, but Offers are permanent pieces of information > in the database whereas OrderItems come and go. > > > The site holds numerous Offers which are stored permanently in the > database. The customer has a shopping cart which is basically an > OrderItem based on those Offers. So when I get an OrderItem from > the database I just wanted to also be able to pull the associated > Offer though I would never want Offer to change. > > I have looked in the ojb's repository_junit.xml test cases which > have always helped me in the past, but i think I am just missing > something. The Collection of OrderItems pull, but not these > attached Offer objects. I have verified the database, etc. The > messages don't seem to show it even attempting to pull the Offer. > > I have a similar reference for Member and Location that is working > so it is confusing to me. Thank you for any ideas as I am about > plum out of them. > > JohnE > > > > > > > > - Original Message - > From: Robert J Celestino <[EMAIL PROTECTED]> > Date: Friday, October 31, 2003 10:11 am > Subject: RE: Another silly newbie mapping question > > > Hello John, > > > > I think you want auto-update="true" instead of "false" here: > > > > > > > > > > >name="offer" > > > > >class- > ref="com.jobbank.jobbank.model.offer.OfferVO"> > > > > auto-retrieve="true" > > > > >auto-update="false" > > > > >auto-delete="false"> > > > > > > > > > > > > > > my thinking is that when you store the OrderItem the Offer is > not > > writen bacause auto-update is false. Then when reading the > > OrderItem back out, the Offer is not there. > > > > Bob c > > > > > > > > Bob Celestino > > SAS Research and Development > > 919 - 531 - 9425 > > [EMAIL PROTECTED] > > > > SAS - The Power to Know > > > > > > > -Original Message- > > > From: [EMAIL PROTECTED] [EMAIL PROTECTED] > > > Sent: Friday, October 31, 2003 5:01 AM > > > To: OJB Users List > > > Subject: Re: Another silly newbie mapping question > > > > > > > > > I give up for the night. BTW I am using Release Candidate 2. > > > > > > Not sure it matters, but I am using > > > PersistentFieldClass=org.apache.ojb.broker.metadata.fieldacc > > > ess.PersistentNestedFieldMaxPerformanceImpl so that I could > > > use '->' Single Table Aggregation as it wasn't implemented > > > in the default implementation. > > > > > > From the archives it seemed ok to map multiple primary keys > > > to one primary key. > > > > > > > > > - Original Message - > > > From: [EMAIL PROTECTED] > > > Date: Friday, October 31, 2003 2:49 am > > > Subject: Re: Another silly newbie mapping question > > > > > > > Still no luck. I noticed that my primary key order might have > > > > something to do with it so I switched the order within the > > > > OrderItemVO mapping, but it didn't seem to help. I > > > realized that > > > > based on the logging that OJB does not seem to even be > > trying to > > > > materialize the OfferVO object as no notice is printed > about > > it > > > > trying. Here is my logging: > > > > > > > > > > > > [org.apache.ojb.broker.accesslayer.JdbcAccessImpl] DEBUG: > > > > executeQuery : Query from class > > > > com.jobbank.jobbank.model.order.OrderItemVO where > > > > > > > [EMAIL PROTECTED] > > > oker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG: > > > SQL:SELECT A0.modified,A0.offerid,A0.disabled,A0.mid,A0.offerq > > > > uantity,A0.orderid,A0.buylater,A0.added FROM orderitem A0 > > WHERE > > > > (mid = ? ) AND orderid = ? > > > > [org.apache.ojb.broker.accesslayer.JdbcAccessImpl] DEBUG: > > > > executeQuery: [EMAIL PROTECTED]: > > SELECT > > > > > > > A0.modified,A0.offerid,A0.disabled,A0.mid,A0.offerquantity,A > > > 0.orderid,A0.buylater,A0.added FROM orderitem A0 WHERE (mid > > > = 2 ) AND orderid = 0 > > > > [org.apache.ojb.broker.accesslayer.RsIterator] DEBUG: > > > hasNext() -> > > > > true[org.apache.ojb.broker.accesslayer.RsIterator] DEBUG: > > > > hasNext() -> false > > > > [org.apache.ojb.broker.core.PersistenceBrokerImpl] DEBUG: > > > PB.close > > > > was called: > > [EMAIL PROTECTED] > > 8 > > > > TEST CartItem: [2|0|1|1|false|[2003-10-31 02:50:11.515|2003- > > 10-31 > > > > 02:50:11.515|false]|]WITH OFFER: null > > > > TEST: After ShoppingCartActions.populateMemberShoppingCart() > > > > > > > > > > > > > > > > > > > > > > > > > > > > - Original Message - > > > > From: [EMAIL PROTECTED] > > > > Date: Friday, October 31, 2003 1:56 am > > > > Subject: Another silly newbie mapping que
Re: Strategies to avoid RI constraint violations?
Hi Andy, That would be the perfect solution, but, alas, I have to stick to DB2 with no such goodie available... But thanks for the tip! Gerhard On Fri, 31 Oct 2003 10:46:50 -0500, "Andy Malakov" <[EMAIL PROTECTED]> wrote: >Hello Gerhard, > >Oracle allows defining "INITIALLY DEFERRED" constraints - checks are postponed till >the end of transaction. > >- Original Message - >From: "Gerhard Grosse" <[EMAIL PROTECTED]> >To: <[EMAIL PROTECTED]> >Sent: Wednesday, October 22, 2003 9:52 AM >Subject: Re: Strategies to avoid RI constraint violations? > > >> I just discovered that ((TransactionExt) tx).flush() might solve a lot >> of my problems... >> >> On Tue, 21 Oct 2003 16:57:30 +0200, Gerhard Grosse >> <[EMAIL PROTECTED]> wrote: >> >> >Hi, >> > >> >I just wonder what strategies others employ to avoid RI constraint >> >violations. It seems to me that these inevitably occur in larger >> >transactions on complex object models. Any hints other than turning RI >> >checking off altogether? (I'm short before doing so...) >> > >> >Thanks, >> >Gerhard >> >> >> >> - >> 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 possible to have the "any type" mapping as Hibernate?
Hi, I have been using OJB for some period. I am taking a project left by a partner that uses Hinbernate for persistence. So I start studying Hibernate. Hibernate has a mapping function called "any type mapping" that is defined as the follows: "The mapping element defines a polymorphic association to classes from multiple tables. This type of mapping always requires more than one column. The first column holds the type of the associated entity. The remaining columns hold the identifier. It is impossible to specify a foreign key constraint for this kind of association, so this is most certainly not meant as the usual way of mapping (polymorphic) associations." This kind of mapping is quite useful when dealing with fields of java.lang.Object or interface. However, as I know, there is no such support in OJB. I try to study the source code of OJB, but am still not able to figure out the way to modify it (The xml mapping handling code is a little hard to understand, just wonder if it is possible to re-write it with Jibx to make it more concise). Regards, Rice __ Do you Yahoo!? Exclusive Video Premiere - Britney Spears http://launch.yahoo.com/promos/britneyspears/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]