[OJB-developers] Field descriptor order requirement and primary keys
Brought to you by:
thma
From: John F. <jfr...@so...> - 2002-04-02 18:48:57
|
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 =3D m_mif.getPkFields(); Object[] pkValues =3D new Object[pkFields.length]; for (int i =3D 0; i < pkFields.length; i++) { fld =3D pkFields[i]; //pkValues[i] =3D JdbcAccess.getObjectFromColumn(m_rs, fld); ---> pkValues[i] =3D 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); } } |