Skip to content
Snippets Groups Projects
Select Git revision
  • 3c507afdb13fd9a5ffa52be8e41853542382ec8a
  • master default
  • rewrite
3 results

Account.scala

Blame
  • Account.scala 680 B
    package de.tobias.playpad.server.account
    
    import com.j256.ormlite.dao.ForeignCollection
    import com.j256.ormlite.field.{DatabaseField, ForeignCollectionField}
    import com.j256.ormlite.table.DatabaseTable
    
    /**
      * Created by tobias on 15.02.17.
      */
    @DatabaseTable(tableName = "Account") class Account() {
    
    	@DatabaseField(generatedId = true) val id: Int = 0
    	@DatabaseField(unique = true) var username: String = _ // Mail Address
    	@DatabaseField() var password: String = _
    	@ForeignCollectionField var sessions: ForeignCollection[Session] = _
    
    	def this(username: String, password: String) {
    		this()
    		this.username = username
    		this.password = password
    	}
    
    	def getId: Int = id
    }