<commit_before>/*
 * Copyright 2016 Bridje Framework.
 *
 * 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.bridje.orm.srcgen.model;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import org.bridje.ioc.Ioc;

/**
 * This class represents a custom field, a field whos type is defined in a
 * separate jar, bridje will read the custom data type and generate an entity
 * field with the given class name and properties.
 */
@XmlAccessorType(XmlAccessType.FIELD)
public class CustomFieldInf extends FieldInfBase
{
    @XmlAttribute
    private String type;

    @XmlAttribute
    private Boolean autoIncrement;

    /**
     * The name of the custom field type.
     *
     * @return The name of the custom field type.
     */
    public String getType()
    {
        return type;
    }

    /**
     * The name of the custom field type.
     *
     * @param type The name of the custom field type.
     */
    public void setType(String type)
    {
        this.type = type;
    }

    /**
     * Determines when ever this field must be mark as an auto increment column
     * on the RDBMS.
     *
     * @return If the field is auto increment.
     */
    public boolean getAutoIncrement()
    {
        if (autoIncrement == null)
        {
            return false;
        }
        return autoIncrement;
    }

    /**
     * Sets when ever this field must be mark as an auto increment column
     * on the RDBMS.
     *
     * @param autoIncrement If the field is auto increment.
     */
    public void setAutoIncrement(boolean autoIncrement)
    {
        this.autoIncrement = autoIncrement;
    }

    @Override
    public String getJavaType()
    {
        CustomTypesProvider prov = Ioc.context().find(CustomTypesProvider.class);
        return prov.getJavaType(getType());
    }

    @Override
    public String getTableColumn()
    {
        CustomTypesProvider prov = Ioc.context().find(CustomTypesProvider.class);
        return prov.getColumnClass(getType());
    }
<commit_msg>Fix in custom fields<commit_after>/*
 * Copyright 2016 Bridje Framework.
 *
 * 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.bridje.orm.srcgen.model;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import org.bridje.ioc.Ioc;

/**
 * This class represents a custom field, a field whos type is defined in a
 * separate jar, bridje will read the custom data type and generate an entity
 * field with the given class name and properties.
 */
@XmlAccessorType(XmlAccessType.FIELD)
public class CustomFieldInf extends FieldInfBase
{
    @XmlAttribute
    private String type;

    @XmlAttribute
    private Boolean autoIncrement;

    /**
     * The name of the custom field type.
     *
     * @return The name of the custom field type.
     */
    public String getType()
    {
        return type;
    }

    /**
     * The name of the custom field type.
     *
     * @param type The name of the custom field type.
     */
    public void setType(String type)
    {
        this.type = type;
    }

    /**
     * Determines when ever this field must be mark as an auto increment column
     * on the RDBMS.
     *
     * @return If the field is auto increment.
     */
    public boolean getAutoIncrement()
    {
        if (autoIncrement == null)
        {
            return false;
        }
        return autoIncrement;
    }

    /**
     * Sets when ever this field must be mark as an auto increment column
     * on the RDBMS.
     *
     * @param autoIncrement If the field is auto increment.
     */
    public void setAutoIncrement(boolean autoIncrement)
    {
        this.autoIncrement = autoIncrement;
    }

    @Override
    public String getJavaType()
    {
        CustomTypesProvider prov = Ioc.context().find(CustomTypesProvider.class);
        String result = prov.getJavaType(getType());
        if(result == null) return "InvalidType";
        return result;
    }

    @Override
    public String getTableColumn()
    {
        CustomTypesProvider prov = Ioc.context().find(CustomTypesProvider.class);
        String result = prov.getColumnClass(getType());
        if(result == null) return "InvalidColumn";
        return result;
    }

{'fraction_non_alphanumeric': 0.07973298720563694, 'fraction_numerical': 0.0029668088262562583, 'mean_word_length': 2.586436170212766, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 6}, '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': '2895996', 'n_tokens_mistral': 1470, 'n_tokens_neox': 1443, 'n_words': 547}