Subversion Repositories SmartDukaan

Rev

Rev 23357 | View as "text/plain" | Blame | Compare with Previous | Last modification | View Log | RSS feed

package com.spice.profitmandi.dao.entity.dtr;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import com.spice.profitmandi.dao.enumuration.dtr.AccountType;

@Entity
@Table(name="dtr.user_accounts")
public class UserAccount{
        /**
         * 
         */     
        @Id
        @GeneratedValue(strategy=GenerationType.IDENTITY)
        private int id;
        
        @Column(name = "user_id")
        private int userId;
        
        @Enumerated(EnumType.STRING)
        @Column(name = "account_type")
        private AccountType type ;
        
        @Column(name = "account_key")
        private int accountKey;
        
        
        public int getId() {
                return id;
        }
        public void setId(int id) {
                this.id = id;
        }
        public int getUserId() {
                return userId;
        }
        public void setUserId(int userId) {
                this.userId = userId;
        }
        public AccountType getType() {
                return type;
        }
        public void setType(AccountType accountType) {
                this.type = accountType;
        }
        public int getAccountKey() {
                return accountKey;
        }
        public void setAccountKey(int accountKey) {
                this.accountKey = accountKey;
        }
        
        
        @Override
        public int hashCode() {
                final int prime = 31;
                int result = 1;
                result = prime * result + id;
                return result;
        }
        @Override
        public boolean equals(Object obj) {
                if (this == obj)
                        return true;
                if (obj == null)
                        return false;
                if (getClass() != obj.getClass())
                        return false;
                UserAccount other = (UserAccount) obj;
                if (id != other.id)
                        return false;
                return true;
        }
        @Override
        public String toString() {
                return "UserAccounts [id=" + id + ", userId=" + userId + ", accountType=" + type + ", accountKey="
                                + accountKey + "]";
        }
        
}