AW: AW: AW: [Objectbridge-developers] generating mapping files an d da taba ses
Brought to you by:
thma
From: Mahler T. <tho...@it...> - 2001-08-24 10:35:15
|
Hi again, > -----Urspr=FCngliche Nachricht----- > Von: Ivan Toshkov [mailto:to...@cr...] > Gesendet: Donnerstag, 23. August 2001 17:14 > An: Mahler Thomas > Cc: 'Lasse Lindg=E5rd'; obj...@li... > Betreff: Re: AW: AW: [Objectbridge-developers] generating=20 > mapping files > and da taba ses >=20 >=20 > On Thu, 2001-08-23 at 16:40, Mahler Thomas wrote: > > > Unfortunately, there isn't quite enough data in the=20 > > > repository.xml file > > > to generate the correct SQL statements. So far, I don't=20 > know when to > > > generate 'NOT NULL' and the size of VARCHAR objects. > > >=20 > > > So, perhaps we should add this data to the XML? > > >=20 > >=20 > > Yes I have been thinking in this direction too. >=20 > Ok, I've added the following two attributes to jdbc_type:=20 > 'not-null' and > 'size'. The problem is that (even in the test repository) many = tables > are described in several places each, which can lead to inconsitency. > So, what do you think of the following form? >=20 > <MappingRepository> > <JdbcConnectionDescriptor id=3D"default"> > ... > </JdbcConnectionDescriptor> > <JdbcConnectionDescriptor id=3D"other"> > ... > </JdbcConnectionDescriptor> > ... I like this idea to keep the JdbcConnectionDescriptors out of the ClassDescriptors! > <TableDescriptor name=3D"table_name" id=3D"tableId" > [jdbc-ref=3D"other"]> > <ColumnDescriptor name=3D"columnName" [primaryKey=3D"yes|no"] > [not-null=3D"yes|no"] .../> > </TableDescriptor> > ... it's also good to have tables separately described from classes, as = several classes may be mapped to the same table! I think we need some more information for jdbc_type, as size works only = for CHAR(X) and VARCHAR(Y), but there are also things like DECIMAL(6,2) or NUMERIC(3,8) allowed in SQL ! Maybe it's also a good idea to have a switch [indexed=3D"yes|no"]. This = would allow to generate indexes on certain columns that are used in where = clauses. > <ClassDescriptor [table-ref=3D"tableId"]> > ... > <FieldDescriptor [column-name=3D"columnName"]> > ... > </FieldDescriptor> > </ClassDescriptor> > </MappingRepository> >=20 >=20 >=20 |