Re: [OJB-developers] problem with schema
Brought to you by:
thma
From: Thomas M. <tho...@ho...> - 2001-12-11 09:12:40
|
Hi again Bertrand, You are right, this is a bug. It's No. 26 on the ever growing todo list ! Thanks for your patience with OJB ! -- Thomas ber...@wa... wrote: > > Hi, > > I have some strange behavior when I try to use schema name for my tables > If I have something like this in my repository > > <ClassDescriptor id="1"> > <class.name>mmcalendar.object.ActionObject</class.name> > <schema.name>MMLCDTA</schema.name> > <table.name>MKMPAC</table.name> > <rowReader>mmcalendar.object.ActionObjectRowReader</rowReader> > <FieldDescriptor id="1"> > <field.name>_keyOpgn</field.name> > <column.name>OPGNAC</column.name> > <jdbc_type>INTEGER</jdbc_type> > <PrimaryKey>true</PrimaryKey> > </FieldDescriptor> > > I got the following sql > > select mkmpac.opgnac from mmlcdta.mkmpac > > which is not valid with DB2 > I should have > > select mmlcdta.mkmpac.opgnac from mmlcdta.mkmpac > ^^^^ > so maybe getListOfColumns(ClassDescriptor mif, boolean useFullNames) in > SqlGenerator should also add the schema when requestiong fullnames. > > Now when if I tried to solve my problem with a new schema > > <ClassDescriptor id="1"> > <class.name>mmcalendar.object.ActionObject</class.name> > <!-- <schema.name>MMLCDTA</schema.name> -> > <table.name>MMLCDTA.MKMPAC</table.name> > <rowReader>mmcalendar.object.ActionObjectRowReader</rowReader> > <FieldDescriptor id="1"> > <field.name>_keyOpgn</field.name> > <column.name>OPGNAC</column.name> > <jdbc_type>INTEGER</jdbc_type> > <PrimaryKey>true</PrimaryKey> > </FieldDescriptor> > > I received the following SQL > select mmlcdta.mkmpac.opgnac from mmlcdta.mmlcdta.mkmpac > > I finally realized that I had another Classdescriptor on the same > connection that also define a <schema.name>MMLCDTA</schema.name> > <ClassDescriptor id="4"> > <class.name>mmcalendar.object.EmployeeObject</class.name> > <schema.name>MMLCDTA</schema.name> > <table.name>MKMPGB</table.name> > > the schema is pusched to the connection and so it is used for all tables of > the same connection (the default one in may case). > I haven't tested what happens if all tables don't agree on the shcema to > use. > > So removing all <schema.name> tag and unisng the schema.table notation with > all my classes solved the problem > but It does look strange to me. > > Thank you > > Bertrand > > _______________________________________________ > Objectbridge-developers mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectbridge-developers |