>> I thought OR mappers had the dynamic sql stuff worked out already?
>> Maybe that was just done as an example.
Nope! Dynamic SQL in Hibernate is just as bad as dynamic SQL without it. It's true that Hibernate has a query builder API, but it is of limited functionality and isn't very popular. They also have very neat SQL binding, which is actually quite nice. But it does nothing for dynamic SQL. You still end up with the same crap if/else nested mess....bracket here....quote there...etc.
Cheers,
Clinton
On 5/29/05, Ron Grabowski <[EMAIL PROTECTED]> wrote:
Last week I read that Paul Wilson had converted one of his WinForm
example apps for his WilsonORMapper to NHibernate:
http://weblogs.asp.net/pwilson/archive/2005/05/26/409042.aspx
Am I the only one who thinks hibernate mapping files are hard to
understand? Even for a simple app like that, the <hibernate-mapping>
node was huge. Maybe once I finish reading my Hibernate book I won't be
cursing under my breath so much when I have to parse those files in my
head :-/
That might be a good simple-ish example WinForm project for IBatisNet.
He just released v4 of his OR mapper too. I looked at the source for
one of his example projects and was surprised to see hard-coded sql
statements in the presentation tier:
string sql = "ContactId IN (SELECT ContactId FROM CategoryContacts
WHERE CategoryId = {0})";
string id = Global.Manager.QueryHelper.CleanValue(categoryId);
whereClause = string.Format(sql, id);
I thought OR mappers had the dynamic sql stuff worked out already?
Maybe that was just done as an example.
Paul's mapper implements the ObjectSpace syntax that is suppose to be
part of .Net 2. It looks like it takes the idea of the DataTable's
RowFilter property:
dataTable.DefaultView.RowFilter = "Id > 3";
and makes it a more general search language for all objects in the
system:
http://www.dotnetspider.com/technology/tutorials/ObjectSpaces.aspx
--- Ted Husted <[EMAIL PROTECTED]> wrote:
> On 5/27/05, Clinton Begin <[EMAIL PROTECTED]> wrote:
> > Looks like you iBATIS.NET dudes have some competition now too!
> >
> http://www.latticesoft.com/Products/LatticeDataMapper.aspx?tabindex=1
>
> Excellent! The more the merrier, I say :)
>
> <<I'm reminded of the small town that did not have enough work for
> one
> lawyer, but had more than enough work for two. >>
>
> Though, it seems they've been around for a new months at least. It
> looks like 1.0 was released in November 2004, and 1.1 in February
> 2005.
>
> Oddly, Lattice says they support SQL statements in the mapping file,
> but there does not seem to be a single example of that in the
> developer's guide. It's all stored procedure examples. I think we
> always had a least ~one~ example of a stored procedure :)
>
> Another of their three products is an enhancement of a ASP.NET
> starter
> kit. It wouldn't surprise me if there was some ported iBATIS code
> under the hood of their data mapper too. But, hey, that's why we
> have
> the Apache License.
>
> -Ted.
>
