-
Notifications
You must be signed in to change notification settings - Fork 933
Document "entity join" and "entity projection" #1619
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sounds good to me, I just have some minor suggestions.
@@ -141,12 +141,35 @@ var cats = sess.CreateCriteria<Cat>() | |||
.List<IDictionary>(); | |||
foreach ( IDictionary map in cats ) | |||
{ | |||
Cat cat = (Cat) map[CriteriaUtil.RootAlias]; | |||
Cat cat = (Cat) map[CriteriaSpecification.RootAlias]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So NH-2122 has missed this one, good spot.
</para> | ||
|
||
<programlisting><![CDATA[IList<Cat> uniquelyNamedCats = sess.CreateCriteria<Cat>("c") | ||
.CreateEntityAlias( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The auto-indent of IDE does not play very well with programlisting
. I usually take care of reducing default first indentation to the usual 4 spaces, to avoid code expanding a bit to fast to the left. (But in the case of this example and the others you have added, lines stay short so it should not be an issue, excepted being a small visual discrepancy with other code examples.)
<title>Join not associated entities (Entity joins or ad hoc joins)</title> | ||
<para> | ||
In criteria you have the ability to define a join to any entity, not just a mapped association. | ||
To achieve it use <literal>CreateEntityAlias</literal> and <literal>CreateEntityCriteria</literal>. For example: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems "for example" is used for enumerating possibilities while "by example" is used for providing one example. So maybe "By example" would be more appropriate here. (Same in QueryOver.)
|
||
<para> | ||
Or via <literal>Projections.RootEntity</literal> and <literal>Projections.Entity</literal> methods | ||
if more control over loaded entities required. For instance entity projections can be lazy loaded |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Partial sentence should be avoided. Or it can be done via
would be better than just Or via
.
if more control over loaded entities required
lacks an auxiliary, it should be: if more control over loaded entities is required
.
|
||
|
||
<sect1 id="querycriteria_entityjoin"> | ||
<title>Join not associated entities (Entity joins or ad hoc joins)</title> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Join entities without association
would sound better to me. (Same for QueryOver.)
@@ -350,6 +369,32 @@ IList<CatSummary> catReport = | |||
|
|||
</sect1> | |||
|
|||
<sect1 id="queryqueryover-projectionentities"> | |||
<title>Projection Entities</title> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think words should be inverted: Entities Projection
. (The previous section title about functions has the same issue.)
Forced push suggested changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added some additional minor adjustments. And I have launched the TeamCity release build, since this is the only build which build doc.
As requested by @fredericDelaporte in #1545 (comment) and #1471 (comment)
I feel pretty lousy at writing clear docs :) So @fredericDelaporte feel free to modify it in whatever way you think fit.