Package org.apache.openjpa.jdbc.meta

Examples of org.apache.openjpa.jdbc.meta.MappingTool


        if (classes.isEmpty())
            return;

        String props = Configurations.getProperties(action);
        action = Configurations.getClassName(action);
        MappingTool tool = new MappingTool(conf, action, false);
        Configurations.configureInstance(tool, conf, props,
            "SynchronizeMappings");

        // initialize the schema
        Class cls;
        for (Iterator itr = classes.iterator(); itr.hasNext();) {
            cls = (Class) itr.next();
            try {
                tool.run(cls);
            } catch (IllegalArgumentException iae) {
                throw new UserException(_loc.get("bad-synch-mappings",
                    action, Arrays.asList(MappingTool.ACTIONS)));
            }
        }
        tool.record();
    }
View Full Code Here


    throws Exception {
        EntityManager em= currentEntityManager();
        OpenJPAEntityManager kem = OpenJPAPersistence.cast (em);
        //JDBCConfiguration conf = (JDBCConfiguration) kem.getConfiguration();
       
        MappingTool tool = new MappingTool((JDBCConfiguration)
                ((OpenJPAEntityManagerSPI) kem).getConfiguration(),
                MappingTool.ACTION_REFRESH, false);
        tool.run(ByteArrayPKPC.class);
        tool.run(ByteArrayPKPC2.class);
        tool.record();
    }
View Full Code Here

        if (classes.isEmpty())
            return;

        String props = Configurations.getProperties(action);
        action = Configurations.getClassName(action);
        MappingTool tool = new MappingTool(conf, action, false);
        Configurations.configureInstance(tool, conf, props,
            "SynchronizeMappings");

        // initialize the schema
        for (Class<?> cls : classes) {
            try {
                tool.run(cls);
            } catch (IllegalArgumentException iae) {
                throw new UserException(_loc.get("bad-synch-mappings",
                    action, Arrays.asList(MappingTool.ACTIONS)));
            }
        }
        tool.record();
    }
View Full Code Here

    public void testEnumEnhancement()
    throws IOException {
        EntityManager em= currentEntityManager();
        OpenJPAEntityManager kem = OpenJPAPersistence.cast(em);

        MappingTool tool = new MappingTool((JDBCConfiguration)
                ((OpenJPAEntityManagerSPI) kem).getConfiguration(),
                MappingTool.ACTION_REFRESH, false);
        tool.run(EntityWithEnum.class);
        tool.record();
    }
View Full Code Here

        if (classes.isEmpty())
            return;

        String props = Configurations.getProperties(action);
        action = Configurations.getClassName(action);
        MappingTool tool = new MappingTool(conf, action, false);
        Configurations.configureInstance(tool, conf, props,
            "SynchronizeMappings");

        // initialize the schema
        Class cls;
        for (Iterator itr = classes.iterator(); itr.hasNext();) {
            cls = (Class) itr.next();
            try {
                tool.run(cls);
            } catch (IllegalArgumentException iae) {
                throw new UserException(_loc.get("bad-synch-mappings",
                    action, Arrays.asList(MappingTool.ACTIONS)));
            }
        }
        tool.record();
    }
View Full Code Here

       
        EntityManager em= currentEntityManager();
        OpenJPAEntityManager kem = OpenJPAPersistence.cast (em);
        //JDBCConfiguration conf = (JDBCConfiguration) kem.getConfiguration();       
       
        MappingTool tool = new MappingTool((JDBCConfiguration)
            ((OpenJPAEntityManagerSPI) kem).getConfiguration(), MappingTool.ACTION_REFRESH, false);
        tool.run(ByteArrayPKPC.class);
        tool.run(ByteArrayPKPC2.class);
        tool.record();
    }
View Full Code Here

    public void testSchema()
        throws Exception {
        StringWriter out = new StringWriter();

        MappingTool tool = new MappingTool((JDBCConfiguration)
            getConfiguration(), MappingTool.ACTION_BUILD_SCHEMA, false);
        tool.setMappingWriter(new StringWriter());    // throw away
        tool.setSchemaWriter(out);
        tool.run(BuildSchemaPC.class);
        tool.record();

        BufferedReader in = new BufferedReader(new InputStreamReader
            (getClass().getResourceAsStream("TestBuildSchema-schema.rsrc")));
        StringBuffer buf = new StringBuffer();
        for (int ch; (ch = in.read()) != -1;)
View Full Code Here

        if (classes.isEmpty())
            return;

        String props = Configurations.getProperties(action);
        action = Configurations.getClassName(action);
        MappingTool tool = new MappingTool(conf, action, false);
        Configurations.configureInstance(tool, conf, props,
            "SynchronizeMappings");

        // initialize the schema
        for (Class<?> cls : classes) {
            try {
                tool.run(cls);
            } catch (IllegalArgumentException iae) {
                throw new UserException(_loc.get("bad-synch-mappings",
                    action, Arrays.asList(MappingTool.ACTIONS)));
            }
        }
        tool.record();
    }
View Full Code Here

       
        EntityManager em= currentEntityManager();
        OpenJPAEntityManager kem = OpenJPAPersistence.cast (em);
        //JDBCConfiguration conf = (JDBCConfiguration) kem.getConfiguration();
       
        MappingTool tool = new MappingTool((JDBCConfiguration)
                ((OpenJPAEntityManagerSPI) kem).getConfiguration(),
                MappingTool.ACTION_REFRESH, false);
        tool.run(ByteArrayPKPC.class);
        tool.run(ByteArrayPKPC2.class);
        tool.record();
    }
View Full Code Here

    public void testSchema()
        throws Exception {
        StringWriter out = new StringWriter();

        MappingTool tool = new MappingTool((JDBCConfiguration)
            getConfiguration(), MappingTool.ACTION_BUILD_SCHEMA, false);
        tool.setMappingWriter(new StringWriter());    // throw away
        tool.setSchemaWriter(out);
        tool.run(BuildSchemaPC.class);
        tool.record();

        BufferedReader in = new BufferedReader(new InputStreamReader
            (getClass().getResourceAsStream("TestBuildSchema-schema.rsrc")));
        StringBuffer buf = new StringBuffer();
        for (int ch; (ch = in.read()) != -1;)
View Full Code Here

TOP

Related Classes of org.apache.openjpa.jdbc.meta.MappingTool

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.