Skip to content

Instantly share code, notes, and snippets.

@ikai
Created July 11, 2009 01:53
Show Gist options
  • Save ikai/144989 to your computer and use it in GitHub Desktop.
Save ikai/144989 to your computer and use it in GitHub Desktop.
/*
Corresponding table:
CREATE TABLE `users` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(255) default NULL,
`admin` tinyint(1) default '0',
PRIMARY KEY (`id`)
)
*/
import _root_.javax.persistence._
@Entity
@Table{val name="users"}
class User {
@Id
@Column{val name="id"}
var id: Long = _
@Column{val name="name"}
var name: String = _
@Column{val name="admin"}
var isAdmin: Boolean = _
override def toString = "UserId: " + id + " isAdmin: " + isAdmin + " Name: " + name
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment