Package org.jpox.store.mapped.mapping

Examples of org.jpox.store.mapped.mapping.MappingManager


    public void initialize(ClassLoaderResolver clr)
    {
        assertIsUninitialized();

        IdentifierFactory idFactory = storeMgr.getIdentifierFactory();
        MappingManager mgr = getStoreManager().getMappingManager();
        classMapping = dba.getMapping(String.class, storeMgr);
        Column class_column=(Column) addDatastoreField(String.class.getName(),
            idFactory.newDatastoreFieldIdentifier("CLASS_NAME"), classMapping, null);
        mgr.createDatastoreMapping(classMapping, storeMgr, class_column, String.class.getName());
        class_column.getColumnMetaData().setLength(128);
        class_column.getColumnMetaData().setJdbcType("VARCHAR");
        class_column.setAsPrimaryKey();

        tableMapping = dba.getMapping(String.class, storeMgr);
        Column table_column=(Column) addDatastoreField(String.class.getName(),
            idFactory.newDatastoreFieldIdentifier("TABLE_NAME"), tableMapping, null);
        mgr.createDatastoreMapping(tableMapping, storeMgr, table_column, String.class.getName());
        table_column.getColumnMetaData().setLength(128);
        table_column.getColumnMetaData().setJdbcType("VARCHAR");

        typeMapping = dba.getMapping(String.class, storeMgr);
        Column type_column=(Column) addDatastoreField(String.class.getName(),
            idFactory.newDatastoreFieldIdentifier("TYPE"), typeMapping, null);
        mgr.createDatastoreMapping(typeMapping, storeMgr, type_column, String.class.getName());
        type_column.getColumnMetaData().setLength(4);
        type_column.getColumnMetaData().setJdbcType("VARCHAR");

        // TODO Change type to SMALLINT/BIT
        ownerMapping = dba.getMapping(String.class, storeMgr);
        Column owner_column=(Column) addDatastoreField(String.class.getName(),
            idFactory.newDatastoreFieldIdentifier("OWNER"), ownerMapping, null);
        mgr.createDatastoreMapping(ownerMapping, storeMgr, owner_column, String.class.getName());
        owner_column.getColumnMetaData().setLength(2);
        owner_column.getColumnMetaData().setJdbcType("VARCHAR");

        versionMapping = dba.getMapping(String.class, storeMgr);
        Column version_column=(Column) addDatastoreField(String.class.getName(),
            idFactory.newDatastoreFieldIdentifier("VERSION"), versionMapping, null);
        mgr.createDatastoreMapping(versionMapping, storeMgr, version_column, String.class.getName());
        version_column.getColumnMetaData().setLength(20);
        version_column.getColumnMetaData().setJdbcType("VARCHAR");

        interfaceNameMapping = dba.getMapping(String.class, storeMgr);
        Column interfaceName_column=(Column) addDatastoreField(String.class.getName(),
            idFactory.newDatastoreFieldIdentifier("INTERFACE_NAME"), interfaceNameMapping, null);
        mgr.createDatastoreMapping(interfaceNameMapping, storeMgr, interfaceName_column, String.class.getName());
        interfaceName_column.getColumnMetaData().setLength(255);
        interfaceName_column.getColumnMetaData().setJdbcType("VARCHAR");
        interfaceName_column.setNullable();
       
        // Set up JDBC statements for supported operations
View Full Code Here

TOP

Related Classes of org.jpox.store.mapped.mapping.MappingManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.