Annotations or hbm.xml files

2 views
Skip to first unread message

Fernando

unread,
Nov 11, 2009, 4:58:59 PM11/11/09
to nhusers
Hi,

I'd like to know what is the best option for mapping, annotations or
hbm.xml files?

Thanks.

Diego Mijelshon

unread,
Nov 13, 2009, 6:46:06 AM11/13/09
to nhu...@googlegroups.com
Fernando,

There is no "best" option. You should use whatever you feel more comfortable with (that's why there are options!)

The only thing to consider is that hbm files are usually the only approach that supports all the advanced features, which makes them your only choice if you need them.

If you add the corresponding xsd file to Visual Studio, you'll even get intellisense and validation for hbms, which makes them really easy to use.

   Diego

Humberto Marchezi

unread,
Nov 13, 2009, 10:32:16 AM11/13/09
to nhu...@googlegroups.com
Hello Fernando,

Generally speaking:

*.hbm.xml :
- Best option when you need flexibility between data model and object model.
- Usually also best for legacy data models

*Fluent Automapper:
- Best option when data model will follow the object model
- Best option if you need speed and you dont want to spend time in manual mapping

Hope it helps;

sds
--
Humberto C Marchezi
---------------------------------------------------------
Master in Electrical Engineering - Automation
Software Consultant and Developer
at the Town Hall of Vitória
Reply all
Reply to author
Forward
0 new messages