[Engine-devel] SQL procedure - row mapper

Eli Mesika emesika at redhat.com
Tue May 21 06:54:26 UTC 2013



----- Original Message -----
> From: "Sahina Bose" <sabose at redhat.com>
> To: "Laszlo Hornyak" <lhornyak at redhat.com>
> Cc: "engine-devel" <engine-devel at ovirt.org>
> Sent: Friday, May 17, 2013 1:43:08 PM
> Subject: Re: [Engine-devel] SQL procedure - row mapper
> 
> Hi Laszlo,
> 
> I wanted a way to return a hook entity (GlusterHookEntity) as well as
> content of the hook. So had a single procedure getGlusterHookById(id
> UUID, includeContent BOOLEAN) but 2 dao methods
> getGlusterHook - returns GlusterHookEntity
> getGlusterHookContent - returns String (used a RowMapper to get only
> content from resultset)
> 
> But the second method caused a ClassCastException due to the first
> RowMapper being used.
> 
> Anyways, this is the patch where I changed the implementation to use
> separate sp - http://gerrit.ovirt.org/#/c/14832

This is the right way to do so , I will look at that patch 

> 
> thanks!
> sahina
> 
> On 05/17/2013 03:48 PM, Laszlo Hornyak wrote:
> > Hi Sahina,
> >
> > Could you share more details what you are trying to do?
> > A procedure always returns the same structure of data, so maybe it is more
> > simple if you to return all the data you received from the plpgsql stored
> > procedure and then just use the data mapped into the beans to build your
> > own data structures.
> >
> > Laszlo
> >
> > ----- Original Message -----
> >> From: "Sahina Bose" <sabose at redhat.com>
> >> To: "engine-devel" <engine-devel at ovirt.org>
> >> Sent: Friday, May 17, 2013 11:34:31 AM
> >> Subject: [Engine-devel] SQL procedure - row mapper
> >>
> >> Hi all,
> >>
> >> In org.ovirt.engine.core.dal.dbbroker.SimpleJdbcCallsHandler , there's a
> >> map maintained for procedure name and SimpleJdbcCall.
> >>
> >> If I have the same procedure with different row mappers, this results in
> >> an error - because the map already contains a mapping for the procedure
> >> name but with different row mapper.
> >>
> >> Do we intend to support calling the same procedure with different
> >> RowMappers? If so, I can change this class to handle this.
> >>
> >> thanks
> >> sahina
> >> _______________________________________________
> >> Engine-devel mailing list
> >> Engine-devel at ovirt.org
> >> http://lists.ovirt.org/mailman/listinfo/engine-devel
> >>
> 
> _______________________________________________
> Engine-devel mailing list
> Engine-devel at ovirt.org
> http://lists.ovirt.org/mailman/listinfo/engine-devel
> 



More information about the Devel mailing list