title: Scala play anorm; Returned database object, get value of its properties in an unabsurd way
body: <p>Hello I am fairly new to Scala.<br/>
  I want to learn Scala because:</p>
  
  <ol>
  <li>To get rid of boiler plate code from Java. </li>
  <li>Play with different paradigms.</li>
  <li>Just for fun of learning new things</li>
  </ol>
  
  <p>I am following a <a href="http://scala.playframework.org/documentation/scala-0.9.1/guide2" rel="nofollow">tutorial</a> on plays website.</p>
  
  <p>Here is the tutorial code:</p>
  
  <pre><code>Player.create(Player(Id(1), "bob@gmail.com", "secret", "Bob", false)) 
  Post.create(Post(NotAssigned, "My 1st post", "Hello world", new Date, 1))
  </code></pre>
  
  <p>To get deeper knowledge I played around and modified the examples.<br/>
  I decided not to give the Player a predefined ID but let MySql assign it.<br/>
  In MySql I have defined the Player id as an int but Post id as an long. <em>// I will change this later but for this example it is important.</em></p>
  
  <p>But what shocked me is the way I did it, look at the second row. This is not the elegant at all.</p>
  
  <pre><code>val player = Player.create(Player(NotAssigned, "bob@gmail.com", "secret", "Bob", false)) 
  val id = player.get.id.get.get.asInstanceOf[Number].intValue()
  Post.create(Post(NotAssigned, "My 1st post", "Hello world", new Date, id)
  </code></pre>
  
  <p>Now to my question how do I get the Id as an int from the created player in a less absurd way?</p>