Folks,
Why
java.org.apache.ojb.broker.accesslayer.JdbcAccessImpl.materializeObject(Clas
sDescriptor cld, Identity oid) doesn't resolve references?
Here is a javadoc excerpt:
/**
* performs a primary key lookup operation against RDBMS and
materializes
* an object from the resulting row. Only skalar attributes are filled
from
* the row, references are not resolved.
* @param oid contains the primary key info.
* @param cld ClassDescriptor providing mapping information.
* @return the materialized object, null if no matching row was found or
if
* any error occured.
*/
public Object materializeObject(ClassDescriptor cld, Identity oid)
throws PersistenceBrokerException
{
It created problems when I am using anonymous fields.
retVal = broker.getObjectByQuery(
new QueryByIdentity(example));
returns null, but the record exists!
Is there any workaround to keep using anonymous keys and be able to find
object by example?
Here is a class I am testing :
<class-descriptor class="beans.Tracking" table="SDRTII">
<field-descriptor name="diverseSuppNum" column="DIVSUP#"
jdbc-type="DECIMAL" primarykey="true" access="anonymous" />
<field-descriptor name="amount" column="AMOUNT" jdbc-type="DECIMAL" />
<reference-descriptor name="diverseSupplier"
class-ref="beans.DiverseSupplier">
<foreignkey field-ref="diverseSuppNum" />
</reference-descriptor>
</class-descriptor>
Thank you,
-Sergey