private NamingConvention namingConvention(SqlDbServiceConfig svcConfig) { if (!svcConfig.rawConf.containsKey("naming.convention")) { // https://github.com/actframework/act-ebean2/issues/1 return new UnderscoreNamingConvention(); } //TODO provide more actuate naming convention matching logic if (MATCHING == svcConfig.tableNamingConvention) { return new MatchingNamingConvention(); } return new UnderscoreNamingConvention(); }
/** * Set the naming convention to underscore if it has not already been set. */ private void setNamingConvention(ServerConfig config) { if (config.getNamingConvention() == null) { config.setNamingConvention(new UnderscoreNamingConvention()); } }
/** * Set the naming convention to underscore if it has not already been set. */ private void setNamingConvention(ServerConfig config) { if (config.getNamingConvention() == null) { UnderscoreNamingConvention nc = new UnderscoreNamingConvention(); config.setNamingConvention(nc); String v = config.getProperty("namingConvention.useForeignKeyPrefix"); if (v != null) { boolean useForeignKeyPrefix = Boolean.valueOf(v); nc.setUseForeignKeyPrefix(useForeignKeyPrefix); } String sequenceFormat = config.getProperty("namingConvention.sequenceFormat"); if (sequenceFormat != null) { nc.setSequenceFormat(sequenceFormat); } } }
/** * Set the naming convention to underscore if it has not already been set. */ private void setNamingConvention(ServerConfig config) { if (config.getNamingConvention() == null) { UnderscoreNamingConvention nc = new UnderscoreNamingConvention(); config.setNamingConvention(nc); String v = config.getProperty("namingConvention.useForeignKeyPrefix"); if (v != null) { boolean useForeignKeyPrefix = Boolean.valueOf(v); nc.setUseForeignKeyPrefix(useForeignKeyPrefix); } String sequenceFormat = config.getProperty("namingConvention.sequenceFormat"); if (sequenceFormat != null) { nc.setSequenceFormat(sequenceFormat); } } }