Package org.sql2o.quirks

Examples of org.sql2o.quirks.NoQuirks


        org.h2.jdbcx.JdbcDataSource ds = new org.h2.jdbcx.JdbcDataSource();
        ds.setURL("jdbc:h2:mem:test;DB_CLOSE_DELAY=-1");
        ds.setUser("sa");
        ds.setPassword("");

        Sql2o sql2o = new Sql2o(ds, new NoQuirks(new HashMap<Class, Converter>() {{
            put(DateTime.class, new DateTimeConverter(DateTimeZone.getDefault()));
        }}));

        assertThat(sql2o.getQuirks(), is(instanceOf(NoQuirks.class)));
View Full Code Here


    private List<UUIDWrapper> wrappers;

    @Before
    public void setUp()
    {
        Quirks quirks = new NoQuirks(){
            {
                this.converters.put(UUID.class, new CustomUUIDConverter());
            }
        };
View Full Code Here

        when(jdbcConnection.isClosed()).thenReturn(false);
        when(dataSource.getConnection()).thenReturn(jdbcConnection);
        PreparedStatement ps = mock(PreparedStatement.class);
        when(jdbcConnection.prepareStatement(anyString())).thenReturn(ps);

        Sql2o sql2o = new Sql2o(dataSource,new NoQuirks(){
            @Override
            public boolean returnGeneratedKeysByDefault() {
                return false;
            }
        });
View Full Code Here

        when(dataSource.getConnection()).thenReturn(jdbcConnection);
        PreparedStatement ps = mock(PreparedStatement.class);
        doThrow(MyException.class).when(ps).setInt(anyInt(),anyInt());
        when(jdbcConnection.prepareStatement(anyString())).thenReturn(ps);

        Sql2o sql2o = new Sql2o(dataSource,new NoQuirks(){
            @Override
            public boolean returnGeneratedKeysByDefault() {
                return false;
            }
        });
View Full Code Here

TOP

Related Classes of org.sql2o.quirks.NoQuirks

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.