Ok, I now have another question? Middlegen generated code that represents database columns as a class type. e.g. Table T_Employee has a foreign key Ipt_ID; it is just an int. Middlegen generated code that represents this as an object of T_IPT instead of just an int.
Is this right? What xdoclet tags do I need to put here to generate the mapping.xml? All I get is can not convert T_IPT to int???? Shouldn't it just be an int? Maybe I am missing the whole reason for JDO? Thanks! -----Original Message----- From: Cobble, Tim Sent: Wednesday, October 29, 2003 7:17 AM To: [EMAIL PROTECTED] Subject: Re: [castor-dev] Newbie: Relation Question Ok. Thanks! I appreciate it! That explains everything! Tim -----Original Message----- From: Bruce Snyder [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 29, 2003 12:09 AM To: [EMAIL PROTECTED] Subject: Re: [castor-dev] Newbie: Relation Question This one time, at band camp, Cobble, Tim said: CT>I have been attempting JDO for a few days. I have used Middlegen and it CT>generated a nice but unusable set of java JDO code. Next, I found CT>CastorOil on the 3rd party tools link. My question is about the CT>difference in the code. CT> CT>I have an Employee table (T_Employee). One attribute of Employee is CT>IPT. This is a foreign key linked to T_IPT.id. The Middlegen code CT>treats this attribute as a Collection of T_IPT. The CastorOil does not. CT>It is simply an attribute of type int. CT> CT>Which is "right"? Is right in the eye of the beholder or is one CT>implementation correct and the other incorrect? Tim, There is no right or wrong answer per se. It depends on the relationships between the classes (and therefore the tables). If this relationship is a one-to-many or a many-to-many, then the Collection is correct. If this relationship is a one-to-one, then the int is correct. Bruce -- perl -e 'print unpack("u30","<0G)[EMAIL PROTECTED]&5R\"F9E<G)E=\$\!F<FEI+F-O;0\`\`");' The Castor Project http://www.castor.org/ Apache Geronimo http://incubator.apache.org/projects/geronimo.html ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev
