Embrace Your [HS]QL

I'd like to start with a confession.  I love SQL (and it's Hibernate counterpart HQL).  Its simplicity and elegance is remarkable.  Its expressive power is stunning.  It is almost universally disliked by developers.  Why is that?
The answer, at least to me, is pretty straightforward.  Developers spend a lot of their time programming, so that's where [...]

Should It Just Work?

Last Wednesday evening Sean Corfield and I were chatting over beers and he caught me by surprise with a statement he made.  We were talking about the ORM functionality in CF9, and he liked how it just worked.  You invoke a setter, and it gets to the database with nothing else.  I agree in theory, [...]

Domain Model Integrity

Unlike my last several posts, this one isn't ORM related.  At least not directly.  If you're using ORM, you necessarily care about your domain model's integrity, as it's a prerequisite for ORM doing it's job, but it has nothing to do with ORM specifically.  The point of a domain model is to be a representation [...]

Want Multiple Persistence Contexts in CF9 ORM?

I do.  Because god knows front controllers and persistence layers don't have a one-to-one correspondence.  Turns out that through the magic of application switching you can do it, as long as you're careful with your sessions.  Not going to go into details right now, but this code works (and does what you'd expect):
<cfapplication name="ormtest1″ />
<cfset [...]

Don't Forget Inverse="true"!

When you're mapping relationships with Hibernate, you have to reconcile the uni-directional nature of Java references with the bi-directional nature of RDBMS foreign keys.  Consider this simple database schema with a single relationship:
+——–+    | PET     |
+ PERSON |    +———-+
+——–+    | [...]

Why ORM Transactions are Crucial

Continuing the transactions thread, I wanted to talk about a couple specific reasons that transactions are vitally important in ORM applications.  Even more than in raw-SQL applications.  I consider them mandatory anywhere, but I would argue that if you feel compelled to skip them for some reason, you'd be better off leaving them out of [...]

Transaction Demarcation

Transaction Demarcation

Transactions are important, and I wanted to talk about them a little, particularly as they relate to ORM.  If you're on the cf-orm-dev mailing list you've undoubtedly seen this topic come up over and over again.  And probably started muting conversations when my name shows up.  But before digging into the details, we need to [...]

CF9 ORM TransactionAdvice

As with any new persistence technology, CF9's ORM functionality has necessitated porting my TransactionAdvice for ColdSpring.  The previous "CFML" version was really "CFML/SQL/ORM" and is still the way to go if you're not using ORM functionality.  The new version (cf9ormtransactionadvice.cfc) is specific to ORM applications on CF9.0.  It will not provide transactionality for SQL-based apps [...]