Examples of DBTable


Examples of org.apache.empire.db.DBTable

    {
        // Create all Sequences
        Iterator<DBTable> seqtabs = db.getTables().iterator();
        while (seqtabs.hasNext())
        {
            DBTable table = seqtabs.next();
            Iterator<DBColumn> cols = table.getColumns().iterator();
            while (cols.hasNext())
            {
                DBTableColumn c = (DBTableColumn) cols.next();
                if (c.getDataType() == DataType.AUTOINC)
                {
View Full Code Here

Examples of org.apache.empire.db.DBTable

     * Create a sql string for creating a relation and appends it to the supplied buffer
     * @return true if the relation has been created successfully
     */
    protected boolean createRelation(DBRelation r, DBSQLScript script)
    {
        DBTable sourceTable = (DBTable) r.getReferences()[0].getSourceColumn().getRowSet();
        DBTable targetTable = (DBTable) r.getReferences()[0].getTargetColumn().getRowSet();

        StringBuilder sql = new StringBuilder();
        sql.append("-- creating foreign key constraint ");
        sql.append(r.getName());
        sql.append(" --\r\n");
        sql.append("ALTER TABLE ");
        sourceTable.addSQL(sql, DBExpr.CTX_FULLNAME);
        sql.append(" ADD CONSTRAINT ");
        appendElementName(sql, r.getName());
        sql.append(" FOREIGN KEY (");
        // Source Names
        boolean addSeparator = false;
        DBRelation.DBReference[] refs = r.getReferences();
        for (int i = 0; i < refs.length; i++)
        {
            sql.append((addSeparator) ? ", " : "");
            refs[i].getSourceColumn().addSQL(sql, DBExpr.CTX_NAME);
            addSeparator = true;
        }
        // References
        sql.append(") REFERENCES ");
        targetTable.addSQL(sql, DBExpr.CTX_FULLNAME);
        sql.append(" (");
        // Target Names
        addSeparator = false;
        for (int i = 0; i < refs.length; i++)
        {
View Full Code Here

Examples of org.apache.empire.db.DBTable

                    if (tableName.equals(skipTable))
                        continue;

                    // check if the found table exists in the DBDatabase object
                    String columnName = rd.getString(sysDB.CI.C_COLUMN_NAME);
                    DBTable dbTable = db.getTable(tableName);
                    DBView  dbView  = db.getView(tableName);
                   
                    String dataType = rd.getString(sysDB.CI.C_DATA_TYPE);
                    int charLength = rd.getInt(sysDB.CI.C_CHAR_LENGTH);
                    int dataLength = rd.getInt(sysDB.CI.C_DATA_LENGTH);
                    int dataPrecision = rd.getInt(sysDB.CI.C_DATA_PRECISION);
                    int dataScale = rd.getInt(sysDB.CI.C_DATA_SCALE);
                    String nullable = rd.getString(sysDB.CI.C_NULLABLE);
                   
                    dataDictionnary.fillDataDictionnary(tableName, columnName, dataType,
                                                        charLength, dataLength, dataPrecision, dataScale, nullable);
                   
                    if (dbTable != null)
                    {
                       
                        // check if the found column exists in the found DBTable
                        DBColumn col = dbTable.getColumn(columnName);
                        if (col == null)
                        {
                            log.warn("COLUMN NOT FOUND IN " + db.getClass().getName() + "\t: [" + tableName + "]["
                                           + columnName + "][" + dataType + "][" + dataLength + "]");
                            continue;
View Full Code Here

Examples of org.apache.empire.db.DBTable

    @Override
    public Object getNextSequenceValue(DBDatabase db, String seqName, int minValue, Connection conn)
    {   //Use Oracle Sequences
        if (useSequenceTable)
        {   // Use a sequence Table to generate Sequences
            DBTable t = db.getTable(sequenceTableName);
            return ((DBSeqTable)t).getNextValue(seqName, minValue, conn);
        }
        else
        {   // Post Detection
            return null;
View Full Code Here

Examples of org.databene.jdbacl.model.DBTable

  }
 
  public void exportTableChange(TableChange tableChange) throws IOException {
    FilePrintWriter out = null;
    try {
      DBTable oldTable = tableChange.getOldTable();
      DBTable newTable = tableChange.getNewTable();
      File htmlFile = tableFile(oldTable);
      FileUtil.ensureDirectoryExists(htmlFile.getParentFile());
      File cssFile = context.reportFile("mad4db.css");
      out = HtmlReportUtil.createFile(htmlFile, "Modified Table " + oldTable.getName(), Encodings.UTF_8, cssFile);
      context.printNavBarFor(tableFile(newTable), out);
      out.println("<table width='90%'>");
     
      // database name
      out.println("  <tr>");
      out.println("    <td width='50%' align='center'><h2>" + oldTable.getSchema().getCatalog().getDatabase().getEnvironment() + "</h2></td>");
      out.println("    <td width='50%' align='center'><h2>" + newTable.getSchema().getCatalog().getDatabase().getEnvironment() + "</h2></td>");
      out.println("  </tr>");
     
      //columns
      out.println("  <tr>");
      out.println("    <td width='50%'>");
View Full Code Here

Examples of org.jeecgframework.core.common.model.common.DBTable

          e.printStackTrace();
        }
      }
      String ids = request.getParameter("ids");
      XStream xStream = new XStream();
      DBTable dbTable = new DBTable();
      dbTable.setTableName("jeecg_demo");
      dbTable.setClass1(JeecgDemo.class);
      String sql = "select * from jeecg_demo";
      if(StringUtil.isNotEmpty(ids) && ids.split(",").length>0){
        sql += " where id in ('"+ids.replaceAll(",", "','")+"')";
      }
      List<JeecgDemo> list = jdbcDao.find(sql, JeecgDemo.class, null);
      //jdbcDao.executeSql("delete from jeecg_demo", null);
      dbTable.setTableData(list);
      xStream.processAnnotations(DBTable.class);
      FileOutputStream outputStream = new FileOutputStream(savePath);
      Writer writer = new OutputStreamWriter(outputStream, "UTF-8");
      writer.write("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\r\n");
      xStream.toXML(dbTable, writer);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.