/*
 * @(#)User.java 2012-9-4 下午23:59:06
 *
 * Copyright (c) 2011-2012 Makersoft.org all rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 *
 */
package org.makersoft.shards.domain;

/**
 * User domain for test.
 */
public class User extends AbstractShardEntity {

	private static final long serialVersionUID = -2426776467504642746L;

	public static final int SEX_MALE = 0;
	public static final int SEX_FEMALE = 1;

	private String username;

	private String password;
	
	private int age;

	private int gender;

	public User() {
	}

	/**
	 * 有参构造，方便测试用例初始化
	 */
	public User(String username, String password, int gender) {
		this.username = username;
		this.password = password;
		this.gender = gender;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public int getGender() {
		return gender;
	}

	public void setGender(int gender) {
		this.gender = gender;
	}

}

@@ -1275,11 +1275,962 @@
 %0D%0A%09%7D%0D%0A%0D%0A
+%09@Override%0D%0A%09public int hashCode() %7B%0D%0A%09%09final int prime = 31;%0D%0A%09%09int result = 1;%0D%0A%09%09result = prime * result + age;%0D%0A%09%09result = prime * result + gender;%0D%0A%09%09result = prime * result%0D%0A%09%09%09%09+ ((password == null) ? 0 : password.hashCode());%0D%0A%09%09result = prime * result%0D%0A%09%09%09%09+ ((username == null) ? 0 : username.hashCode());%0D%0A%09%09return result;%0D%0A%09%7D%0D%0A%0D%0A%09@Override%0D%0A%09public boolean equals(Object obj) %7B%0D%0A%09%09if (this == obj)%0D%0A%09%09%09return true;%0D%0A%09%09if (obj == null)%0D%0A%09%09%09return false;%0D%0A%09%09if (getClass() != obj.getClass())%0D%0A%09%09%09return false;%0D%0A%09%09User other = (User) obj;%0D%0A%09%09if (age != other.age)%0D%0A%09%09%09return false;%0D%0A%09%09if (gender != other.gender)%0D%0A%09%09%09return false;%0D%0A%09%09if (password == null) %7B%0D%0A%09%09%09if (other.password != null)%0D%0A%09%09%09%09return false;%0D%0A%09%09%7D else if (!password.equals(other.password))%0D%0A%09%09%09return false;%0D%0A%09%09if (username == null) %7B%0D%0A%09%09%09if (other.username != null)%0D%0A%09%09%09%09return false;%0D%0A%09%09%7D else if (!username.equals(other.username))%0D%0A%09%09%09return false;%0D%0A%09%09return true;%0D%0A%09%7D%0D%0A%0D%0A
 %7D%0D%0A

add copy right