You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by Leandro Saad <le...@ibnetwork.com.br> on 2001/05/16 20:49:55 UTC
Problem using torque generated classes
Hi all,
I trying to do a Select using a Criteria like this
criteria.addSelectColumn(MyPEER.MyCOLUMN)
MyPEER.doSelect(criteria)
When MyPeer is fetching the results, the order of events is :
doSelect(criteria)
populateObjects()
row2Object()
populateObject()
.
.
.
populateObject() is throwing an exception because it tries to fetch
values that were not fetched by village
The only way to have a clue about the values it has to fetch is through
criteria, but criteria
is not available to populateObject().
Has anyone had this problem before ??
Is there another solution or I have to patch Torque so it passes a
reference to Criteria until populateObject() ??
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org
Re: Problem using torque generated classes
Posted by Leandro Saad <le...@ibnetwork.com.br>.
Hi Leon..
Ok... thanx
Leon Messerschmidt wrote:
>
> Hi Leandro,
>
> If you're not fetching all the columns you'll end up with incomplete
> objects. You're selecting rows anyway so a couple of extra columns probably
> won't kill you :-)
>
> If you really want control over what is selected you can look at the
> generated Base* and Base*Peer classes. You can write similar code, but only
> select the columns you need. I wouldn't recommend it, though.
>
> ~ Leon
>
> > Leon Messerschmidt wrote:
> > >
> > > Hi Leandro,
> > >
> > > Try this:
> > >
> > > // Fetch all the records
> > > Criteria criteria = new Criteria();
> > > Vector v = MyPEER.doSelect(criteria);
> > >
> > > Or this:
> > >
> > > // Fetch all the records where MyCOLUMN = "MyValue"
> > > Criteria criteria = new Criteria();
> > > criteria.add(MyPEER.MyCOLUMN, "MyValue");
> > > Vector v = MyPEER.doSelect(criteria);
> > >
> > > ~ Leon
> > >
> > Thanx Leon, but I just trying to avoid fetching all columns
> >
> > > ----- Original Message -----
> > > From: "Leandro Saad" <le...@ibnetwork.com.br>
> > > To: "Turbine-DEV" <tu...@jakarta.apache.org>
> > > Sent: Wednesday, May 16, 2001 8:49 PM
> > > Subject: Problem using torque generated classes
> > >
> > > > Hi all,
> > > > I trying to do a Select using a Criteria like this
> > > >
> > > > criteria.addSelectColumn(MyPEER.MyCOLUMN)
> > > > MyPEER.doSelect(criteria)
> > > >
> > > > When MyPeer is fetching the results, the order of events is :
> > > >
> > > > doSelect(criteria)
> > > > populateObjects()
> > > > row2Object()
> > > > populateObject()
> > > > .
> > > > .
> > > > .
> > > > populateObject() is throwing an exception because it tries to fetch
> > > > values that were not fetched by village
> > > > The only way to have a clue about the values it has to fetch is
> through
> > > > criteria, but criteria
> > > > is not available to populateObject().
> > > > Has anyone had this problem before ??
> > > > Is there another solution or I have to patch Torque so it passes a
> > > > reference to Criteria until populateObject() ??
> > > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: turbine-dev-help@jakarta.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-dev-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org
Re: Problem using torque generated classes
Posted by Leon Messerschmidt <le...@opticode.co.za>.
Hi Leandro,
If you're not fetching all the columns you'll end up with incomplete
objects. You're selecting rows anyway so a couple of extra columns probably
won't kill you :-)
If you really want control over what is selected you can look at the
generated Base* and Base*Peer classes. You can write similar code, but only
select the columns you need. I wouldn't recommend it, though.
~ Leon
> Leon Messerschmidt wrote:
> >
> > Hi Leandro,
> >
> > Try this:
> >
> > // Fetch all the records
> > Criteria criteria = new Criteria();
> > Vector v = MyPEER.doSelect(criteria);
> >
> > Or this:
> >
> > // Fetch all the records where MyCOLUMN = "MyValue"
> > Criteria criteria = new Criteria();
> > criteria.add(MyPEER.MyCOLUMN, "MyValue");
> > Vector v = MyPEER.doSelect(criteria);
> >
> > ~ Leon
> >
> Thanx Leon, but I just trying to avoid fetching all columns
>
> > ----- Original Message -----
> > From: "Leandro Saad" <le...@ibnetwork.com.br>
> > To: "Turbine-DEV" <tu...@jakarta.apache.org>
> > Sent: Wednesday, May 16, 2001 8:49 PM
> > Subject: Problem using torque generated classes
> >
> > > Hi all,
> > > I trying to do a Select using a Criteria like this
> > >
> > > criteria.addSelectColumn(MyPEER.MyCOLUMN)
> > > MyPEER.doSelect(criteria)
> > >
> > > When MyPeer is fetching the results, the order of events is :
> > >
> > > doSelect(criteria)
> > > populateObjects()
> > > row2Object()
> > > populateObject()
> > > .
> > > .
> > > .
> > > populateObject() is throwing an exception because it tries to fetch
> > > values that were not fetched by village
> > > The only way to have a clue about the values it has to fetch is
through
> > > criteria, but criteria
> > > is not available to populateObject().
> > > Has anyone had this problem before ??
> > > Is there another solution or I have to patch Torque so it passes a
> > > reference to Criteria until populateObject() ??
> > >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-dev-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org
Re: Problem using torque generated classes
Posted by Leandro Saad <le...@ibnetwork.com.br>.
Leon Messerschmidt wrote:
>
> Hi Leandro,
>
> Try this:
>
> // Fetch all the records
> Criteria criteria = new Criteria();
> Vector v = MyPEER.doSelect(criteria);
>
> Or this:
>
> // Fetch all the records where MyCOLUMN = "MyValue"
> Criteria criteria = new Criteria();
> criteria.add(MyPEER.MyCOLUMN, "MyValue");
> Vector v = MyPEER.doSelect(criteria);
>
> ~ Leon
>
Thanx Leon, but I just trying to avoid fetching all columns
> ----- Original Message -----
> From: "Leandro Saad" <le...@ibnetwork.com.br>
> To: "Turbine-DEV" <tu...@jakarta.apache.org>
> Sent: Wednesday, May 16, 2001 8:49 PM
> Subject: Problem using torque generated classes
>
> > Hi all,
> > I trying to do a Select using a Criteria like this
> >
> > criteria.addSelectColumn(MyPEER.MyCOLUMN)
> > MyPEER.doSelect(criteria)
> >
> > When MyPeer is fetching the results, the order of events is :
> >
> > doSelect(criteria)
> > populateObjects()
> > row2Object()
> > populateObject()
> > .
> > .
> > .
> > populateObject() is throwing an exception because it tries to fetch
> > values that were not fetched by village
> > The only way to have a clue about the values it has to fetch is through
> > criteria, but criteria
> > is not available to populateObject().
> > Has anyone had this problem before ??
> > Is there another solution or I have to patch Torque so it passes a
> > reference to Criteria until populateObject() ??
> >
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org
Re: Problem using torque generated classes
Posted by Leon Messerschmidt <le...@opticode.co.za>.
Hi Leandro,
Try this:
// Fetch all the records
Criteria criteria = new Criteria();
Vector v = MyPEER.doSelect(criteria);
Or this:
// Fetch all the records where MyCOLUMN = "MyValue"
Criteria criteria = new Criteria();
criteria.add(MyPEER.MyCOLUMN, "MyValue");
Vector v = MyPEER.doSelect(criteria);
~ Leon
----- Original Message -----
From: "Leandro Saad" <le...@ibnetwork.com.br>
To: "Turbine-DEV" <tu...@jakarta.apache.org>
Sent: Wednesday, May 16, 2001 8:49 PM
Subject: Problem using torque generated classes
> Hi all,
> I trying to do a Select using a Criteria like this
>
> criteria.addSelectColumn(MyPEER.MyCOLUMN)
> MyPEER.doSelect(criteria)
>
> When MyPeer is fetching the results, the order of events is :
>
> doSelect(criteria)
> populateObjects()
> row2Object()
> populateObject()
> .
> .
> .
> populateObject() is throwing an exception because it tries to fetch
> values that were not fetched by village
> The only way to have a clue about the values it has to fetch is through
> criteria, but criteria
> is not available to populateObject().
> Has anyone had this problem before ??
> Is there another solution or I have to patch Torque so it passes a
> reference to Criteria until populateObject() ??
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-dev-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org