Skip to content

Instantly share code, notes, and snippets.

@kumarshantanu
Created August 31, 2010 02:46
Show Gist options
  • Save kumarshantanu/558449 to your computer and use it in GitHub Desktop.
Save kumarshantanu/558449 to your computer and use it in GitHub Desktop.
(in-txn db
(let [e (find-by-id blog-entry-meta 1)
c (EntryComment. {}
{:content "Comment #1"
:whenposted (new java.util.Date)
:name "Whatever"
:email "[email protected]"} )
saved (save-deps e [c])]
(ppe "Saved 1 child for entry (ID=1)" saved))
(let [e (find-by-id blog-entry-meta 2)
c1 (EntryComment. {}
{:content "Comment #2"
:whenposted (new java.util.Date)
:name "Phil\nNewline and \tTab"
:email "[email protected]"} )
c2 (EntryComment. {}
{:content "Comment #3"
:whenposted (new java.util.Date)
:name "Dominic"
:email "[email protected]"} )
saved (save-deps e [c1 c2])]
(ppe "Saved 2 children for entry (ID=2)" saved)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment