Showing posts with label nHibernate. Show all posts
Showing posts with label nHibernate. Show all posts

Tuesday, June 24, 2008

nHibernate - a thing i like

I have a table: Act, and an other table Service Name
between them, there's an other table, that has actId and ServicenameId too ...

I needed somehow for the act object to see all the servicenames. somehow ... in a list maybe? or an ilist?

Here's how u do it:




< bag name="ServiceNameList" lazy="false" table="BOMMSS_ServiceNameAct">
< key column="TARFSS_ActId"/>
< many-to-many class="Atlas.Tariff.DataAccess.ServiceName,Atlas.Tariff.DataAccess" column="ServiceNameId"/>
< /bag>




in the mapping file (xml), and add something like this:




public IList ServiceNameList
{
get { return m_servicenamelist; }
set { m_isChanged |= (m_servicenamelist != value); m_servicenamelist = value; }
}




in the class def.

Thursday, June 5, 2008

nHibernate vs. Active Record

I have used nHibernate in 3 projects

read more on it here and here

I didn't like it because of the XML stuff.

next time i'll use Active Record (read more about that here), to see how that behaves, maybe i'll post something new afterwards ;)