// Path: src/main/java/org/lbogdanov/poker/core/Constants.java
// public static final int USER_EMAIL_MAX_LENGTH = 254;
// 
// Path: src/main/java/org/lbogdanov/poker/core/Constants.java
// public static final int USER_EXTERNAL_ID_MAX_LENGTH = 64;
// 
// Path: src/main/java/org/lbogdanov/poker/core/Constants.java
// public static final int USER_FIRST_NAME_MAX_LENGTH = 128;
// 
// Path: src/main/java/org/lbogdanov/poker/core/Constants.java
// public static final int USER_LAST_NAME_MAX_LENGTH = 128;


import static org.lbogdanov.poker.core.Constants.USER_EMAIL_MAX_LENGTH;
import static org.lbogdanov.poker.core.Constants.USER_EXTERNAL_ID_MAX_LENGTH;
import static org.lbogdanov.poker.core.Constants.USER_FIRST_NAME_MAX_LENGTH;
import static org.lbogdanov.poker.core.Constants.USER_LAST_NAME_MAX_LENGTH;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import com.google.common.base.Objects;
/**
 * Copyright 2012 Leonid Bogdanov
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.lbogdanov.poker.core;





/**
 * Represents a User.
 * 
 * @author Leonid Bogdanov
 */
@Entity
@Table(name = "USERS")
public class User extends AbstractEntity {

    @Column(name = "FIRST_NAME", length = USER_FIRST_NAME_MAX_LENGTH, nullable = false)
    private String firstName = "";
    @Column(name = "LAST_NAME", length = USER_LAST_NAME_MAX_LENGTH, nullable = true)
    private String lastName = "";
    @Column(name = "EMAIL", length = USER_EMAIL_MAX_LENGTH, nullable = true)
    private String email = "";
    @Column(name = "EXTERNAL_ID", length = USER_EXTERNAL_ID_MAX_LENGTH, nullable = false, unique = true)
    private String externalId = "";

    /**
     * Returns a user's first name.
     * 
     * @return the firstName
     */
    public String getFirstName() {
// Path: src/main/java/org/lbogdanov/poker/core/Constants.java
// public static final int USER_EMAIL_MAX_LENGTH = 254;
// 
// Path: src/main/java/org/lbogdanov/poker/core/Constants.java
// public static final int USER_EXTERNAL_ID_MAX_LENGTH = 64;
// 
// Path: src/main/java/org/lbogdanov/poker/core/Constants.java
// public static final int USER_FIRST_NAME_MAX_LENGTH = 128;
// 
// Path: src/main/java/org/lbogdanov/poker/core/Constants.java
// public static final int USER_LAST_NAME_MAX_LENGTH = 128;


// Path: src/main/java/org/lbogdanov/poker/core/User.java
import static org.lbogdanov.poker.core.Constants.USER_EMAIL_MAX_LENGTH;
import static org.lbogdanov.poker.core.Constants.USER_EXTERNAL_ID_MAX_LENGTH;
import static org.lbogdanov.poker.core.Constants.USER_FIRST_NAME_MAX_LENGTH;
import static org.lbogdanov.poker.core.Constants.USER_LAST_NAME_MAX_LENGTH;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import com.google.common.base.Objects;

/**
 * Copyright 2012 Leonid Bogdanov
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.lbogdanov.poker.core;





/**
 * Represents a User.
 * 
 * @author Leonid Bogdanov
 */
@Entity
@Table(name = "USERS")
public class User extends AbstractEntity {

    @Column(name = "FIRST_NAME", length = USER_FIRST_NAME_MAX_LENGTH, nullable = false)
    private String firstName = "";
    @Column(name = "LAST_NAME", length = USER_LAST_NAME_MAX_LENGTH, nullable = true)
    private String lastName = "";
    @Column(name = "EMAIL", length = USER_EMAIL_MAX_LENGTH, nullable = true)
    private String email = "";
    @Column(name = "EXTERNAL_ID", length = USER_EXTERNAL_ID_MAX_LENGTH, nullable = false, unique = true)
    private String externalId = "";

    /**
     * Returns a user's first name.
     * 
     * @return the firstName
     */
    public String getFirstName() {
        return firstName;