java.lang.Object
org.tentackle.model.migrate.MigrationUtilities
Utility methods to match columns for migration.
May be replaced by project specific migration rules via
May be replaced by project specific migration rules via
@Service.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionFinds the best match for a given model name among existing names.booleanReturns whether the given string contains at least one vowel.extractSyllables(String name) Extracts the syllables of a name.
The default implementation is very simple, but works good enough for the purpose of column migration.static MigrationUtilitiesThe singleton.booleanisVowel(char c) Returns whether the character should be treated as a vowel.
-
Constructor Details
-
MigrationUtilities
public MigrationUtilities()
-
-
Method Details
-
getInstance
The singleton.- Returns:
- the singleton
-
isVowel
public boolean isVowel(char c) Returns whether the character should be treated as a vowel.- Parameters:
c- the character- Returns:
- true if vowel
-
containsVowel
Returns whether the given string contains at least one vowel.- Parameters:
s- the string- Returns:
- true if vowels found
-
extractSyllables
Extracts the syllables of a name.
The default implementation is very simple, but works good enough for the purpose of column migration.- Parameters:
name- the column name- Returns:
- the syllables
-
bestMatch
Finds the best match for a given model name among existing names.- Parameters:
modelName- the new name according to the modelexistingNames- the existing column names in the database table- Returns:
- the best match, null if existingnames is empty
-