My Scala Base

Adventures in Scala

January 2008 Blog Posts (2)

Steve Yen More Hibernate In Scala: Annotations versus external XML versus inline XML

I've been tweaking the Hibernate in Scala example from my previous post.

The experiment is to interleave the hbm.xml mapping information right into your plain old scala object code. Sort of like a poor man's annotation, so you can keep your meta information right snug up to your properties. This helps get around Scala's current limitations around deep annotations (so I heard).

Here's an ex… Continue

Added by Steve Yen on January 24, 2008 at 11:40pm — 1 Comment

Steve Yen Hibernate with Scala example in one file

Just worked through Hibernate's tutorial, but using Scala. Googling for hints turned up info from Matt Hellige's blog(s) and Viktor Klang from the lift web group. So with a tip of the hat to them, here's a working example of using Hibernate from Scala, in a single file. Enjoy...

package scalanateimport scala.xml._
import java.util.Date
import org.hibernate._
import org.hibernate.cfg._

class Event {
  var id: Long = 0L 
  var title: String = null
  var date: Date = null 
  var p
Continue

Added by Steve Yen on January 24, 2008 at 7:08pm — No Comments

© 2009   Created by Steve Yen on Ning.   Create a Ning Network!

Badges  |  Report an Issue  |  Privacy  |  Terms of Service