You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by "J. Russell Smyth" <dr...@cox.net> on 2002/12/06 09:27:22 UTC

[PATCH]Re: extents, ODMG, and multiple classes to one table

I have uploaded a set of patches that includes a test case and a fix for
this issue at:

http://scarab.werken.com/scarab/issues/id/OJB114

Thanks
Russell

On Fri, 2002-12-06 at 00:33, J. Russell Smyth wrote:
> I have verified this failure - and it is not just ODMG, but it is a
> particular problem of an Extent that contains only one class, and that
> class has an ojbConcreteClass attribute.
> 
> This may sound like an odd situation, but it could happen if you have an
> interface mapped to just one OJB concrete class, and it happened to me 
> during testing, as I have 2 classes mapped to one table, but there is an
> interface that only maps to one of them.
> 
> I have written a test for the problem, found, and corrected the problem
> in my working copy. I have posted an issue to scarab
> http://scarab.werken.com/scarab/issues/id/OJB114
> 
> and I will supply a patch as soon as OJB CVS is available again
> (apparently OJB CVS is down right now?
> 
> Russell
> 
> On Thu, 2002-12-05 at 16:50, J. Russell Smyth wrote:
> > It appears to me that extents do not work correctly when using ODMG and
> > multiple classes on a single table. I have a configuratation that works 
> > fine untill I add the ojbConcreteClass field descriptor
> > 
> > <field-descriptor 
> >       id="5"
> >       name="ojbConcreteClass"
> >       column="CLASS_NAME"
> >       jdbc-type="VARCHAR"
> >       nullable="true"
> >       
> >     />
> > 
> > After I add this I can no longer query (using OQL) the extent.
> > 
> > Can anyone verify that they have this working(or not)?
> > 
> > Thanks
> > Russell
> > 
> > 
> > 
> > --
> > To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> > For additional commands, e-mail: <ma...@jakarta.apache.org>
> > 
> 
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 



QueryBySql, please help me (URGENT)

Posted by Dhamodharan P <dh...@yahoo.co.uk>.
Dear all,

           I am using QueryBySql, its working fine for all record selection but its not working for DISTINCT, not even for specific column.Please help me, my project is in tight schedule.Just have look on my code:

package com.mxic.tdsplus;
import java.util.*;
import com.mxic.tdsplus.leadscan.*;
import org.apache.ojb.broker.query.*;
import org.apache.ojb.broker.PersistenceBroker;
import org.apache.ojb.broker.PersistenceBrokerFactory;


public class TestQueryBySql
{

  public TestQueryBySql() {
  }

 public static void main(String[] dhamu)
 {

   java.util.Iterator iter=null;
      try
        {
   PersistenceBroker broker=PersistenceBrokerFactory.defaultPersistenceBroker();//createPersistenceBroker("repository.xml");

  QueryBySQL queryBySql=new QueryBySQL(LotSummaryForm.class,"SELECT DISTINCT(LOT_NO) FROM LS_LOT_SUMMARY");
     System.out.println("Query " +queryBySql.getSql());
     Collection results = broker.getCollectionByQuery(queryBySql);

        iter = results.iterator();

    while(iter.hasNext())
    {
    LotSummaryForm lot_summary_form=(LotSummaryForm)iter.next();
    System.out.println("Lot_NO = "+lot_summary_form.getLot_no());

    }

       }
        catch (Exception ex)
        {
           ex.printStackTrace();
           System.out.println(ex.getMessage());
        }

    }
 }


Thanks in Advance

Dhamu

  




---------------------------------
With Yahoo! Mail you can get a bigger mailbox -- choose a size that fits your needs