- java.lang.Object
-
- org.tentackle.model.impl.NameVerifierImpl
-
- All Implemented Interfaces:
NameVerifier
@Service(NameVerifier.class) public class NameVerifierImpl extends Object implements NameVerifier
Default implementation of aNameVerifier.
-
-
Constructor Summary
Constructors Constructor Description NameVerifierImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanisAllUpperOrLowerCase(String name, Entity entity)Checks whether the given name is all upper- or all lowercase.
The backends are usually not case-sensitive (unless the SQL names are quoted), but it is good style to either use all upper- or all lowercase.protected booleanisNotQuotedOrProvided(String name, Entity entity)Checks whether the name is quoted.StringverifyAttributeName(Attribute attribute)Verifies the Java name of an attribute.StringverifyColumnName(Attribute attribute)Verifies the column name of an attribute.StringverifyEntityName(Entity entity)Verifies the Java name of an entity.StringverifyIndexName(Index index)Verifies the name of an index.StringverifyTableAlias(Entity entity)Verifies the table alias of an entity.StringverifyTableName(Entity entity)Verifies the table name of an entity.
-
-
-
Method Detail
-
verifyEntityName
public String verifyEntityName(Entity entity)
Description copied from interface:NameVerifierVerifies the Java name of an entity.- Specified by:
verifyEntityNamein interfaceNameVerifier- Parameters:
entity- the entity- Returns:
- null if ok, else a diagnostic message
-
verifyTableName
public String verifyTableName(Entity entity)
Description copied from interface:NameVerifierVerifies the table name of an entity.- Specified by:
verifyTableNamein interfaceNameVerifier- Parameters:
entity- the entity- Returns:
- null if ok, else a diagnostic message
-
verifyTableAlias
public String verifyTableAlias(Entity entity)
Description copied from interface:NameVerifierVerifies the table alias of an entity.- Specified by:
verifyTableAliasin interfaceNameVerifier- Parameters:
entity- the entity- Returns:
- null if ok, else a diagnostic message
-
verifyAttributeName
public String verifyAttributeName(Attribute attribute)
Description copied from interface:NameVerifierVerifies the Java name of an attribute.- Specified by:
verifyAttributeNamein interfaceNameVerifier- Parameters:
attribute- the attribute- Returns:
- null if ok, else a diagnostic message
-
verifyColumnName
public String verifyColumnName(Attribute attribute)
Description copied from interface:NameVerifierVerifies the column name of an attribute.- Specified by:
verifyColumnNamein interfaceNameVerifier- Parameters:
attribute- the attribute- Returns:
- null if ok, else a diagnostic message
-
verifyIndexName
public String verifyIndexName(Index index)
Description copied from interface:NameVerifierVerifies the name of an index.- Specified by:
verifyIndexNamein interfaceNameVerifier- Parameters:
index- the index- Returns:
- null if ok, else a diagnostic message
-
isAllUpperOrLowerCase
protected boolean isAllUpperOrLowerCase(String name, Entity entity)
Checks whether the given name is all upper- or all lowercase.
The backends are usually not case-sensitive (unless the SQL names are quoted), but it is good style to either use all upper- or all lowercase. Mixing the case pretends that the case is important, but in fact it's not. This is only allowed for provided entities.- Parameters:
name- the nameentity- the entity- Returns:
- true if ok, false if mixed
-
-