congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
DatabaseObject
Code IndexAdd Tabnine to your IDE (free)

How to use
DatabaseObject
in
liquibase.structure

Best Java code snippets using liquibase.structure.DatabaseObject (Showing top 4 results out of 315)

origin: liquibase/liquibase-hibernate

  @Override
  protected DatabaseObject snapshotObject(DatabaseObject example, DatabaseSnapshot snapshot) throws DatabaseException, InvalidExampleException {
    if (example.getSnapshotId() != null) {
      return example;
    }
    org.hibernate.mapping.Table hibernateTable = findHibernateTable(example, snapshot);
    if (hibernateTable == null) {
      return example;
    }

    Table table = new Table().setName(hibernateTable.getName());
    LOG.info("Found table " + table.getName());
//        table.setSnapshotId(SnapshotIdService.getInstance().generateId());
    table.setSchema(example.getSchema());


    return table;
  }

origin: liquibase/liquibase-hibernate

  protected org.hibernate.mapping.Table findHibernateTable(DatabaseObject example, DatabaseSnapshot snapshot) throws DatabaseException {
    HibernateDatabase database = (HibernateDatabase) snapshot.getDatabase();
    MetadataImplementor metadata = (MetadataImplementor) database.getMetadata();

    Collection<Table> tmapp = metadata.collectTableMappings();
    Iterator<Table> tableMappings = tmapp.iterator();

    while (tableMappings.hasNext()) {
      org.hibernate.mapping.Table hibernateTable = tableMappings.next();
      if (hibernateTable.getName().equalsIgnoreCase(example.getName())) {
        return hibernateTable;
      }
    }
    return null;
  }
}
origin: jhipster/jhipster-loaded

LOG.info("Found table " + table.getName());
table.setSchema(example.getSchema());
origin: liquibase/liquibase-hibernate

@Override
protected DatabaseObject snapshotObject(DatabaseObject example, DatabaseSnapshot snapshot) throws DatabaseException, InvalidExampleException {
  if (example.getSnapshotId() != null) {
    return example;
  }
  Table table = ((Index) example).getTable();
  org.hibernate.mapping.Table hibernateTable = findHibernateTable(table, snapshot);
  if (hibernateTable == null) {
    return example;
  }
  Iterator indexIterator = hibernateTable.getIndexIterator();
  while (indexIterator.hasNext()) {
    org.hibernate.mapping.Index hibernateIndex = (org.hibernate.mapping.Index) indexIterator.next();
    Index index = new Index();
    index.setTable(table);
    index.setName(hibernateIndex.getName());
    Iterator columnIterator = hibernateIndex.getColumnIterator();
    while (columnIterator.hasNext()) {
      org.hibernate.mapping.Column hibernateColumn = (org.hibernate.mapping.Column) columnIterator.next();
      index.getColumns().add(new Column(hibernateColumn.getName()).setRelation(table));
    }
    if (index.getColumnNames().equalsIgnoreCase(((Index) example).getColumnNames())) {
      LOG.info("Found index " + index.getName());
      table.getIndexes().add(index);
      return index;
    }
  }
  return example;
}
liquibase.structureDatabaseObject

Most used methods

  • getSchema
  • getName
  • getSnapshotId

Popular in Java

  • Making http post requests using okhttp
  • setScale (BigDecimal)
  • putExtra (Intent)
  • runOnUiThread (Activity)
  • Kernel (java.awt.image)
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Top 17 Free Sublime Text Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now