package ex.android.yaroslavlancelot.com.sql.activeandroid

import com.activeandroid.Model
import com.activeandroid.annotation.Column
import com.activeandroid.annotation.Table
import ex.android.yaroslavlancelot.com.sql.DBConstants

/**
 * Represent row in the database.
 *
 * @author Yaroslav Havrylovych
 */
@Table(name = DBConstants.TABLE_NAME, id = DBConstants.COLUMN_NAME_ID)
class Contact : Model {
    @Column(notNull = true, name = DBConstants.COLUMN_NAME_NAME)
    var name: String? = null

    @Column(notNull = true, name = DBConstants.COLUMN_NAME_SURNAME)
    var surname: String? = null

    @Column(notNull = true, name = DBConstants.COLUMN_NAME_PHONE_NUMBER)
    var phoneNumber: String? = null

    constructor() {
        //just for Ormlite
    }

    constructor(name: String, surname: String, phoneNumber: String) {
        this.name = name
        this.surname = surname
        this.phoneNumber = phoneNumber
    }
}
