//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2019.02.25 at 12:05:09 AM CET
//


package com.hack23.cia.model.internal.application.system.impl;


import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.Basic;
import javax.persistence.CascadeType;
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.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Version;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import com.hack23.cia.model.common.api.ModelObject;
import com.hack23.cia.model.common.impl.xml.XmlDateTimeTypeAdapter;


/**
 * <p>Java class for ApplicationSession complex type.
 *
 * <p>The following schema fragment specifies the expected content contained within this class.
 *
 * <pre>
 * &lt;complexType name="ApplicationSession"&gt;
 *   &lt;complexContent&gt;
 *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
 *       &lt;sequence&gt;
 *         &lt;element name="modelObjectId" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/&gt;
 *         &lt;element name="modelObjectVersion" type="{http://www.w3.org/2001/XMLSchema}int"/&gt;
 *         &lt;element name="createdDate" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0"/&gt;
 *         &lt;element name="destroyedDate" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0"/&gt;
 *         &lt;element name="ipInformation" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
 *         &lt;element name="userAgentInformation" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
 *         &lt;element name="sessionId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
 *         &lt;element name="userId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
 *         &lt;element name="locale" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
 *         &lt;element name="operatingSystem" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
 *         &lt;element name="screenSize" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
 *         &lt;element name="timeZone" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
 *         &lt;element name="sessionType" type="{http://system.application.internal.model.cia.hack23.com/impl}ApplicationSessionType" minOccurs="0"/&gt;
 *         &lt;element name="events" type="{http://system.application.internal.model.cia.hack23.com/impl}ApplicationActionEvent" maxOccurs="unbounded" minOccurs="0"/&gt;
 *       &lt;/sequence&gt;
 *     &lt;/restriction&gt;
 *   &lt;/complexContent&gt;
 * &lt;/complexType&gt;
 * </pre>
 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ApplicationSession", propOrder = {
    "modelObjectId",
    "modelObjectVersion",
    "createdDate",
    "destroyedDate",
    "ipInformation",
    "userAgentInformation",
    "sessionId",
    "userId",
    "locale",
    "operatingSystem",
    "screenSize",
    "timeZone",
    "sessionType",
    "events"
})
@Entity(name = "ApplicationSession")
@Table(name = "APPLICATION_SESSION")
@Inheritance(strategy = InheritanceType.JOINED)
public class ApplicationSession
    implements ModelObject
{

    /**
	 *
	 */
	private static final long serialVersionUID = 1L;
	protected Integer modelObjectId;
    protected int modelObjectVersion;
    @XmlElement(type = String.class)
    @XmlJavaTypeAdapter(XmlDateTimeTypeAdapter.class)
    @XmlSchemaType(name = "dateTime")
    protected Date createdDate;
    @XmlElement(type = String.class)
    @XmlJavaTypeAdapter(XmlDateTimeTypeAdapter.class)
    @XmlSchemaType(name = "dateTime")
    protected Date destroyedDate;
    protected String ipInformation;
    protected String userAgentInformation;
    protected String sessionId;
    protected String userId;
    protected String locale;
    protected String operatingSystem;
    protected String screenSize;
    protected String timeZone;
    @XmlSchemaType(name = "string")
    protected ApplicationSessionType sessionType;
    @XmlElement(nillable = true)
    protected List<ApplicationActionEvent> events;
    @XmlAttribute(name = "Hjid")
    protected Long hjid;

    /**
     * Gets the value of the modelObjectId property.
     *
     * @return
     *     possible object is
     *     {@link Integer }
     *
     */
    @Basic
    @Column(name = "MODEL_OBJECT_ID", precision = 10, scale = 0)
    public Integer getModelObjectId() {
        return modelObjectId;
    }

    /**
     * Sets the value of the modelObjectId property.
     *
     * @param value
     *     allowed object is
     *     {@link Integer }
     *
     */
    public void setModelObjectId(final Integer value) {
        this.modelObjectId = value;
    }

    /**
     * Gets the value of the modelObjectVersion property.
     *
     */
    @Version
    @Column(name = "MODEL_OBJECT_VERSION")
    public int getModelObjectVersion() {
        return modelObjectVersion;
    }

    /**
     * Sets the value of the modelObjectVersion property.
     *
     */
    public void setModelObjectVersion(final int value) {
        this.modelObjectVersion = value;
    }

    /**
     * Gets the value of the createdDate property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    @Basic
    @Column(name = "CREATED_DATE")
    @Temporal(TemporalType.TIMESTAMP)
    public Date getCreatedDate() {
        return createdDate;
    }

    /**
     * Sets the value of the createdDate property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setCreatedDate(final Date value) {
        this.createdDate = value;
    }

    /**
     * Gets the value of the destroyedDate property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    @Basic
    @Column(name = "DESTROYED_DATE")
    @Temporal(TemporalType.TIMESTAMP)
    public Date getDestroyedDate() {
        return destroyedDate;
    }

    /**
     * Sets the value of the destroyedDate property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setDestroyedDate(final Date value) {
        this.destroyedDate = value;
    }

    /**
     * Gets the value of the ipInformation property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    @Basic
    @Column(name = "IP_INFORMATION")
    public String getIpInformation() {
        return ipInformation;
    }

    /**
     * Sets the value of the ipInformation property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setIpInformation(final String value) {
        this.ipInformation = value;
    }

    /**
     * Gets the value of the userAgentInformation property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    @Basic
    @Column(name = "USER_AGENT_INFORMATION")
    public String getUserAgentInformation() {
        return userAgentInformation;
    }

    /**
     * Sets the value of the userAgentInformation property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setUserAgentInformation(final String value) {
        this.userAgentInformation = value;
    }

    /**
     * Gets the value of the sessionId property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    @Basic
    @Column(name = "SESSION_ID")
    public String getSessionId() {
        return sessionId;
    }

    /**
     * Sets the value of the sessionId property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setSessionId(final String value) {
        this.sessionId = value;
    }

    /**
     * Gets the value of the userId property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    @Basic
    @Column(name = "USER_ID")
    public String getUserId() {
        return userId;
    }

    /**
     * Sets the value of the userId property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setUserId(final String value) {
        this.userId = value;
    }

    /**
     * Gets the value of the locale property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    @Basic
    @Column(name = "LOCALE")
    public String getLocale() {
        return locale;
    }

    /**
     * Sets the value of the locale property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setLocale(final String value) {
        this.locale = value;
    }

    /**
     * Gets the value of the operatingSystem property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    @Basic
    @Column(name = "OPERATING_SYSTEM")
    public String getOperatingSystem() {
        return operatingSystem;
    }

    /**
     * Sets the value of the operatingSystem property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setOperatingSystem(final String value) {
        this.operatingSystem = value;
    }

    /**
     * Gets the value of the screenSize property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    @Basic
    @Column(name = "SCREEN_SIZE")
    public String getScreenSize() {
        return screenSize;
    }

    /**
     * Sets the value of the screenSize property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setScreenSize(final String value) {
        this.screenSize = value;
    }

    /**
     * Gets the value of the timeZone property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    @Basic
    @Column(name = "TIME_ZONE")
    public String getTimeZone() {
        return timeZone;
    }

    /**
     * Sets the value of the timeZone property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setTimeZone(final String value) {
        this.timeZone = value;
    }

    /**
     * Gets the value of the sessionType property.
     *
     * @return
     *     possible object is
     *     {@link ApplicationSessionType }
     *
     */
    @Basic
    @Column(name = "SESSION_TYPE")
    @Enumerated(EnumType.STRING)
    public ApplicationSessionType getSessionType() {
        return sessionType;
    }

    /**
     * Sets the value of the sessionType property.
     *
     * @param value
     *     allowed object is
     *     {@link ApplicationSessionType }
     *
     */
    public void setSessionType(final ApplicationSessionType value) {
        this.sessionType = value;
    }

    /**
     * Gets the value of the events property.
     *
     * <p>
     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a <CODE>set</CODE> method for the events property.
     *
     * <p>
     * For example, to add a new item, do as follows:
     * <pre>
     *    getEvents().add(newItem);
     * </pre>
     *
     *
     * <p>
     * Objects of the following type(s) are allowed in the list
     * {@link ApplicationActionEvent }
     *
     *
     */
    @OneToMany(targetEntity = ApplicationActionEvent.class, cascade = {
        CascadeType.ALL
    })
    @JoinColumn(name = "EVENTS_APPLICATION_SESSION_H_0")
    public List<ApplicationActionEvent> getEvents() {
        if (events == null) {
            events = new ArrayList<>();
        }
        return this.events;
    }

    /**
     *
     *
     */
    public void setEvents(final List<ApplicationActionEvent> events) {
        this.events = events;
    }

    public ApplicationSession withModelObjectId(final Integer value) {
        setModelObjectId(value);
        return this;
    }

    public ApplicationSession withModelObjectVersion(final int value) {
        setModelObjectVersion(value);
        return this;
    }

    public ApplicationSession withCreatedDate(final Date value) {
        setCreatedDate(value);
        return this;
    }

    public ApplicationSession withDestroyedDate(final Date value) {
        setDestroyedDate(value);
        return this;
    }

    public ApplicationSession withIpInformation(final String value) {
        setIpInformation(value);
        return this;
    }

    public ApplicationSession withUserAgentInformation(final String value) {
        setUserAgentInformation(value);
        return this;
    }

    public ApplicationSession withSessionId(final String value) {
        setSessionId(value);
        return this;
    }

    public ApplicationSession withUserId(final String value) {
        setUserId(value);
        return this;
    }

    public ApplicationSession withLocale(final String value) {
        setLocale(value);
        return this;
    }

    public ApplicationSession withOperatingSystem(final String value) {
        setOperatingSystem(value);
        return this;
    }

    public ApplicationSession withScreenSize(final String value) {
        setScreenSize(value);
        return this;
    }

    public ApplicationSession withTimeZone(final String value) {
        setTimeZone(value);
        return this;
    }

    public ApplicationSession withSessionType(final ApplicationSessionType value) {
        setSessionType(value);
        return this;
    }

    public ApplicationSession withEvents(final List<ApplicationActionEvent> events) {
        setEvents(events);
        return this;
    }

	@Override
	public final String toString() {
		return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
	}


    /**
     * Gets the value of the hjid property.
     *
     * @return
     *     possible object is
     *     {@link Long }
     *
     */
    @Id
    @Column(name = "HJID")
    @GeneratedValue(strategy = GenerationType.AUTO)
    public Long getHjid() {
        return hjid;
    }

    /**
     * Sets the value of the hjid property.
     *
     * @param value
     *     allowed object is
     *     {@link Long }
     *
     */
    public void setHjid(final Long value) {
        this.hjid = value;
    }

	@Override
	public final boolean equals(final Object obj) {
		return EqualsBuilder.reflectionEquals(this, obj);
	}

	@Override
	public final int hashCode() {
		return HashCodeBuilder.reflectionHashCode(this);
	}

}
