All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.nuiton.topia.it.mapping.TopiaItMappingBinderHelper Maven / Gradle / Ivy

There is a newer version: 4.0
Show newest version
package org.nuiton.topia.it.mapping;

import javax.annotation.Generated;
import org.nuiton.topia.it.mapping.test1.B12;
import org.nuiton.topia.it.mapping.test1.B13;
import org.nuiton.topia.it.mapping.test11.A11E;
import org.nuiton.topia.it.mapping.test12.A12A;
import org.nuiton.topia.it.mapping.test13.A13A;
import org.nuiton.topia.it.mapping.test14.A14A;
import org.nuiton.topia.it.mapping.test14.A14B;
import org.nuiton.topia.it.mapping.test14.B14A;
import org.nuiton.topia.it.mapping.test14.B14C;
import org.nuiton.topia.it.mapping.test15.A15A;
import org.nuiton.topia.it.mapping.test16.A16;
import org.nuiton.topia.it.mapping.test16.B16;
import org.nuiton.topia.it.mapping.test16.C16;
import org.nuiton.topia.it.mapping.test17.A17;
import org.nuiton.topia.it.mapping.test17.B17;
import org.nuiton.topia.it.mapping.test17.BB17;
import org.nuiton.topia.it.mapping.test2.A2;
import org.nuiton.topia.it.mapping.test2.A21;
import org.nuiton.topia.it.mapping.test2.A22;
import org.nuiton.topia.it.mapping.test2.A23;
import org.nuiton.topia.it.mapping.test5.B51;
import org.nuiton.topia.it.mapping.test5.B53;
import org.nuiton.topia.it.mapping.test7.B71;
import org.nuiton.topia.it.mapping.test7.B72;
import org.nuiton.topia.it.mapping.test7.B73;
import org.nuiton.topia.it.mapping.test9.A9;
import org.nuiton.topia.persistence.TopiaEntity;
import org.nuiton.topia.persistence.util.TopiaEntityBinder;
import org.nuiton.topia.persistence.util.TopiaEntityHelper;
import org.nuiton.util.beans.BinderFactory;
import org.nuiton.util.beans.BinderModelBuilder;

@Generated(value = "org.nuiton.topia.templates.BinderHelperTransformer", date = "Thu Oct 13 17:59:14 CEST 2016")
public class TopiaItMappingBinderHelper extends BinderFactory {

    public static  TopiaEntityBinder getTopiaBinder(Class entityClass, String contextName) {
        return (TopiaEntityBinder) newBinder(entityClass, entityClass, contextName, TopiaEntityBinder.class);
    }

    public static  TopiaEntityBinder getSimpleTopiaBinder(Class entityClass) {
        return getTopiaBinder(entityClass, "TopiaItMapping");
    }

    public static void registerTopiaBinder(BinderModelBuilder builder, String contextName) {
       registerBinderModel(builder, contextName);
    }

    public static  TopiaEntityBinder registerTopiaBinder(Class entityClass, BinderModelBuilder builder, String contextName) {
       registerBinderModel(builder, contextName);
       return getTopiaBinder(entityClass, contextName);
    }

    public static  void copy(String contextName, E source, E target, boolean tech) {
        Class entityClass = (Class) TopiaEntityHelper.getContractClass(TopiaItMappingEntityEnum.values(), target.getClass());
        TopiaEntityBinder binder = getTopiaBinder(entityClass, contextName);
        if (binder == null) {
            throw new NullPointerException("Could not find a simple topia binder of type : " + target.getClass());
        }
        binder.load(source, target, tech);
    }

    public static  void simpleCopy(E source, E target, boolean tech) {
        Class entityClass = (Class) TopiaEntityHelper.getContractClass(TopiaItMappingEntityEnum.values(), target.getClass());
        TopiaEntityBinder binder = getSimpleTopiaBinder(entityClass);
        if (binder == null) {
            throw new NullPointerException("Could not find a simple topia binder of type : " + target.getClass());
        }
        binder.load(source, target, tech);
    }

