I have the following code:
Session.CreateCriteria<Foo>("foo")
.CreateAlias("foo.Bar", "bar")
.SetProjections(Projections.SqlProjection("bar.FirstName + ' ' + bar.LastName));
The problem is with the alias for the bar table in the SqlProjection.
The Hibernate docs say that "the string {alias} will be replaced by the alias of the root entity", but doesn't give any hint how you could access the aliases for non-root entities.
Is this possible?