Class Project

All Implemented Interfaces:
TreeUnit, Unit, Comparable<AbstractUnit>

public class Project extends AbstractUnit
DbSchema project store all schemas.
  • Field Details

    • schemas

      public final Folder<Schema> schemas
    • layouts

      public final Folder<Layout> layouts
    • children

      public final ArrayList<Folder> children
    • tickId

      public int tickId
    • isFreshImported

      public boolean isFreshImported
    • file

      protected File file
    • idef1xNotation

      public static com.wisecoders.dbs.diagram.fx.notation.Idef1XNotation idef1xNotation
    • ieNotation

      public static com.wisecoders.dbs.diagram.fx.notation.IENotation ieNotation
    • ieWithArrowsNotation

      public static com.wisecoders.dbs.diagram.fx.notation.IEWithArrowsNotation ieWithArrowsNotation
    • barkerNotation

      public static com.wisecoders.dbs.diagram.fx.notation.BarkerNotation barkerNotation
  • Constructor Details

    • Project

      public Project(String name)
    • Project

      public Project(String name, String dbId)
  • Method Details

    • getDefaultKey

      public String getDefaultKey()
      Overrides:
      getDefaultKey in class AbstractUnit
    • setSyncProject

      public void setSyncProject(boolean isSyncProject)
    • isSyncProject

      public boolean isSyncProject()
    • getChildrenCount

      public int getChildrenCount()
      Specified by:
      getChildrenCount in interface TreeUnit
      Overrides:
      getChildrenCount in class AbstractUnit
    • getChildAt

      public TreeUnit getChildAt(int idx)
      Specified by:
      getChildAt in interface TreeUnit
      Overrides:
      getChildAt in class AbstractUnit
    • getSyncFolders

      public Folder[] getSyncFolders()
      Overrides:
      getSyncFolders in class AbstractUnit
    • getSymbolicName

      public String getSymbolicName()
      Specified by:
      getSymbolicName in interface Unit
      Specified by:
      getSymbolicName in class AbstractUnit
    • getSymbolicIcon

      public String getSymbolicIcon()
      Specified by:
      getSymbolicIcon in class AbstractUnit
    • getSymbolicGlyph

      public com.wisecoders.dbs.sys.fx.glyph.Glyph getSymbolicGlyph()
      Specified by:
      getSymbolicGlyph in class AbstractUnit
    • getOrCreateSchema

      public Schema getOrCreateSchema(String name)
    • createSchema

      public Schema createSchema(String name)
    • createSchema

      public Schema createSchema(String name, String catalogName)
    • getSimilarSchema

      public Schema getSimilarSchema(Schema other)
    • getSimilarEntity

      public Entity getSimilarEntity(Entity other)
    • getSchema

      public Schema getSchema(String catalogDotSchemaName)
    • getSchema

      public Schema getSchema(String catalogName, String schemaName)
    • getSchemaUsingMetaDataCatalogAndSchemaName

      public Schema getSchemaUsingMetaDataCatalogAndSchemaName(String metaDataCatalogName, String metaDataSchemaName)
    • createLayout

      public Layout createLayout(String name)
      Create a new diagram
      Parameters:
      name - as diagram name
      Returns:
      the created layout
    • createLayoutIncludeAllTables

      public Layout createLayoutIncludeAllTables(String name, boolean createGroups)
      Create a Layout and attach all project tables to it. Used in Groovy Scripts.
      Parameters:
      name - layout name
      createGroups - to set groups over the tables
      Returns:
      the created layout
    • createLayoutIncludeAllTables

      public Layout createLayoutIncludeAllTables(String name, boolean createGroups, boolean recursive)
      Create a Layout and attach all project tables to it. Used in Groovy Scripts.
      Parameters:
      name - layout name
      createGroups - to set groups over the tables
      recursive - to attach sub-entities of each table (as for MongoDb)
      Returns:
      the created layout
    • cloneLayout

      public Layout cloneLayout(Layout layout)
      Duplicate a layout in a new diagram
      Parameters:
      layout - to duplicate
      Returns:
      the duplicated layout
    • getLayout

      public Layout getLayout(String name)
    • getFile

      public File getFile()
    • hasFile

      public boolean hasFile()
    • setFile

      public void setFile(File file)
      Is the file where the project is stored (the model file).
      Parameters:
      file - where is stored
    • getDbId

      public String getDbId()
    • setDbId

      public void setDbId(String dbId)
      The name of the RDBMS (MySql,Oracle...)
      Parameters:
      dbId - the database name
    • hasSchemesWithSameName

      public boolean hasSchemesWithSameName()
    • refresh

      public void refresh()
      Deleting a table, column, etc can be done for any thread, by calling table.markForDeletion(). The effective delete is done by calling this method, on the JavaFX thread (in GUI mode). This ensures the correct rendering of the project structure.
      Specified by:
      refresh in class AbstractUnit
    • getTitle

      public String getTitle()
    • toString

      public String toString()
      Overrides:
      toString in class AbstractUnit
    • getStatistics

      public String getStatistics()
      Returns:
      A general statistic about the number of tables, etc.
    • hasOperativeConnector

      public boolean hasOperativeConnector()
    • setOperativeConnector

      public void setOperativeConnector(Connector operativeConnector)
    • getOperativeConnector

      public Connector getOperativeConnector()
    • createSchema

      public Schema createSchema(Schema schema)
    • getEntity

      public AbstractTable getEntity()
    • getParent

      public TreeUnit getParent()
      Specified by:
      getParent in interface TreeUnit
      Specified by:
      getParent in class AbstractUnit
    • getEntities

      public final EntityIterable getEntities()
    • getEntityCount

      public int getEntityCount()
    • hasEntities

      public boolean hasEntities()
    • findSimilarUnitsAsInSelection

      public List<TreeUnit> findSimilarUnitsAsInSelection(List<? extends TreeUnit> preselect)
    • getTickId

      public int getTickId()
      Specified by:
      getTickId in interface TreeUnit
      Overrides:
      getTickId in class AbstractUnit
    • getKey

      public String getKey()
      Overrides:
      getKey in class AbstractUnit
      Returns:
      A string to uniquely identify this Unit. Is used for saving if is open or not, its position, etc.
    • setKey

      public void setKey(String id)
    • getType

      public ProjectType getType()
    • setType

      public void setType(ProjectType type)
    • isElasticsearch

      public boolean isElasticsearch()
    • getSyncFilter

      public String getSyncFilter()
    • setSyncFilter

      public void setSyncFilter(String syncFilter)
    • setSyncInitScript

      public void setSyncInitScript(String syncInitScript)
    • getSyncInitScript

      public String getSyncInitScript()
    • getDDLPreScript

      public String getDDLPreScript()
    • setDDLPreScript

      public void setDDLPreScript(String ddlPreScript)
    • getDDLPostScript

      public String getDDLPostScript()
    • setDDLPostScript

      public void setDDLPostScript(String ddlPostScript)
      Script to be executed after the schema creation script.
      Parameters:
      ddlPostScript - is an SQL as string.
    • injectDDLPrePostScripts

      public void injectDDLPrePostScripts(AlterScript script)
    • setNotation

      public void setNotation(com.wisecoders.dbs.diagram.fx.notation.Notation notation)
      The layout notation (Barker, IdFix)
      Parameters:
      notation - to use
    • getNotation

      public com.wisecoders.dbs.diagram.fx.notation.Notation getNotation()
    • setNotationStrict

      public void setNotationStrict(boolean notationStrict)
    • isNotationStrict

      public boolean isNotationStrict()
    • getCatalogNames

      public List<String> getCatalogNames()
    • deduceVirtualForeignKeysFromQuery

      public List<VirtualForeignKeySuggestion> deduceVirtualForeignKeysFromQuery(String query)
    • isDbVersionHigherEqual

      public boolean isDbVersionHigherEqual(String version)
    • isDbVersionBelow

      public boolean isDbVersionBelow(String version)
    • setDbVersion

      public void setDbVersion(String dbVersion)
    • getVirtualRelationCount

      public int getVirtualRelationCount()
    • getInUseSchema

      public Schema getInUseSchema()
    • setInUseSchema

      public void setInUseSchema(Schema schema)
    • getSchemaInUseCatalog

      public Schema getSchemaInUseCatalog(String schemaName)
    • convert

      public Project convert(String targetDbms)
      Convert the Project to other Dbms
      Parameters:
      targetDbms - to convert to
      Returns:
      the converted project.