Lists all of the journal entries for the day.

Mon, 6 Jul 2009

11:18 PM - Cayenne and Joins

I've been experimenting with Apache Cayenne for work.  Earlier today, I got stumped by a complex database relationship in terms of Cayenne.  I can easily write a six table join to accomplish the query, but i wanted to find an object mapping approach instead.

I've learned several things about Cayenne.  First, it does not support outer joins from the built in object mapping.  It's possible to create outer and left joins with either SQLTemplate or performing a JDBC query directly.  

A SQLTemplate is a method to write a "real" SQL statement and either execute it as a non returning query or a select mapped to an existing Cayenne object.   You can even have it return raw rows back.  My first thought was that it would suck to do that because you'd lose the auto generating code for multiple database feature.  Actually, you can write alternate manual queries and register them for each major JDBC provider.  You write a generic default one that can work in most cases and then a tuned version (or whatever) for a specific database.   

The other option is to write a direct JDBC query and circumvent most of Cayenne.  You can still use it's database connection pool though.

DataSource ds = context.getParentDataDomain().getNode ("mydatanode").getDataSource(); Connection c = ds.getConnection();

tags: cayenne sql database

()

11:25 PM - Is Linux ready for the desktop?

Last Thursday, I setup a Linux box at work.  The idea was that it would at least be a bit more like a Mac or BSD box that I'm accustomed to.  Doing non windows development on a PC is painful without a UNIX like OS to me.  I just use a terminal too much.

So, I installed Ubuntu (the preferred distro at work) on a desktop system with an Intel Pentium D 3.2Ghz CPU and 2GB of RAM.   Day to day operation has been quite stable.  I haven't had any serious application crashes, lags, and power management has been working perfectly.  I can put the system to sleep better than Windows XP has ever worked for me.  All of the hardware I care about works.  I haven't bothered to test the sound.  

Even though I'm a BSD fan, I feel that I have to complement the linux community for progressing so far.  There is one issue I have with Ubuntu though.  There are some serious problems with their package management setup.  I'm not complaining about the tools, but rather the availability and quality of packages.  Midori crashes every time I try to use it and I think it's a mismatched webkit version.   Midori even works well on MidnightBSD, I'm not asking for a lot here.  Now that's one package, but there could be many others.  With a user interface that simple and the amount of help and money that project has at it's disposal, I expect more.  I know what we do with practically nobody.  The second problem is more general.  I could not install a JDK from their tools.  Due to the requirements, I needed a real JDK and not gcj.  A JRE was available, and that's fine for someone like my mom, but I need a java compiler.  I don't think it's too much to ask to expose the option in the GUI when it's possible from the command line.  Yes, I'm smart enough to go CLI, but what about a new computer science student trying to do a homework project?  This is a 2 click operation in windows and it comes with Xcode on the mac.  It's just easier on the first two platforms.  

I think some Linux distros are at the point that everyday folks could use them for basics at home.  They need some more polish, but that can happen.  

I still like our package management and ports system better, but we don't have those gui tools yet.   Still, considering microsoft doesn't have an installer like that for apps, it's certainly possible for linux to get marketshare.  It's it weird that microsoft has the best uninstaller (add/remove programs), but not a good "selector" for apps to install.  It's possible on windows, as you can see with Steam for games.  What if there was something like steam, but for apps?  

So, that means I need to set the bar higher for the BSD projects; mine in particular needs some real progress on the usability front.

()