You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by gayan sukumal wiharagoda <ga...@gmail.com> on 2012/05/07 13:10:34 UTC

Problem with select quary

Hi,
I am new to hibanate,Stuts and Tile. Now I want  to get selected
specified columns. I have mention the code below. It is not working.

List<SelelctItemList> list = new ArrayList<SelelctItemList>();
Query query = (Query) session.createQuery("select
s.item_id,s.name,s.unit_price_sel,s.unit_price_buy,su.quantity
from service_uses as su INNER JOIN stocks as s ON     su.item_id=s.item_id
where service_id="+ serviceId);
list = ((org.hibernate.Query) query).list();

Re: Problem with select quary

Posted by Dave Newton <da...@gmail.com>.
Yes.

(pardon brevity and typos, on cell)
On May 7, 2012 7:20 AM, "gayan sukumal wiharagoda" <
gayanwiharagoda@gmail.com> wrote:

> Hi Dave,
> Yes dave. But hibanate is with struts.Do I need to mave to hibanate mailing
> list.
> regards,
> Gayan.
>
> On Mon, May 7, 2012 at 4:41 PM, Dave Newton <da...@gmail.com> wrote:
>
> > Not a Struts question, yes?
> >
> > Dave
> >
> > (pardon brevity and typos, on cell)
> > On May 7, 2012 7:11 AM, "gayan sukumal wiharagoda" <
> > gayanwiharagoda@gmail.com> wrote:
> >
> > > Hi,
> > > I am new to hibanate,Stuts and Tile. Now I want  to get selected
> > > specified columns. I have mention the code below. It is not working.
> > >
> > > List<SelelctItemList> list = new ArrayList<SelelctItemList>();
> > > Query query = (Query) session.createQuery("select
> > > s.item_id,s.name,s.unit_price_sel,s.unit_price_buy,su.quantity
> > > from service_uses as su INNER JOIN stocks as s ON
> > su.item_id=s.item_id
> > > where service_id="+ serviceId);
> > > list = ((org.hibernate.Query) query).list();
> > >
> >
>

Re: Problem with select quary

Posted by gayan sukumal wiharagoda <ga...@gmail.com>.
Hi Dave,
Yes dave. But hibanate is with struts.Do I need to mave to hibanate mailing
list.
regards,
Gayan.

On Mon, May 7, 2012 at 4:41 PM, Dave Newton <da...@gmail.com> wrote:

> Not a Struts question, yes?
>
> Dave
>
> (pardon brevity and typos, on cell)
> On May 7, 2012 7:11 AM, "gayan sukumal wiharagoda" <
> gayanwiharagoda@gmail.com> wrote:
>
> > Hi,
> > I am new to hibanate,Stuts and Tile. Now I want  to get selected
> > specified columns. I have mention the code below. It is not working.
> >
> > List<SelelctItemList> list = new ArrayList<SelelctItemList>();
> > Query query = (Query) session.createQuery("select
> > s.item_id,s.name,s.unit_price_sel,s.unit_price_buy,su.quantity
> > from service_uses as su INNER JOIN stocks as s ON
> su.item_id=s.item_id
> > where service_id="+ serviceId);
> > list = ((org.hibernate.Query) query).list();
> >
>

Re: Problem with select quary

Posted by Dave Newton <da...@gmail.com>.
Not a Struts question, yes?

Dave

(pardon brevity and typos, on cell)
On May 7, 2012 7:11 AM, "gayan sukumal wiharagoda" <
gayanwiharagoda@gmail.com> wrote:

> Hi,
> I am new to hibanate,Stuts and Tile. Now I want  to get selected
> specified columns. I have mention the code below. It is not working.
>
> List<SelelctItemList> list = new ArrayList<SelelctItemList>();
> Query query = (Query) session.createQuery("select
> s.item_id,s.name,s.unit_price_sel,s.unit_price_buy,su.quantity
> from service_uses as su INNER JOIN stocks as s ON     su.item_id=s.item_id
> where service_id="+ serviceId);
> list = ((org.hibernate.Query) query).list();
>

Re: Problem with select quary

Posted by gayan sukumal wiharagoda <ga...@gmail.com>.
Hi,
Can some help me get fix this.

Cheers,
Gayan

On Mon, May 7, 2012 at 4:40 PM, gayan sukumal wiharagoda <
gayanwiharagoda@gmail.com> wrote:

> Hi,
> I am new to hibanate,Stuts and Tile. Now I want  to get selected
> specified columns. I have mention the code below. It is not working.
>
> List<SelelctItemList> list = new ArrayList<SelelctItemList>();
> Query query = (Query) session.createQuery("select s.item_id,s.name,s.unit_price_sel,s.unit_price_buy,su.quantity
> from service_uses as su INNER JOIN stocks as s ON     su.item_id=s.item_id
> where service_id="+ serviceId);
> list = ((org.hibernate.Query) query).list();
>