My Scala Base

Adventures in Scala

Steve Yen
Share 
 

Steve Yen's Page

Gifts Received

Gift

Steve Yen has not received any gifts yet

Give Steve Yen a Gift

Latest Activity

Profile Information

Favorite Non-Scala Language:
Ruby
About Me:
Many years after learning Lisp, Java (since 0.9 alpha!), and after a 2 year stint in Ruby/Rails and JavaScript, I've discovered Scala...
My Tools / Platform:
debian, ruby, MySQL, Firefox, Firebug, editpad, rhino
Website:
http://trimpath.com

Steve Yen's Blog

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

Posted 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

Posted on January 24, 2008 at 7:08pm —

Steve Yen

Who would win? Lift versus the Autobots?

Found this awesome sounding creature on my lift explorations:

object User extends User with MetaMegaProtoUser[User, User with KeyedMetaMapper[Long, User]]

Meta Mega Proto User!!

Now… Continue

Posted on December 28, 2007 at 10:16am —

Steve Yen

Inline Scala Tables

Another whoa moment today -- ran across a pointed, concise Scala code snippet in Eric Torreborre's announcement of the specs 1.1 testing library...

"a calculator" should {
"provide an add operation" in {
"a" | "b" | "result" |>
1 ! 2 ! 3 |
5 ! 2 ! 7 |
3 ! 0 ! 3 | {
(a: Int, b: Int, result: Int) => { calc.add(a, b) must_== result }
}
}
}


The above is a great e… Continue

Posted on December 20, 2007 at 9:54am —

Steve Yen

Hmmm, Lift Uses Maven

While trying to get the latest version of the lift web framework (0.3.0) for Scala, I updated to maven 2.0.8, and then per the announcement instructions typed...

mvn archetype:create -U \
-DarchetypeGroupId=net.liftweb \
-DarchetypeArtifactId=lift-archetype-blank \
-DarchetypeVersion=0.3.0 \
-DremoteRepositories=http://scala-tools.org/repo-releases \
-DgroupId=com.test \
-DartifactId
Continue

Posted on December 19, 2007 at 9:30pm —

Comment Wall

You need to be a member of My Scala Base to add comments!

Join this social network

  • No comments yet!
 
 

About

Steve Yen Steve Yen created this social network on Ning.

Create your own social network!

 

© 2009   Created by Steve Yen on Ning.   Create Your Own Social Network

Badges  |  Report an Issue  |  Privacy  |  Terms of Service