Package org.syncany.database.dao

Examples of org.syncany.database.dao.ChunkSqlDao


    Connection databaseConnection = testConfig.createDatabaseConnection();

    // Run
    TestSqlUtil.runSqlFromResource(databaseConnection, "test.insert.set1.sql");
   
    ChunkSqlDao chunkDao = new ChunkSqlDao(databaseConnection);
   
    Map<ChunkChecksum, ChunkEntry> chunksForA1 = chunkDao.getChunks(TestDatabaseUtil.createVectorClock("A1"));
    Map<ChunkChecksum, ChunkEntry> chunksForA2 = chunkDao.getChunks(TestDatabaseUtil.createVectorClock("A2"));
    Map<ChunkChecksum, ChunkEntry> chunksForA4 = chunkDao.getChunks(TestDatabaseUtil.createVectorClock("A4"));
    Map<ChunkChecksum, ChunkEntry> chunksForB1 = chunkDao.getChunks(TestDatabaseUtil.createVectorClock("B1"));
    Map<ChunkChecksum, ChunkEntry> chunksForNonExistent = chunkDao.getChunks(TestDatabaseUtil.createVectorClock("NonExistent1"));

    // Test
    assertNotNull(chunksForA1);
    assertEquals(1, chunksForA1.size());
    assertNotNull(chunksForA1.get(ChunkChecksum.parseChunkChecksum("fe83f217d464f6fdfa5b2b1f87fe3a1a47371196")));
View Full Code Here


  protected DatabaseVersionSqlDao databaseVersionDao;

  public SqlDatabase(Config config) {
    this.connection = config.createDatabaseConnection();
    this.applicationDao = new ApplicationSqlDao(connection);
    this.chunkDao = new ChunkSqlDao(connection);
    this.fileContentDao = new FileContentSqlDao(connection);
    this.fileVersionDao = new FileVersionSqlDao(connection);
    this.fileHistoryDao = new FileHistorySqlDao(connection, fileVersionDao);
    this.multiChunkDao = new MultiChunkSqlDao(connection);
    this.databaseVersionDao = new DatabaseVersionSqlDao(connection, chunkDao, fileContentDao, fileVersionDao, fileHistoryDao, multiChunkDao);
View Full Code Here

   
    // Test (for dirty database existence)
    Config configB = clientB.getConfig();
    java.sql.Connection databaseConnectionB = configB.createDatabaseConnection();

    ChunkSqlDao chunkDao = new ChunkSqlDao(databaseConnectionB);
    MultiChunkSqlDao multiChunkDao = new MultiChunkSqlDao(databaseConnectionB);
    FileVersionSqlDao fileVersionDao = new FileVersionSqlDao(databaseConnectionB);
    FileHistorySqlDao fileHistoryDao = new FileHistorySqlDao(databaseConnectionB, fileVersionDao);
    FileContentSqlDao fileContentDao = new FileContentSqlDao(databaseConnectionB);
    DatabaseVersionSqlDao databaseVersionDao = new DatabaseVersionSqlDao(databaseConnectionB, chunkDao, fileContentDao, fileVersionDao, fileHistoryDao, multiChunkDao);
View Full Code Here

TOP

Related Classes of org.syncany.database.dao.ChunkSqlDao

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.