Tabnine Logo
StandardField.getName
Code IndexAdd Tabnine to your IDE (free)

How to use
getName
method
in
org.tinygroup.metadata.config.stdfield.StandardField

Best Java code snippets using org.tinygroup.metadata.config.stdfield.StandardField.getName (Showing top 20 results out of 315)

origin: org.tinygroup/ientity

/**
 * 
 * 
 * @param 标准字段
 * @return
 */
public static String getDbFieldName(String standardFieldId) {
  return MetadataUtil.getStandardField(standardFieldId).getName();
}
origin: org.tinygroup/org.tinygroup.ientity

/**
 * 
 * 
 * @param 标准字段
 * @return
 */
public static String getDbFieldName(String standardFieldId) {
  return MetadataUtil.getStandardField(standardFieldId).getName();
}
origin: org.tinygroup/ientity

/**
 * 
 * 
 * @param 找不到标准字段则返回参数
 * @return
 */
public String getDbFieldName(String standardFieldId) {
  try {
    StandardField standardField=getStandardField(standardFieldId);
    return standardField.getName();
  } catch (Exception e) {
  }
  return standardFieldId;
}
origin: org.tinygroup/org.tinygroup.ientity

/**
 * 
 * 
 * @param 找不到标准字段则返回参数
 * @return
 */
public String getDbFieldName(String standardFieldId) {
  try {
    StandardField standardField=getStandardField(standardFieldId);
    return standardField.getName();
  } catch (Exception e) {
  }
  return standardFieldId;
}
origin: org.tinygroup/org.tinygroup.database

private void appendFooterColumnComment(Table table, StandardField standardField, String standardComment, List list) {
  String schema = StringUtil.defaultIfBlank(table.getSchema(), "dbo");
  String comment = String.format("execute sp_addextendedproperty N'MS_Description', N'%s', N'SCHEMA', N'%s', N'TABLE', N'%s', N'COLUMN', N'%s'"
      , standardComment, schema, table.getNameWithOutSchema(), standardField.getName());
  list.add(comment);
}
origin: org.tinygroup/org.tinygroup.database

protected String getFieldStdFieldName(String fieldId, Table table) {
  for (TableField field : table.getFieldList()) {
    if (field.getId().equals(fieldId)) {
      StandardField standardField = MetadataUtil.getStandardField(
          field.getStandardFieldId(), this.getClass()
              .getClassLoader());
      return DataBaseUtil.getDataBaseName(standardField.getName());
    }
  }
  throw new RuntimeException(String.format(
      "未找到ID:%s的表格字段(或该表格字段对应的标准字段)", fieldId));
}
origin: org.tinygroup/org.tinygroup.database

private void appendFooterColumnComment(Table table, StandardField standardField, String standardComment, List list) {
  String columnName;
  if (StringUtil.isBlank(table.getSchema())) {
    columnName = String.format("%s.%s", delimiter(table.getNameWithOutSchema()),
        delimiter(standardField.getName()));
  } else {
    columnName = String.format("%s.%s.%s", delimiter(table.getSchema()), delimiter(table.getNameWithOutSchema()),
        delimiter(standardField.getName()));
  }
  StringBuffer commentBuffer = new StringBuffer();
  commentBuffer.append("COMMENT ON COLUMN ").append(columnName)
      .append(" IS ").append("'").append(standardComment).append("'");
  list.add(commentBuffer.toString());
}
origin: org.tinygroup/org.tinygroup.database

  protected String getFieldStdFieldName(String fieldId, Table table) {
    for (TableField field : table.getFieldList()) {
      if (field.getId().equals(fieldId)) {
        StandardField standardField = MetadataUtil.getStandardField(
            field.getStandardFieldId(), this.getClass()
                .getClassLoader());
        return DataBaseUtil.getDataBaseName(standardField.getName());
      }
    }
    throw new RuntimeException(String.format(
        "未找到ID:%s的表格字段(或该表格字段对应的标准字段)", fieldId));
  }
}
origin: org.tinygroup/org.tinygroup.database

private boolean recordExists(ValuePair valuePair, Table table, PreparedStatement preparedStatement) {
  List pks = getPrimaryKeys(table);
  StandardField standField = DataBaseUtil
      .getStandardField(valuePair.getTableFieldId(), table, this
          .getClass().getClassLoader());
  String standFieldName = DataBaseUtil.getDataBaseName(standField
      .getName());
  if (!pks.contains(standFieldName)) {
    return false;
  }
  try {
    preparedStatement.setObject(1, valuePair.getValue());
    ResultSet resultSet = preparedStatement.executeQuery();
    if (resultSet.next() && resultSet.getLong(1) > 0) {
      return true;
    }
    return false;
  } catch (Exception e) {
    throw new RuntimeException(e);
  }
}
origin: org.tinygroup/org.tinygroup.database

