<commit_before>/*******************************************************************************
 * Copyright (c) 2011, 2016 Eurotech and/or its affiliates and others
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Eurotech - initial API and implementation
 *
 *******************************************************************************/
package org.eclipse.kapua.service.user.internal;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Table;

import org.eclipse.kapua.commons.model.AbstractKapuaNamedEntity;
import org.eclipse.kapua.model.id.KapuaId;
import org.eclipse.kapua.service.user.User;
import org.eclipse.kapua.service.user.UserStatus;
import org.eclipse.kapua.service.user.UserType;

/**
 * User entity implementation.
 * 
 * @since 1.0
 *
 */
@Entity(name = "User")
@Table(name = "usr_user")
public class UserImpl extends AbstractKapuaNamedEntity implements User
{
    private static final long serialVersionUID = 4029650117581681503L;

    @Enumerated(EnumType.STRING)
    @Column(name = "status")
    private UserStatus        status;

    @Basic
    @Column(name = "display_name")
    private String            displayName;

    @Basic
    @Column(name = "email")
    private String            email;

    @Basic
    @Column(name = "phone_number")
    private String            phoneNumber;
    
    @Enumerated(EnumType.STRING)
    @Column(name = "user_type", updatable = false)
    private UserType          userType;
    
    @Basic
    @Column(name = "external_id", updatable = false)
    private String            externalId;

    /**
     * Constructor
     */
    public UserImpl()
    {
        super();
    }

    /**
     * Constructor
     * 
     * @param scopeId
     * @param name
     */
    public UserImpl(KapuaId scopeId,
                    String name)
    {<commit_msg>userType column is now not nullable<commit_after>/*******************************************************************************
 * Copyright (c) 2011, 2016 Eurotech and/or its affiliates and others
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Eurotech - initial API and implementation
 *
 *******************************************************************************/
package org.eclipse.kapua.service.user.internal;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Table;

import org.eclipse.kapua.commons.model.AbstractKapuaNamedEntity;
import org.eclipse.kapua.model.id.KapuaId;
import org.eclipse.kapua.service.user.User;
import org.eclipse.kapua.service.user.UserStatus;
import org.eclipse.kapua.service.user.UserType;

/**
 * User entity implementation.
 * 
 * @since 1.0
 *
 */
@Entity(name = "User")
@Table(name = "usr_user")
public class UserImpl extends AbstractKapuaNamedEntity implements User
{
    private static final long serialVersionUID = 4029650117581681503L;

    @Enumerated(EnumType.STRING)
    @Column(name = "status")
    private UserStatus        status;

    @Basic
    @Column(name = "display_name")
    private String            displayName;

    @Basic
    @Column(name = "email")
    private String            email;

    @Basic
    @Column(name = "phone_number")
    private String            phoneNumber;
    
    @Enumerated(EnumType.STRING)
    @Column(name = "user_type", updatable = false, nullable = false)
    private UserType          userType;
    
    @Basic
    @Column(name = "external_id", updatable = false)
    private String            externalId;

    /**
     * Constructor
     */
    public UserImpl()
    {
        super();
    }

    /**
     * Constructor
     * 
     * @param scopeId
     * @param name
     */
    public UserImpl(KapuaId scopeId,
                    String name)
    {
{'fraction_non_alphanumeric': 0.16295960054471176, 'fraction_numerical': 0.014979573309123922, 'mean_word_length': 3.185185185185185, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1699298', 'n_tokens_mistral': 1269, 'n_tokens_neox': 1204, 'n_words': 301}