Package net.sf.hajdbc.dialect

Examples of net.sf.hajdbc.dialect.Dialect


  }
 
  private DatabaseProperties createDatabaseProperties(Connection connection) throws SQLException
  {
    DatabaseMetaData metaData = connection.getMetaData();
    Dialect dialect = this.cluster.getDialect();
    return new EagerDatabaseProperties(metaData, dialect);
  }
View Full Code Here


    SortedMap<D, E> exceptionMap = results.getValue();
   
    if (!exceptionMap.isEmpty())
    {
      DatabaseCluster<Z, D> cluster = factory.getDatabaseCluster();
      Dialect dialect = cluster.getDialect();
     
      List<D> failedDatabases = new ArrayList<D>(exceptionMap.size());
     
      // Determine which exceptions are due to failures
      for (Map.Entry<D, E> entry: exceptionMap.entrySet())
View Full Code Here

      Map.Entry<DatabaseProperties, LazyDatabaseMetaDataProvider> entry = this.map.get(database);
     
      if (entry == null)
      {
        DatabaseMetaData metaData = connection.getMetaData();
        Dialect dialect = this.cluster.getDialect();
        LazyDatabaseMetaDataProvider provider = new LazyDatabaseMetaDataProvider(metaData);
        DatabaseProperties properties = new LazyDatabaseProperties(provider, dialect);
       
        entry = new AbstractMap.SimpleImmutableEntry<DatabaseProperties, LazyDatabaseMetaDataProvider>(properties, provider);
View Full Code Here

    Map.Entry<DatabaseProperties, LazyDatabaseMetaDataProvider> entry = this.entryRef.get();
   
    if (entry == null)
    {
      DatabaseMetaData metaData = connection.getMetaData();
      Dialect dialect = this.cluster.getDialect();
      LazyDatabaseMetaDataProvider provider = new LazyDatabaseMetaDataProvider(metaData);
      DatabaseProperties properties = new LazyDatabaseProperties(provider, dialect);
     
      entry = new AbstractMap.SimpleImmutableEntry<DatabaseProperties, LazyDatabaseMetaDataProvider>(properties, provider);
   
View Full Code Here

   * @see net.sf.hajdbc.sync.SynchronizationSupport#dropForeignKeys()
   */
  @Override
  public void dropForeignKeys() throws SQLException
  {
    Dialect dialect = this.context.getDialect();
   
    Connection connection = this.context.getConnection(this.context.getTargetDatabase());
    boolean autoCommit = connection.getAutoCommit();
    try
    {
      connection.setAutoCommit(true);
     
      Statement statement = connection.createStatement();
      try
      {
        for (TableProperties table: this.context.getTargetDatabaseProperties().getTables())
        {
          for (ForeignKeyConstraint constraint: table.getForeignKeyConstraints())
          {
            String sql = dialect.getDropForeignKeyConstraintSQL(constraint);
           
            this.logger.log(Level.DEBUG, sql);
           
            statement.addBatch(sql);
          }
View Full Code Here

   * @see net.sf.hajdbc.sync.SynchronizationSupport#restoreForeignKeys()
   */
  @Override
  public void restoreForeignKeys() throws SQLException
  {
    Dialect dialect = this.context.getDialect();
   
    Connection connection = this.context.getConnection(this.context.getTargetDatabase());
    boolean autoCommit = connection.getAutoCommit();
    try
    {
      connection.setAutoCommit(true);
     
      Statement statement = connection.createStatement();
      try
      {
        for (TableProperties table: this.context.getSourceDatabaseProperties().getTables())
        {
          for (ForeignKeyConstraint constraint: table.getForeignKeyConstraints())
          {
            String sql = dialect.getCreateForeignKeyConstraintSQL(constraint);
           
            this.logger.log(Level.DEBUG, sql);
           
            statement.addBatch(sql);
          }
View Full Code Here

    {
      // Use default dialect
      factory = ServiceLoaders.findRequiredService(DialectFactory.class);
    }
   
    Dialect dialect = factory.createDialect();

    Connection connection = this.pool.take();
   
    try
    {
View Full Code Here

   * @see net.sf.hajdbc.SynchronizationStrategy#synchronize(net.sf.hajdbc.sync.SynchronizationContext)
   */
  @Override
  public <Z, D extends Database<Z>> void synchronize(SynchronizationContext<Z, D> context) throws SQLException
  {
    Dialect dialect = context.getDialect();
    Decoder decoder = context.getDecoder();
    DumpRestoreSupport support = dialect.getDumpRestoreSupport();
   
    if (support == null)
    {
      throw new SQLException(Messages.DUMP_RESTORE_UNSUPPORTED.getMessage(dialect));
    }
View Full Code Here

   * @see net.sf.hajdbc.SynchronizationStrategy#synchronize(net.sf.hajdbc.sync.SynchronizationContext)
   */
  @Override
  public <Z, D extends Database<Z>> void synchronize(SynchronizationContext<Z, D> context) throws SQLException
  {
    Dialect dialect = context.getDialect();
    DumpRestoreSupport support = dialect.getDumpRestoreSupport();
   
    if (support == null)
    {
      throw new SQLException(Messages.DUMP_RESTORE_UNSUPPORTED.getMessage(dialect));
    }
View Full Code Here

    SortedMap<D, E> exceptionMap = results.getValue();
   
    if (!exceptionMap.isEmpty())
    {
      DatabaseCluster<Z, D> cluster = map.getDatabaseCluster();
      Dialect dialect = cluster.getDialect();
     
      List<D> failedDatabases = new ArrayList<D>(exceptionMap.size());
     
      // Determine which exceptions are due to failures
      for (Map.Entry<D, E> entry: exceptionMap.entrySet())
View Full Code Here

TOP

Related Classes of net.sf.hajdbc.dialect.Dialect

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.