Java Code Examples for org.apache.ibatis.mapping.MappedStatement#getDatabaseId()

The following examples show how to use org.apache.ibatis.mapping.MappedStatement#getDatabaseId() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: XMLStatementBuilder.java    From mybaties with Apache License 2.0 6 votes vote down vote up
private boolean databaseIdMatchesCurrent(String id, String databaseId, String requiredDatabaseId) {
  if (requiredDatabaseId != null) {
    if (!requiredDatabaseId.equals(databaseId)) {
      return false;
    }
  } else {
    if (databaseId != null) {
      return false;
    }
    // skip this statement if there is a previous one with a not null databaseId
    id = builderAssistant.applyCurrentNamespace(id, false);
    if (this.configuration.hasStatement(id, false)) {
      MappedStatement previous = this.configuration.getMappedStatement(id, false); // issue #2
      if (previous.getDatabaseId() != null) {
        return false;
      }
    }
  }
  return true;
}
 
Example 2
Source File: XMLStatementBuilder.java    From mybatis with Apache License 2.0 6 votes vote down vote up
private boolean databaseIdMatchesCurrent(String id, String databaseId, String requiredDatabaseId) {
  if (requiredDatabaseId != null) {
    if (!requiredDatabaseId.equals(databaseId)) {
      return false;
    }
  } else {
    if (databaseId != null) {
      return false;
    }
    // skip this statement if there is a previous one with a not null databaseId
    id = builderAssistant.applyCurrentNamespace(id, false);
    if (this.configuration.hasStatement(id, false)) {
      MappedStatement previous = this.configuration.getMappedStatement(id, false); // issue #2
      if (previous.getDatabaseId() != null) {
        return false;
      }
    }
  }
  return true;
}