Wednesday, April 23, 2008

Many to many lazzziii

NHibernate's rock I scratched my head for a few hours looking at this code
DetachedCriteria filter = DetachedCriteria.For(typeof(Project))
.Add(Expression.Eq("ID", pid))
.SetProjection(Projections.Property("Type"));

DetachedCriteria q = DetachedCriteria.For(typeof(List_Output), "op")
.CreateCriteria("ProjectTypes")
.Add(Subqueries.Exists(filter));

return q.GetExecutableCriteria(
holder.CreateSession(typeof(List_Output))
).List();
Wonder why I got so many sql call to the server? the domain objects in the discussion context are Project has a Type and base on selected Type a project can choices a bunch of Outputs.
So Project is belong to a Type [One-to-Many], and Type has many Outputs where Output belong to Many Types [Many-to-Many].

What I found and fix is Lazzzzzzzziiiiiiiiiiiiiiii :))
I forgot to tell Type to load Outputs in a Lazy way and vise versa once that done I got only one YEAH ! I mean ONE sql call to the server to get what I asked for instead of 2 + N (where N is number of relevant Outputs in a Type)

Thanks to DetachedCriteria & the Laziness until next time today magic word is "Lazy = true"

Friday, April 18, 2008

Woh Woh storedprocedure no more ...

Read the title and want to know how to do that? come with me hacking the Castle code base or to be accurate hack NHibernate code base, what you need to bring along? not much but a SubVersion, NAnt, MbUnit and NUnit that sound enough ;)

Enjoy plug & play your database and let the Jedi rise
Happy Friday everyone !

Sunday, April 06, 2008

... and so there is a response

As I sad I love to see thing happen without me touching the code base :)) and how about the full fill my wish list?
Oh ! how about eclipse & it partner PDT? Vote it up so we "eclipse fan" can have it goes for Hardy as well ;)
Last but it the beast Ship Mono.19 with Ubuntu 8.04 go vote for it if we're true friend.

Encoded message

Rob Conery the man behind "SubSonic" a blogger like to post his though in a hex; wonder what on his mind? try this online hex converter http://www.dolcevie.com/js/converter.html

Thursday, April 03, 2008

Ubuntu 8.04 Hardy Heron - that for my mom

If you follow my previous post you might know what I've been doing so far, well i was messing around with Ubuntu 8.04 and if you ask me how was that? I would say "Yeah, It is an OS for my mom". How about you buddi? you asked. See the problem is Ubuntu 8.04 was developed for my mom it wasn't me ! :( that kind of sad isn't it?

Now let me express what make me feel this way, I guess you know who I am right? Oh ! com'on I knew you did hahaha I write VB, PHP, Java & C# tool I am expected to see in Hardy Heron
  • Eclipse 3.3 (sorry we got 3.2 )
  • Mono 1.9 (hm hmm, wait and see u might have it next release cycle)
  • MonoDevelop 1.0 (oh, isn't beta 3 work great for ya ?!)
the Ubuntu guy love to play with giant snake therefore all they care about is Python.

After all I might have to do I miss catch for 8.04 cuz my mom don't use any computer :(