    protected static void initBinders() {
        BinderModelBuilder builderB12 =
            BinderModelBuilder.newEmptyBuilder(B12.class);
        builderB12.addSimpleProperties(
            B12.PROPERTY_A12
        );
        registerTopiaBinder(builderB12, "TopiaItMapping");
    
        BinderModelBuilder builderB13 =
            BinderModelBuilder.newEmptyBuilder(B13.class);
        builderB13.addSimpleProperties(
            B13.PROPERTY_ROLE_A13
        );
        registerTopiaBinder(builderB13, "TopiaItMapping");
    
        BinderModelBuilder builderA11E =
            BinderModelBuilder.newEmptyBuilder(A11E.class);
        builderA11E.addSimpleProperties(
            A11E.PROPERTY_STRING_FIELD,
            A11E.PROPERTY_INTEGER_FIELD,
            A11E.PROPERTY_DATE_FIELD
        );
        registerTopiaBinder(builderA11E, "TopiaItMapping");
    
        BinderModelBuilder builderA12A =
            BinderModelBuilder.newEmptyBuilder(A12A.class);
        builderA12A.addSimpleProperties(
            A12A.PROPERTY_DATE_FIELD,
            A12A.PROPERTY_INTEGER_FIELD,
            A12A.PROPERTY_STRING_FIELD
        );
        registerTopiaBinder(builderA12A, "TopiaItMapping");
    
        BinderModelBuilder builderA13A =
            BinderModelBuilder.newEmptyBuilder(A13A.class);
        builderA13A.addSimpleProperties(
            A13A.PROPERTY_B13_B,
            A13A.PROPERTY_NATURAL_ID_DATE,
            A13A.PROPERTY_NATURAL_ID_STRING,
            A13A.PROPERTY_NATURAL_ID_INTEGER,
            A13A.PROPERTY_INTEGER_FIELD
        );
        registerTopiaBinder(builderA13A, "TopiaItMapping");
    
        BinderModelBuilder builderA14A =
            BinderModelBuilder.newEmptyBuilder(A14A.class);
        builderA14A.addSimpleProperties(
            A14A.PROPERTY_ROLE_B
        );
        registerTopiaBinder(builderA14A, "TopiaItMapping");
    
        BinderModelBuilder builderA14B =
            BinderModelBuilder.newEmptyBuilder(A14B.class);
        builderA14B.addSimpleProperties(
            A14B.PROPERTY_B14_BASSOC14_B
        );
        registerTopiaBinder(builderA14B, "TopiaItMapping");
    
        BinderModelBuilder builderB14A =
            BinderModelBuilder.newEmptyBuilder(B14A.class);
        builderB14A.addSimpleProperties(
            B14A.PROPERTY_A14_AASSOC14_A
        );
        registerTopiaBinder(builderB14A, "TopiaItMapping");
    
        BinderModelBuilder builderB14C =
            BinderModelBuilder.newEmptyBuilder(B14C.class);
        builderB14C.addSimpleProperties(
            B14C.PROPERTY_A14_CASSOC14_C
        );
        registerTopiaBinder(builderB14C, "TopiaItMapping");
    
        BinderModelBuilder builderA15A =
            BinderModelBuilder.newEmptyBuilder(A15A.class);
        builderA15A.addSimpleProperties(
            A15A.PROPERTY_AN_INTEGER,
            A15A.PROPERTY_A_BOOLEAN_WRAPPER,
            A15A.PROPERTY_A_FLOAT_WRAPPER,
            A15A.PROPERTY_AN_INTEGER_WRAPPER,
            A15A.PROPERTY_A_BOOLEAN,
            A15A.PROPERTY_A_SHORT,
            A15A.PROPERTY_A_LONG,
            A15A.PROPERTY_A_DOUBLE,
            A15A.PROPERTY_A_LONG_WRAPPER,
            A15A.PROPERTY_A_SHORT_WRAPPER,
            A15A.PROPERTY_A_DOUBLE_WRAPPER,
            A15A.PROPERTY_A_FLOAT,
            A15A.PROPERTY_A_BYTE,
            A15A.PROPERTY_A_BYTE_WRAPPER
        );
        registerTopiaBinder(builderA15A, "TopiaItMapping");
    
        BinderModelBuilder builderA16 =
            BinderModelBuilder.newEmptyBuilder(A16.class);
        builderA16.addSimpleProperties(
            A16.PROPERTY_CODE
        );
        registerTopiaBinder(builderA16, "TopiaItMapping");
    
        BinderModelBuilder builderB16 =
            BinderModelBuilder.newEmptyBuilder(B16.class);
        builderB16.addSimpleProperties(
            B16.PROPERTY_CODE,
            B16.PROPERTY_CODE2
        );
        registerTopiaBinder(builderB16, "TopiaItMapping");
    
        BinderModelBuilder builderC16 =
            BinderModelBuilder.newEmptyBuilder(C16.class);
        builderC16.addSimpleProperties(
            C16.PROPERTY_CODE,
            C16.PROPERTY_CODE2,
            C16.PROPERTY_CODE3
        );
        registerTopiaBinder(builderC16, "TopiaItMapping");
    
        BinderModelBuilder builderA17 =
            BinderModelBuilder.newEmptyBuilder(A17.class);
        builderA17.addSimpleProperties(
            A17.PROPERTY_A
        );
        registerTopiaBinder(builderA17, "TopiaItMapping");
    
        BinderModelBuilder builderB17 =
            BinderModelBuilder.newEmptyBuilder(B17.class);
        builderB17.addSimpleProperties(
            B17.PROPERTY_B
        );
        registerTopiaBinder(builderB17, "TopiaItMapping");
    
        BinderModelBuilder builderBB17 =
            BinderModelBuilder.newEmptyBuilder(BB17.class);
        builderBB17.addSimpleProperties(
            BB17.PROPERTY_BB,
            BB17.PROPERTY_BB1
        );
        registerTopiaBinder(builderBB17, "TopiaItMapping");
    
        BinderModelBuilder builderA2 =
            BinderModelBuilder.newEmptyBuilder(A2.class);
        builderA2.addSimpleProperties(
            A2.PROPERTY_B2
        );
        registerTopiaBinder(builderA2, "TopiaItMapping");
    
        BinderModelBuilder builderA21 =
            BinderModelBuilder.newEmptyBuilder(A21.class);
        builderA21.addSimpleProperties(
            A21.PROPERTY_ROLE_B21
        );
        registerTopiaBinder(builderA21, "TopiaItMapping");
    
        BinderModelBuilder builderA22 =
            BinderModelBuilder.newEmptyBuilder(A22.class);
        builderA22.addSimpleProperties(
            A22.PROPERTY_B22
        );
        registerTopiaBinder(builderA22, "TopiaItMapping");
    
        BinderModelBuilder builderA23 =
            BinderModelBuilder.newEmptyBuilder(A23.class);
        builderA23.addSimpleProperties(
            A23.PROPERTY_ROLE_B23
        );
        registerTopiaBinder(builderA23, "TopiaItMapping");
    
        BinderModelBuilder builderB51 =
            BinderModelBuilder.newEmptyBuilder(B51.class);
        builderB51.addSimpleProperties(
            B51.PROPERTY_A51
        );
        registerTopiaBinder(builderB51, "TopiaItMapping");
    
        BinderModelBuilder builderB53 =
            BinderModelBuilder.newEmptyBuilder(B53.class);
        builderB53.addSimpleProperties(
            B53.PROPERTY_A53
        );
        registerTopiaBinder(builderB53, "TopiaItMapping");
    
        BinderModelBuilder builderB71 =
            BinderModelBuilder.newEmptyBuilder(B71.class);
        builderB71.addSimpleProperties(
            B71.PROPERTY_NAME
        );
        registerTopiaBinder(builderB71, "TopiaItMapping");
    
        BinderModelBuilder builderB72 =
            BinderModelBuilder.newEmptyBuilder(B72.class);
        builderB72.addSimpleProperties(
            B72.PROPERTY_NAME
        );
        registerTopiaBinder(builderB72, "TopiaItMapping");
    
        BinderModelBuilder builderB73 =
            BinderModelBuilder.newEmptyBuilder(B73.class);
        builderB73.addSimpleProperties(
            B73.PROPERTY_NAME
        );
        registerTopiaBinder(builderB73, "TopiaItMapping");
    
        BinderModelBuilder builderA9 =
            BinderModelBuilder.newEmptyBuilder(A9.class);
        builderA9.addSimpleProperties(
            A9.PROPERTY_E9
        );
        registerTopiaBinder(builderA9, "TopiaItMapping");
    }

    static {
    
        initBinders();

    }

} //TopiaItMappingBinderHelper




© 2015 - 2024 Weber Informatics LLC | Privacy Policy