Package org.apache.openjpa.jdbc.conf

Examples of org.apache.openjpa.jdbc.conf.JDBCConfiguration


    private transient DBDictionary _dict = null;
    private DBIdentifier _schema = DBIdentifier.NULL;

    public void setConfiguration(Configuration conf) {
        JDBCConfiguration jconf = (JDBCConfiguration) conf;
        _dict = jconf.getDBDictionaryInstance();
        _schema = DBIdentifier.newSchema(jconf.getSchema());
    }
View Full Code Here


            && syntax != JoinSyntaxes.SYNTAX_TRADITIONAL
            && syntax != JoinSyntaxes.SYNTAX_DATABASE)
            throw new IllegalArgumentException(_loc.get("bad-join-syntax", Integer.valueOf(syntax)).getMessage());

        if (syntax == DEFAULT) {
            JDBCConfiguration conf = getJDBCConfiguration();
            if (conf != null)
                _state.syntax = conf.getDBDictionaryInstance().joinSyntax;
        } else
            _state.syntax = syntax;
        return this;
    }
View Full Code Here

        Options opts = new Options();
        final String[] arguments = opts.setFromCmdLine(args);
        boolean ret = Configurations.runAgainstAllAnchors(opts,
            new Configurations.Runnable() {
            public boolean run(Options opts) throws Exception {
                JDBCConfiguration conf = new JDBCConfigurationImpl();
                try {
                    return ReverseMappingTool.run(conf, arguments, opts);
                } finally {
                    conf.close();
                }
            }
        });
        if (!ret) {
            // START - ALLOW PRINT STATEMENTS
View Full Code Here

        Options opts = new Options();
        final String[] arguments = opts.setFromCmdLine(args);
        boolean ret = Configurations.runAgainstAllAnchors(opts,
            new Configurations.Runnable() {
            public boolean run(Options opts) throws Exception {
                JDBCConfiguration conf = new JDBCConfigurationImpl();
                try {
                    return ClassTableJDBCSeq.run(conf, arguments, opts);
                } finally {
                    conf.close();
                }
            }
        });
        if (!ret) {
            // START - ALLOW PRINT STATEMENTS
View Full Code Here

        Options opts = new Options();
        final String[] arguments = opts.setFromCmdLine(args);
        boolean ret = Configurations.runAgainstAllAnchors(opts,
            new Configurations.Runnable() {
            public boolean run(Options opts) throws Exception {
                JDBCConfiguration conf = new JDBCConfigurationImpl();
                try {
                    return ValueTableJDBCSeq.run(conf, arguments, opts);
                } finally {
                    conf.close();
                }
            }
        });
        if (!ret) {
            // START - ALLOW PRINT STATEMENTS
View Full Code Here

       deleteAll(DataStoreTripsPC.class);

        // figure out what table to look for in SQL statements
        EntityManager em= currentEntityManager();
        OpenJPAEntityManager kem = OpenJPAPersistence.cast (em);
        JDBCConfiguration conf =
            (JDBCConfiguration) ((OpenJPAEntityManagerSPI) kem)
            .getConfiguration();       

        ClassMapping mapping = conf.getMappingRepositoryInstance().getMapping
            (DataStoreTripsPC.class, null, true);
        String table = conf.getDBDictionaryInstance()
            .getFullName(mapping.getTable(), false);

        // get factory with counter listener
        _factory = getEmf();
/*                getPMFactory(new String[]{
View Full Code Here

        return "rev-mapping-pu";
    }

    public void testGettersAndSetters() throws Exception {

        JDBCConfiguration conf = (JDBCConfiguration) ((OpenJPAEntityManagerFactory) emf).getConfiguration();

        EntityManager em = emf.createEntityManager();

        em.getTransaction().begin();
View Full Code Here

    }
    /**
     * Tests that application identity classes are returned correctly.
     */
    public void testSchemaGeneration() {
        JDBCConfiguration conf = new JDBCConfigurationImpl();
        DBDictionary dict = conf.getDBDictionaryInstance();
        MappingRepository repos = conf.getMappingRepositoryInstance();
        repos.setStrategyInstaller(new RefreshStrategyInstaller(repos));
        ClassMapping mapping = repos.getMapping(Column.class, null, true);

        Class cls;
        if (dict.getPreferredType(JavaSQLTypes.CLOB) ==  JavaSQLTypes.CLOB) {
View Full Code Here

    public void testNullCacheEnabled() {
        nullTestLogic(true);
    }

    public void testMappingTransferAndOverride() {
        JDBCConfiguration conf = (JDBCConfiguration) emf.getConfiguration();
        ClassMapping cls = conf.getMappingRepositoryInstance().getMapping
            (EmbedOwner.class, null, true);
        assertEquals("OWN_BASIC", cls.getFieldMapping("basic").
            getColumns()[0].getName());
        ClassMapping embed = cls.getFieldMapping("embed").getEmbeddedMapping();
        assertEquals("EMB_BLOB", embed.getFieldMapping("blob").
            getColumns()[0].getName());
        assertEquals("OVER_BASIC", embed.getFieldMapping("basic").
            getColumns()[0].getName());
        assertEquals("OVER_OWNER", embed.getFieldMapping("owner").
            getColumns()[0].getName());

        FieldMapping fm = embed.getFieldMapping("clob");
        DBDictionary dict = conf.getDBDictionaryInstance();
        if (dict.getPreferredType(Types.CLOB) == Types.CLOB) {
            if (dict.maxEmbeddedClobSize > 0)
                assertTrue(fm.getStrategy() instanceof
                    MaxEmbeddedClobFieldStrategy);
            else
View Full Code Here

        // null any declared detached state fields so we know we're using
        // synthetic state managers
        EntityManager em= currentEntityManager();
        OpenJPAEntityManager kem = OpenJPAPersistence.cast (em);
        JDBCConfiguration conf =
            (JDBCConfiguration) ((OpenJPAEntityManagerSPI) kem)
            .getConfiguration();

        MetaDataRepository repos = conf.getMappingRepositoryInstance();
        ClassMetaData meta;
        for (int i = 0; i < clss.length; i++) {
            meta = repos.getMetaData(clss[i], null, true);
            detachedStateFields[i] = meta.getDetachedState();
            meta.setDetachedState(null);
View Full Code Here

TOP

Related Classes of org.apache.openjpa.jdbc.conf.JDBCConfiguration

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.