[quoted text, click to view] Aquila Deus <aquila_deus@yahoo.co.uk> wrote:
> I tried to use Hibernate for a web menu/permission management system a
> month ago. It's very convenient but not suitable for any complex
> things. In my case I was trying to create a table of menus and items
> which have foreign key references (parent menus) to the same table, and
> it simply crashes.
Were you using a release build, or the most current development one?
I've seen examples doing the same thing with no problems. Maybe there
was a fault and it's been fixed.
[quoted text, click to view] > Even if it doesn't crash, I wouldn't know how to optimize the db query
> performance.
That just means you need to learn to use Hibernate effectively. That's
going to take time, but most effective technologies take a bit of
learning to use effectively.
[quoted text, click to view] > It brings another SQL-like query language, but only works
> within your Java code, thus you can't isolate the db part and test it
> alone.
You can easily see the SQL which is generated, and look at that
closely. If you can't get the best SQL from Hibernate, you can specify
the SQL itself these days, but still get Hibernate to do the mapping.
(Personally I avoid the HQL syntax for the most part and use criteria
queries, so I'm even bothering to learn HQL.)
Also note that if you keep your DB access separate from other business
logic, you can still effectively isolate the DB part and test it on its
own. The difference is that you're testing it in the same way that the
rest of your code is going to use it.
[quoted text, click to view] > > Java mans love it very much, but i don't know if its going to be a
> nice way
> > in .NET
> >
> > You guys, what think about?
>
> Unless your db stuff could be done in toy RDBMS like MySQL, it really
> sux. The more you use it, the more troubles you will find.
Whereas I'm finding it to be *incredibly* helpful.
[quoted text, click to view] > After wasting three days on Hibernate I switched back to use stored
> procedures. I wrote down the API docs and implementation for SQL Server
> within a few days, no hassle at all, you get what you expect.
Well, there are certainly different needs and Hibernate won't be useful
for all projects, but it's fantastic for the stuff we're doing - and
will be especially so when we have to support Oracle as well.
Note that my experience has only been with Hibernate though - I haven't
tried NHibernate yet.
--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet