469,954 Members | 1,907 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,954 developers. It's quick & easy.

NHibernate

Please,

i would like to know if there's a good idea use NHibernate at my programs
besides native data tier of .NET.

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?

Tks in adv
Fabiano
Nov 17 '05 #1
3 1555
Fabiano wrote:
Please,

i would like to know if there's a good idea use NHibernate at my programs besides native data tier of .NET.
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.

Even if it doesn't crash, I wouldn't know how to optimize the db query
performance. 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.

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.

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.

Nov 17 '05 #2
Aquila Deus <aq*********@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.
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.
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.
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.
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 - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 17 '05 #3
"Aquila Deus" <aq*********@yahoo.co.uk> skrev i en meddelelse
news:<11**********************@z14g2000cwz.googleg roups.com>...
Fabiano wrote:

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.

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.


I used Hibernate in a reasonlably complex project written in Java. There was
a learning curve associated with Hibernate (certainly more than 3 days), but
once you get past a certain point it is incredibly powerful and relieves you
of a lot of database stuff (I hate writing all that SQL). Sure there is XML
configuration etc, but I just loved being able to concentrate more on my
Java objects than on the database side of things.

I have never used (or heard of) Nhibernate before.

Peter
Nov 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Aquila Deus | last post: by
1 post views Thread by Hoffmania | last post: by
1 post views Thread by erin.sebastian | last post: by
5 posts views Thread by gaddoz | last post: by
reply views Thread by beantaxi | last post: by
4 posts views Thread by IceMan | last post: by
1 post views Thread by Alexander Vasilevsky | last post: by
14 posts views Thread by thj | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.