Package org.apache.openjpa.jdbc.conf

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


        return _state.size;
    }

    public JDBCFetchConfiguration setLRSSize(int size) {
        if (size == DEFAULT) {
            JDBCConfiguration conf = getJDBCConfiguration();
            if (conf != null)
                _state.size = conf.getLRSSizeConstant();
        } else
            _state.size = size;
        return this;
    }
View Full Code Here


        return _state.syntax;
    }

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

     * </ul>
     */
    public static void main(String[] args) throws Exception {
        Options opts = new Options();
        args = opts.setFromCmdLine(args);
        JDBCConfiguration conf = new JDBCConfigurationImpl();
        try {
            if (!run(conf, args, opts))
                System.out.println(_loc.get("clstable-seq-usage"));
        } finally {
            conf.close();
        }
    }
View Full Code Here

        MultiLoaderClassResolver resolver = new MultiLoaderClassResolver();
        resolver.addClassLoader(loader);
        resolver.addClassLoader((ClassLoader) AccessController.doPrivileged(
            J2DoPrivHelper.getClassLoaderAction(MappingTool.class)));
        JDBCConfiguration conf = (JDBCConfiguration) getConfiguration();
        conf.setClassResolver(resolver);

        if (!MappingTool.run(conf, files, flags, loader))
            throw new BuildException(_loc.get("bad-conf", "MappingToolTask")
                .getMessage());
    }
View Full Code Here

        private EnumSet<UniqueFlag> _unique;
   
   
    @Override
    protected boolean startDelimitedIdentifiers() {
        JDBCConfiguration conf = (JDBCConfiguration) getConfiguration();
        DBDictionary dict = conf.getDBDictionaryInstance();
        dict.setDelimitIdentifiers(true);
        return true;
    }
View Full Code Here

     * For databases that accept only short column names, test avoidance of
     * duplicate column names when populating the table with long column names.
     */
    public void testPopulateWithLongColumnNames() {
        MappingDefaultsImpl mapping = new MappingDefaultsImpl();
        JDBCConfiguration conf = new JDBCConfigurationImpl(false, false);
        conf.setDBDictionary("oracle");
        mapping.setConfiguration(conf);
        Table table = new Table("testtable", null);
        Column[] cols = new Column[3];
        cols[0] = new
            Column("longnamelongnamelongnamelongnamelongnamelongname1", null);
View Full Code Here

import org.jmock.integration.junit3.MockObjectTestCase;

public class TestDBDictionaryGeneratedSQL extends MockObjectTestCase {

    public void testCreateTableLongNameException() {
        final JDBCConfiguration mockConfiguration = mock(JDBCConfiguration.class);
        final DBIdentifierUtilImpl idImpl = new DBIdentifierUtilImpl();
       
        checking(new Expectations() {
            {
                allowing(mockConfiguration).getIdentifierUtilInstance();
View Full Code Here

        }
    }
   
   
    public void testThrowsExceptionWithSchemaSet() {
        final JDBCConfiguration mockConfiguration = mock(JDBCConfiguration.class);
        final DBIdentifierUtilImpl idImpl = new DBIdentifierUtilImpl();
       
        checking(new Expectations() {
            {
                allowing(mockConfiguration).getIdentifierUtilInstance();
View Full Code Here

            assertTrue(ue.getMessage().contains("Table name \"IAmASchema.NameIsTooLong\""));
        }
    }
   
    public void testSchemaNameIsNotConsidered() {
        final JDBCConfiguration mockConfiguration = mock(JDBCConfiguration.class);
        final DBIdentifierUtilImpl idImpl = new DBIdentifierUtilImpl();
       
        checking(new Expectations() {
            {
                allowing(mockConfiguration).getIdentifierUtilInstance();
View Full Code Here

    }

    public void setUp() throws Exception {
        super.setUp(Person.class, CLEAR_TABLES);
        OpenJPAEntityManager em = emf.createEntityManager();
        JDBCConfiguration conf = (JDBCConfiguration) em.getConfiguration();
        String user = conf.getConnectionUserName();
        if (user != null && !user.equals("")) {
            // Disable for non-Derby, due to connectionUserName to schema mapping failures
            setTestsDisabled(true);
            getLog().trace("TestOverrideNonJtaDataSource can only be executed against Derby w/o a schema");
        } else {
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.