Java Code Examples for org.springframework.orm.jpa.vendor.Database

Following code examples demonstrate how to use org.springframework.orm.jpa.vendor.Databasefrom spring-framework. These examples are extracted from various highly rated open source projects. You can directly use these code snippets or view their entire linked source code. These snippets are extracted to provide contextual information about how to use this class in the real world. These samples also let you understand some good practices on how to use org.springframework.orm.jpa.vendor.Databaseand various code implementation of this class.

 protected Class<?> determineDatabaseDialectClass(Database database) {

  if (Database.HSQL.equals(database)) {
   return CustomHsqlDialect.class;
  }

  return super.determineDatabaseDialectClass(database);
 } 


  String smartAnalyseDatabase(String name) {
    if (name.startsWith("Microsoft sql")) {
      return Database.SQL_SERVER.name();
    }
    for (Database database : Database.values()) {
      if (database.name().equalsIgnoreCase(name)) {
        return database.name();
      }
    }
    Matcher m = FIRST_WORD.matcher(name);
    if (m.find()) {
      String firstLetter = m.group(1);
      for (Database database : Database.values()) {
        if (database.name().equalsIgnoreCase(firstLetter)) {
          return database.name();
        }
      }
    }
    return "Choose a database vendor from 'org.springframework.orm.jpa.vendor.Database'";
  } 

Advertisement
Advertisement