On Aug 9, 1:48 pm, Diego Mijelshon <[email protected]> wrote:
> Use SQL

Fair enough.  In that case, some (hopefully simple) closers regarding
CreateSQLQuery(), if I may?  Are the following statements correct?

 1.  The SQL supplied to CreateSQLQuery should be native to the DB
platform and is not subject to transformation by NHibernate, with the
exception of alias injection where specified by { }?
 2.  I would have to use SqlSelectBuilder and SessionFactory.Dialect
to create SQL to pass to CreateSQLQuery() if I wanted to be reasonably
DB-agnostic?
 3.  Named parameters are always specified with a colon (e.g. :p1) and
are not subject to the native DB parameter/variable format (@p1, :p1,
etc)?
 4.  Named parameters are not populated by string manipulation so are
reasonably safe from SQL injection?
 5.  .AddEntity() will perform the mapping of rows to entities and
store a single instance (per ID) of each in the underlying Session
cache so that changes are persisted on Flush/Commit?
 6.  .AddJoin() will add fetch semantics to an .AddEntity() that is
supplied (provided a real mapping exists between that in
the .AddEntity() and that in the .AddJoin())?

Finally, what is the expected return of .List() if:
 1.  more than one .AddEntity() is present?
 2.  more than one .AddEntity() is present with an .AddJoin()?

Is it essentially:

    new List() {
        new List() { FirstAddEntity, SecondAddEntity,
ThirdAddEntity(withJoinedCollection) }
        new List() { FirstAddEntity, SecondAddEntity,
ThirdAddEntity(withJoinedCollection) }
        new List() { FirstAddEntity, SecondAddEntity,
ThirdAddEntity(withJoinedCollection) }
        ...until rowcount?
    }

-- 
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