private List<String> getPrimaryKeys(Table table) {
  List<String> keys = new ArrayList<String>();
  for (TableField field : table.getFieldList()) {
    if (field.getPrimary()) {
      StandardField stdField = MetadataUtil
          .getStandardField(field.getStandardFieldId(), this
              .getClass().getClassLoader());
      keys.add(DataBaseUtil.getDataBaseName(stdField.getName())
      );
    }
  }
  return keys;
}
origin: org.tinygroup/org.tinygroup.database

/**
 * 将tablefields组装成k-v
 *
 * @param fields
 * @return
 */
private Map<String, TableField> getFiledDbNames(List<TableField> fields) {
  Map<String, TableField> filedDbNames = new HashMap<String, TableField>();
  for (TableField field : fields) {
    StandardField standardField = MetadataUtil.getStandardField(field
        .getStandardFieldId(), this.getClass().getClassLoader());
    String filedDbName = DataBaseUtil.getDataBaseName(standardField
        .getName());
    filedDbNames.put(DataBaseNameUtil.getColumnNameFormat(filedDbName),
        field);
  }
  return filedDbNames;
}
origin: org.tinygroup/org.tinygroup.database

protected void appendField(StringBuffer ddlBuffer, TableField field, List<String> list, Table table) {
  StandardField standardField = MetadataUtil.getStandardField(
      field.getStandardFieldId(), this.getClass().getClassLoader());
  ddlBuffer.append(String.format("\t%s ",
      delimiter(DataBaseUtil.getDataBaseName(standardField.getName()))));
  ddlBuffer.append(" ");
  String stdFieldTp = getDataTpOfStdFiled(standardField);
  ddlBuffer.append(stdFieldTp);
  appendTypeAndDefault(ddlBuffer, field, standardField);
  dealComment(ddlBuffer, standardField, list);
}
origin: org.tinygroup/org.tinygroup.database

protected void defaultChangedFooterComment(Connection connection, Table table, List<String> list) throws SQLException {
  DatabaseMetaData metadata = connection.getMetaData();
  String catalog = connection.getCatalog();
  Map<String, Map<String, String>> dbColumns = getColumns(metadata,
      catalog, table);
  for (TableField field : table.getFieldList()) {
    StandardField standardField = MetadataUtil.getStandardField(
        field.getStandardFieldId(), this.getClass().getClassLoader());
    String standardComment = getComment(standardField);
    if (standardField.getName() != null) {
      Map<String, String> attribute = dbColumns.get(standardField.getName().toLowerCase());
      if (attribute == null) {
        attribute = dbColumns.get(standardField.getName().toUpperCase());
      }
      String remarks = (attribute == null) ? null : getDbColumnRemarks(attribute);
      //相等跳过
      if (StringUtil.equals(standardComment, remarks)) {
        continue;
      }
    }
    appendFooterColumnComment(table, standardField, standardComment, list);
  }
}
origin: org.tinygroup/org.tinygroup.database

protected StringBuffer getKeysBuffer(Table table) {
  List<TableField> fieldList = table.getFieldList();
  StringBuffer keyBuffer = new StringBuffer();
  boolean isFirst = true;
  for (int i = 0; i < fieldList.size(); i++) {
    TableField tableField = fieldList.get(i);
    Boolean primary = tableField.getPrimary();
    if (primary == null || !primary.booleanValue()) {
      continue;
    }
    if (!isFirst) {
      keyBuffer.append(",");
    } else {
      isFirst = false;
    }
    StandardField standardField = MetadataUtil.getStandardField(
        tableField.getStandardFieldId(), this.getClass().getClassLoader());
    keyBuffer.append(delimiter(DataBaseUtil.getDataBaseName(standardField.getName())));
  }
  return keyBuffer;
}
origin: org.tinygroup/org.tinygroup.database

protected List<String> getSeqTriggerSql(Table table, String packageName) {
  List<String> sqlList = new ArrayList<String>();
  for (TableField tableField : table.getFieldList()) {
    //非自增长和非主键排除
    if (!tableField.isAutoIncrease() || !tableField.getPrimary()) {
      continue;
    }
    StandardField standardField = MetadataUtil.getStandardField(
        tableField.getStandardFieldId(), this.getClass().getClassLoader());
    sqlList.add(String.format("create sequence %s", getSeqName(table)).toUpperCase());
    if (ConfigUtil.isUseDbTrigger()) {
      String baseStr = "create or replace trigger %s before insert on %s for each row" +
          " when (new.%s is null) begin select %s.nextval into :new.%s from dual; end;";
      String from = DataBaseUtil.fromSourceLocal.get();
      //从工具
      if (from != null && from.equals("tool")) {
        baseStr += "\n/\n";
      }
      String triggerName = "TRI_" + table.getNameWithOutSchema();
      sqlList.add(String.format(baseStr, triggerName,
          table.getNameWithOutSchema(), standardField.getName(), getSeqName(table)
          , standardField.getName()).toUpperCase());
    }
  }
  return sqlList;
}
origin: org.tinygroup/ientity

