by creating a query like this session.CreateQuery("from entity
where...") you will not be aware of sql statement errors until the
code is executed. you won't know it's broken until after the user
attempts to call it.
by placing the query in a mapping file (embedded resource) and using a
named query session.GetNamedQuery("getentities") the queries are
verified when the configuration builds the session factory; when the
entire application starts. now there are plenty of stop gaps
(development, testing, staging) to decrease the chance of malformed
queries making it to production.so in effect placing a query in a mapping file removes the concept of a magic string because the query is verified when the session is built. On Jun 25, 8:56 am, riccardo dozzo <[email protected]> wrote: > On Thu, Jun 24, 2010 at 5:37 PM, Fabio Maulo <[email protected]> wrote: > > and about "magic strings"... put it in the mapping and NH'll compile it at > > BuildSessionFactory and you don't have "magic strings" anymore. > > Mmhhh. > > As a begginner, I'm missing something... could you explain better? -- 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.
