I don't get it.
is your classes not mapped to the db tables? how (or rather why) are you
using NH/AR at all then?



On Mon, Sep 8, 2008 at 5:39 PM, erikash <[EMAIL PROTECTED]> wrote:

>
> Thanks, i agree that it is important, but i can't change my scheme,
> i'm working on a monitoring app, and the database is being used by the
> real app...
>
> i wish that using hql (and thus mapping all the tables to classes),
> would be sufficient to persist the projection... (i wish i could
> implement that feature!!!)
>
> Erik.
>
> On Sep 8, 4:35 pm, "Ken Egozi" <[EMAIL PROTECTED]> wrote:
> > > is there a benefit for using HqlBasedQuery instead "CreateSQLQuery"?
> >
> > well HQL is working on the object driven domain model, while SQL is
> working
> > on the E/R model
> >
> > I'd try and use NamedQueries anyway, as they give you the nice effect of
> the
> > ability to switch from hql to sql without affecting the calling call at
> all
> >
> >
> >
> > On Mon, Sep 8, 2008 at 4:26 PM, erikash <[EMAIL PROTECTED]> wrote:
> >
> > > Thank you very much Ken, that's exactly the case...
> > > in my code i'm using the instance method "CreateSQLQuery()", in your
> > > blog post:
> >
> > >http://www.kenegozi.com/Blog/2006/10/08/projection-using-activerecord.
> ..
> >
> > > you used "HqlBasedQuery", i didn't use it because i didn't map all the
> > > tables used in the my sql query to objects. (there are too many of
> > > them)
> > > is there a benefit for using HqlBasedQuery instead "CreateSQLQuery"?
> > > AFAIK they both return typed objects...
> >
> > > On Sep 8, 2:05 pm, "Ken Egozi" <[EMAIL PROTECTED]> wrote:
> > > > my two pence:
> >
> > > > should i use projection to bind the grid to the data?
> >
> > > > yes.
> > > > Unless your persistable domain objects fits perfectly within the
> view,
> > > which
> > > > is not likely as you describe it as a complex thing, it's advisable
> to
> > > have
> > > > a single query building up the necessary projection for the view.
> >
> > > > > if so then how will i unbind the data, update my models and save
> the
> > > > > changes to the db?
> >
> > > > manually. That is - you load, populate and save the domain objects
> > > according
> > > > to the given DTO received from the view
> >
> > > > On Mon, Sep 8, 2008 at 9:39 AM, erikash <[EMAIL PROTECTED]> wrote:
> >
> > > > > Hi, I've asked this question on the activerecord forums, but i fill
> > > > > that this question may be more relevant here...
> > > > > i'm working on a new project that accesses a legacy database, which
> i
> > > > > cannot change/refactor.
> > > > > anyway, i have a view which contains a grid that has many columns
> > > > > coming from different tables in th db (and mapped to different
> objects
> > > > > in my domain layer), and that grid is open for modifications...
> should
> > > > > i use projection to bind the grid to the data? if so then how will
> i
> > > > > unbind the data, update my models and save the changes to the db?
> >
> > > > > Thanks in advance,
> > > > > Erik.
> >
> > > > --
> > > > Ken Egozi.
> > >http://www.kenegozi.com/bloghttp://www.musicglue.comhttp://www.castle.
> ..
> >
> > --
> > Ken Egozi.
> http://www.kenegozi.com/bloghttp://www.musicglue.comhttp://www.castleproject.orghttp://www.gotfriends.co.il
> >
>


-- 
Ken Egozi.
http://www.kenegozi.com/blog
http://www.musicglue.com
http://www.castleproject.org
http://www.gotfriends.co.il

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to