public Map<String, List<ValidateRule>> getOperationValidateMap(
    BaseModel model, Object operation) {
  Map<String, List<ValidateRule>> map = new HashMap<String, List<ValidateRule>>();
  if (operation instanceof Operation && model instanceof EntityModel) {
    Operation operationInstance = (Operation) operation;
    EntityModel entityModel = (EntityModel) model;
    List<Field> operationFields = entityModel
        .getOperationFields(operationInstance);
    for (Field field : operationFields) {
      if (field.getValidateRules() != null
          && field.getValidateRules().size() > 0) {
        map.put(entityModel.getCamelName(entityModel
            .getStandardField(field.getId()).getName()), field
            .getValidateRules());
      }
    }
  }
  return map;
}
origin: org.tinygroup/org.tinygroup.ientity

public Map<String, List<ValidateRule>> getOperationValidateMap(
    BaseModel model, Object operation) {
  Map<String, List<ValidateRule>> map = new HashMap<String, List<ValidateRule>>();
  if (operation instanceof Operation && model instanceof EntityModel) {
    Operation operationInstance = (Operation) operation;
    EntityModel entityModel = (EntityModel) model;
    List<Field> operationFields = entityModel
        .getOperationFields(operationInstance);
    for (Field field : operationFields) {
      if (field.getValidateRules() != null
          && field.getValidateRules().size() > 0) {
        map.put(entityModel.getCamelName(entityModel
            .getStandardField(field.getId()).getName()), field
            .getValidateRules());
      }
    }
  }
  return map;
}
origin: org.tinygroup/ientity

public List<String> getParamterList(BaseModel model, Object operationObject) {
  EntityModel entityModel = (EntityModel) model;
  List<ConditionField> conditionFields = null;
  if (operationObject instanceof Operation) {
    Operation operation = (Operation) operationObject;
    conditionFields = operation.getConditionFields();
  } else {// View
    View view = (View) operationObject;
    conditionFields = view.getConditionFields();
  }
  List<String> result = new ArrayList<String>();
  for (ConditionField conditionField : conditionFields) {
    if (!conditionField.isHidden()) {
      String camelName = entityModel.getCamelName(entityModel
          .getStandardField(conditionField.getFieldId())
          .getName());
      result.add(camelName);
    }
  }
  return result;
}
origin: org.tinygroup/org.tinygroup.ientity

public List<String> getParamterList(BaseModel model, Object operationObject) {
  EntityModel entityModel = (EntityModel) model;
  List<ConditionField> conditionFields = null;
  if (operationObject instanceof Operation) {
    Operation operation = (Operation) operationObject;
    conditionFields = operation.getConditionFields();
  } else {// View
    View view = (View) operationObject;
    conditionFields = view.getConditionFields();
  }
  List<String> result = new ArrayList<String>();
  for (ConditionField conditionField : conditionFields) {
    if (!conditionField.isHidden()) {
      String camelName = entityModel.getCamelName(entityModel
          .getStandardField(conditionField.getFieldId())
          .getName());
      result.add(camelName);
    }
  }
  return result;
}
origin: org.tinygroup/org.tinygroup.tinydb

private void tableFieldConvert(TableConfiguration configuration,
                TableField tableField) {
  ColumnConfiguration column = new ColumnConfiguration();
  String standardFieldId = tableField.getStandardFieldId();
  StandardField standardField = MetadataUtil.getStandardField(
      standardFieldId, this.getClass().getClassLoader());
  if (standardField == null) {
    logger.logMessage(LogLevel.ERROR, "找不到[{}]对应的标准字段信息",
        standardFieldId);
    return;
  }
  StandardType standardType = MetadataUtil.getStandardType(standardFieldId, this.getClass().getClassLoader());
  DialectType dialectType = MetadataUtil.getDialectType(standardFieldId,
      getDatabase(), this.getClass().getClassLoader());
  column.setColumnName(standardField.getName());
  column.setAllowNull(Boolean.toString(!tableField.getNotNull()));
  column.setColumnSize(MetadataUtil.getPlaceholderValue(standardFieldId,
      COLUMN_SIZE_HOLDER, this.getClass().getClassLoader()));
  column.setDataType(standardType.getDataType());
  column.setPrimaryKey(tableField.getPrimary());
  column.setDecimalDigits(MetadataUtil.getPlaceholderValue(
      standardFieldId, DECIMAL_DIGITS_HOLDER, "0", this.getClass()
          .getClassLoader()));
  column.setTypeName(dialectType.getType());
  configuration.addColumn(column);
}
org.tinygroup.metadata.config.stdfieldStandardFieldgetName

Popular methods of StandardField

  • <init>
  • getId
  • getTitle
  • setName
  • setTitle
  • getDefaultValue
  • getDescription
  • getNickNames
  • getTypeId
  • setDefaultValue
  • setDescription
  • setId
  • setDescription,
  • setId,
  • setTypeId

Popular in Java

  • Reactive rest calls using spring rest template
  • requestLocationUpdates (LocationManager)
  • getSharedPreferences (Context)
  • setScale (BigDecimal)
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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