Created
January 4, 2013 22:45
-
-
Save natbusa/4458139 to your computer and use it in GitHub Desktop.
Example of jpa annotated entity in scala
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.natalinobusa.jpa | |
| import javax.persistence._ | |
| @Entity | |
| @Table(name = "buddy") | |
| class Buddy(first: String, last: String) { | |
| @Id | |
| @GeneratedValue(strategy = GenerationType.AUTO) | |
| var id: Int = _ | |
| var firstName: String = first | |
| var lastName: String = last | |
| def this() = this (null, null) | |
| override def toString = id + " = " + firstName + " " + lastName | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment