hi mauricio,

please file a bug report in scarab

<http://scarab.werken.com/scarab/issues/id/OJBxxxx>


jakob


Mauricio CASTRO wrote:

Hi Jacob,

I tried the RowReader alternative. As you predicted it failed, but not
exactly as you said. The query construction succeeded, but the query
returned duplicated instances (just for the classes that shares tables).

You know if the bug is already reported? I don't know where to fill a bug
report or where I can find the bug report list.


Thank you. Mauricio Castro

----------------------------------------------------

public class TaskReader extends RowReaderDefaultImpl {

 public TaskReader(ClassDescriptor cld){
   super(cld);
 }

 public static String cdf="classname";
 /**
  * Check if there is an attribute which tells us which concrete class is
to be instantiated.
  */
 protected ClassDescriptor selectClassDescriptor(Map row)
     throws PersistenceBrokerException{
   // check if there is an attribute which tells us which concrete class is
to be instantiated
   ClassDescriptor m_cld = getClassDescriptor();
   FieldDescriptor concreteClassFD = m_cld.getFieldDescriptorByName(cdf);

   if (concreteClassFD == null){
     return m_cld;
   }
   else{
     try{
       String concreteClass =
(String)row.get(concreteClassFD.getColumnName());
       if (concreteClass == null || concreteClass.trim().length() == 0){
         throw new PersistenceBrokerException(
             cdf+" field returned null or 0-length string");
       }
       else{
         concreteClass = concreteClass.trim();
       }
       ClassDescriptor result =
           m_cld.getRepository().getDescriptorFor(concreteClass);
       if (result == null){
         result = m_cld;
       }
       return result;
     }
     catch (PBFactoryException e){
       throw new PersistenceBrokerException(e);
     }
   }
 }


----- Original Message ----- From: "Jakob Braeuchi" <[EMAIL PROTECTED]>


hi mauricio,

well, imo it would be better to solve it in
PersistenceBrokerImpl#getRsIteratorFromQuery where a query is executed
for each extent.
only if the extents sit in the same table ojbconcreteclass is required.
i'm not sure wether a rowreader could solve the problem, it may be too
late because the query fails.

hth
jakob



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to