Re: [OJB-developers] Field descriptor order requirement and primary keys
Brought to you by:
thma
From: Thomas M. <tho...@ho...> - 2002-04-02 20:00:49
|
Hi John, FieldDescriptor need a numeric ID. The Ids must ordered ascending according to the corresponding columns in the database table. The physical position in the xml repository is not important. HTH, Thomas There is some code that John Freeborg wrote: > Does OJB have a requirement that in the repository.xml file, all primary > key field descriptors must be first inside a class descriptor? > > I don't have it that way (my primary key field descriptor happened to be > number 4, not 1). After scratching my head a lot on why my query for a > collection looked so strange, I hauled out BugSeeker and found the > following code marked with ---> below that seems to assume a certain > primary key field descriptor order. Interestingly the line above that > is commented out doesn't appear to have this problem. > > Is this an unintended side effect of the optimization? Is this broken? > > Thanks, > - John > > >>From RsIterator.java in 0.8.361: > > protected Identity getIdentityFromResultSet() throws > PersistenceBrokerException > { > try > { > // fill primary key values from Resultset > FieldDescriptor fld; > FieldDescriptor[] pkFields = m_mif.getPkFields(); > Object[] pkValues = new Object[pkFields.length]; > > for (int i = 0; i < pkFields.length; i++) > { > fld = pkFields[i]; > //pkValues[i] = JdbcAccess.getObjectFromColumn(m_rs, > fld); > ---> pkValues[i] = m_row[i]; > } > // return identity object build up from primary keys > return new Identity(getExtentClass(), pkValues); > } > catch (Throwable t) > { > logger.error(t); > throw new PersistenceBrokerException(t); > } > } > > _______________________________________________ > Objectbridge-developers mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectbridge-developers > > > > |