<commit_before>/**
 * Directory base
 * Model technical/network/IPAddress
 * Copyright (C) 2015 Echinopsii
 * Author : <NAME>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package net.echinopsii.ariane.community.core.directory.base.model.technical.network;

import net.echinopsii.ariane.community.core.directory.base.model.technical.system.OSInstance;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;
import java.io.Serializable;
import java.net.Inet4Address;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.HashMap;


@Entity
@XmlRootElement
@Table(name="ipaddress", uniqueConstraints = @UniqueConstraint(columnNames = {"id"}))
public class IPAddress implements Serializable {
    private static final Logger log = LoggerFactory.getLogger(IPAddress.class);

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "id", updatable = false, nullable = false)
    private Long id = null;

    @Version
    @Column(name = "version")
    private int version = 0;

    @Column(name = "ipAddress", nullable = false)
    @NotNull
    private String ipAddress;

    @Column(name = "fqdn", unique = true)
    private String fqdn;

    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(nullable = false)
    @NotNull
    private Subnet networkSubnet;

    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn
    private OSInstance osInstance;

    @OneToOne(fetch = FetchType.EAGER)
    @JoinColumn
    private NICard niCard;

    public Long getId() {<commit_msg>[ACC-200] setup one to one mapping<commit_after>/**
 * Directory base
 * Model technical/network/IPAddress
 * Copyright (C) 2015 Echinopsii
 * Author : <NAME>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package net.echinopsii.ariane.community.core.directory.base.model.technical.network;

import net.echinopsii.ariane.community.core.directory.base.model.technical.system.OSInstance;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;
import java.io.Serializable;
import java.net.Inet4Address;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.HashMap;


@Entity
@XmlRootElement
@Table(name="ipaddress", uniqueConstraints = @UniqueConstraint(columnNames = {"id"}))
public class IPAddress implements Serializable {
    private static final Logger log = LoggerFactory.getLogger(IPAddress.class);

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "id", updatable = false, nullable = false)
    private Long id = null;

    @Version
    @Column(name = "version")
    private int version = 0;

    @Column(name = "ipAddress", nullable = false)
    @NotNull
    private String ipAddress;

    @Column(name = "fqdn", unique = true)
    private String fqdn;

    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(nullable = false)
    @NotNull
    private Subnet networkSubnet;

    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn
    private OSInstance osInstance;

    @OneToOne(fetch = FetchType.EAGER, mappedBy="ripAddress")
    private NICard niCard;

    public Long getId() {
{'fraction_non_alphanumeric': 0.09265734265734266, 'fraction_numerical': 0.004589160839160839, 'mean_word_length': 4.160090191657272, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, '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': '1571907', 'n_tokens_mistral': 1351, 'n_tokens_neox': 1309, 'n_words': 429}