Examples of DatabaseTable


Examples of com.founder.fix.bpmn2extensions.sqlmappingconfig.DataBaseTable

   * @param queryLocation
   * @return
   */
  public static String getTableSelect(String tableId,QueryLocation queryLocation){
    ProcessEngineConfigurationImpl processEngineConfigurationImpl = ProcessEngineManagement.getDefaultProcessEngine().getProcessEngineConfiguration();
    DataBaseTable dataBaseTable = processEngineConfigurationImpl.getDataBaseTable(tableId);
    if(dataBaseTable == null){
      throw new FixFlowException("未找到id为"+tableId+"的table配置");
    }
    if(!StringUtil.getBoolean(processEngineConfigurationImpl.getPigeonholeConfig().getIsEnable())){
      return dataBaseTable.getTableValue();
    }
    String tableName = "";
    if(QueryLocation.HIS.equals(queryLocation)){
      tableName =  dataBaseTable.getArchiveTable();
    }else if(QueryLocation.RUN_HIS.equals(queryLocation)){
      StringBuilder sbColumn = new StringBuilder();
      for(Column column :dataBaseTable.getColumn()){
        sbColumn.append(column.getColumn());
        sbColumn.append(",");
      }
      String columnString = sbColumn.toString().substring(0,sbColumn.toString().length()-1);
      tableName = dataBaseTable.getTableValue();
      String hisTableName = dataBaseTable.getArchiveTable();
     
      tableName = "(select "+columnString+" from "+tableName+" union all select "+columnString+" from "+hisTableName+")";
    }else{
      tableName = dataBaseTable.getTableValue();
    }
    return tableName;
  }
View Full Code Here

Examples of com.j256.ormlite.table.DatabaseTable

      @SuppressWarnings("unchecked")
      D castDao = (D) dao;
      return castDao;
    }

    DatabaseTable databaseTable = clazz.getAnnotation(DatabaseTable.class);
    if (databaseTable == null || databaseTable.daoClass() == Void.class
        || databaseTable.daoClass() == BaseDaoImpl.class) {
      @SuppressWarnings("deprecation")
      Dao<T, ?> daoTmp = BaseDaoImpl.createDao(connectionSource, clazz);
      dao = daoTmp;
    } else {
      Class<?> daoClass = databaseTable.daoClass();
      Constructor<?> daoConstructor = null;
      Object[] arguments = null;
      Constructor<?>[] constructors = daoClass.getConstructors();
      // look first for the constructor with a class parameter in case it is a generic dao
      for (Constructor<?> constructor : constructors) {
View Full Code Here

Examples of com.j256.ormlite.table.DatabaseTable

      @SuppressWarnings("unchecked")
      D castDao = (D) dao;
      return castDao;
    }

    DatabaseTable databaseTable = tableConfig.getDataClass().getAnnotation(DatabaseTable.class);
    if (databaseTable == null || databaseTable.daoClass() == Void.class
        || databaseTable.daoClass() == BaseDaoImpl.class) {
      @SuppressWarnings("deprecation")
      Dao<T, ?> daoTmp = BaseDaoImpl.createDao(connectionSource, tableConfig);
      dao = daoTmp;
    } else {
      Class<?> daoClass = databaseTable.daoClass();
      Constructor<?> constructor;
      try {
        constructor = daoClass.getConstructor(ConnectionSource.class, DatabaseTableConfig.class);
      } catch (Exception e) {
        throw SqlExceptionUtil.create(
View Full Code Here

Examples of oracle.toplink.essentials.internal.helper.DatabaseTable

    return 128;
  }

  @Override
  public final DatabaseTable getTempTableForTable(final DatabaseTable table) {
    return new DatabaseTable("$" + table.getName(), table.getTableQualifier());
  }
View Full Code Here

Examples of oracle.toplink.essentials.internal.helper.DatabaseTable

     * This should handle most of the direct/relational mappings except many-to-many and direct
     * collection/map mappings, witch must be down in postInit method.
     */
    protected void initTableSchema(ClassDescriptor desc) {
        TableDefinition tblDef = null;
        DatabaseTable dbTbl = null;
        Iterator dbTblIter = desc.getTables().iterator();

        //create a table definition for each mapped database table
        while (dbTblIter.hasNext()) {
            dbTbl = (DatabaseTable) dbTblIter.next();
View Full Code Here

Examples of oracle.toplink.essentials.internal.helper.DatabaseTable

            fkField = resolveDatabaseField(fkField, targetField);
            setFieldToRelationTable(fkField, tblDef);
        }
       
        // add a foreign key constraint from fk field to target field
        DatabaseTable targetTable = targetField.getTable();
        TableDefinition targetTblDef = getTableDefFromDBTable(targetTable);
       
        addForeignKeyConstraint(tblDef, targetTblDef, fkFieldNames, targetFieldNames);
    }
View Full Code Here

Examples of oracle.toplink.essentials.internal.helper.DatabaseTable

        // only if there are additional tables
        if (!desc.hasMultipleTables()) {
            return;
        }
       
        DatabaseTable dbTbl = null;
        Iterator dbTblIter = desc.getTables().iterator();
        while (dbTblIter.hasNext()) {
            dbTbl = (DatabaseTable) dbTblIter.next();
            Map<DatabaseField, DatabaseField> srcFields = desc.getAdditionalTablePrimaryKeyFields().get(dbTbl);
            if ((null != srcFields) && srcFields.size() > 0) {
View Full Code Here

Examples of oracle.toplink.essentials.internal.helper.DatabaseTable

    public void setTable(DatabaseTable table) {
        this.table = table;
    }
   
    public void setTableName(String name) {
        table = new DatabaseTable(name);
    }
View Full Code Here

Examples of oracle.toplink.essentials.internal.helper.DatabaseTable

               
            }
        }

        // add a foreign key constraint
        DatabaseTable sourceTable = fkField.getTable();
        DatabaseTable targetTable = targetField.getTable();
        TableDefinition sourceTableDef = getTableDefFromDBTable(sourceTable);
        TableDefinition targetTableDef = getTableDefFromDBTable(targetTable);
       
        addForeignKeyConstraint(sourceTableDef, targetTableDef, fkFieldNames, targetFieldNames);
    }
View Full Code Here

Examples of oracle.toplink.essentials.internal.helper.DatabaseTable

            while(itEntries.hasNext()) {
                writeForAll(writer, firstMainPrimaryKey);
                writer.write(trpltab);
                writer.write("UPDATE ");
                Map.Entry entry = (Map.Entry)itEntries.next();
                DatabaseTable t = (DatabaseTable)entry.getKey();
                writer.write(t.getQualifiedName());
                writer.write(" SET ");
                HashMap databaseFieldsToValues = (HashMap)entry.getValue();
                int counter = 0;
                Iterator itDatabaseFields = databaseFieldsToValues.keySet().iterator();
                while(itDatabaseFields.hasNext()) {
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.