use of org.dbflute.properties.DfBasicProperties in project dbflute-core by dbflute.
the class DfGapileProcess method createReflector.
protected DfGapileClassReflector createReflector(String gapileDirectory) {
final DfBasicProperties prop = getBasicProperties();
final String outputDirectory = prop.getGenerateOutputDirectory();
final String packageBase = prop.getPackageBase();
final DfLanguageDependency lang = prop.getLanguageDependency();
final DfLanguageClassPackage classPackage = lang.getLanguageClassPackage();
final DfLanguageGrammar grammar = lang.getLanguageGrammar();
return new DfGapileClassReflector(outputDirectory, packageBase, classPackage, grammar, gapileDirectory);
}
use of org.dbflute.properties.DfBasicProperties in project dbflute-core by dbflute.
the class DfLanguagePropertyPackageResolver method doResolvePackageName.
protected String doResolvePackageName(String typeName, boolean exceptUtil) {
if (typeName == null) {
return typeName;
}
final String processed = processLanguageType(typeName, exceptUtil);
if (processed != null) {
return processed;
}
if (typeName.contains(VAR_CDEF)) {
final DfBasicProperties prop = getBasicProperties();
final String pkg = prop.getBaseCommonPackage();
typeName = DfStringUtil.replace(typeName, VAR_CDEF, pkg + "." + prop.getCDefPureName());
}
if (typeName.contains(VAR_DOMAIN + ".")) {
// as domain entity
final String pkg = getBasicProperties().getExtendedEntityPackage();
typeName = Srl.replace(typeName, VAR_DOMAIN + ".", pkg + ".");
}
if (typeName.contains(VAR_CUSTOMIZE + ".")) {
// as customize entity
final String pkg = getOutsideSqlProperties().getExtendedEntityPackage();
typeName = Srl.replace(typeName, VAR_CUSTOMIZE + ".", pkg + ".");
}
if (typeName.contains(VAR_PMB + ".")) {
// as parameter-bean
final String pkg = getOutsideSqlProperties().getExtendedParameterBeanPackage();
typeName = Srl.replace(typeName, VAR_PMB + ".", pkg + ".");
}
return typeName;
}
use of org.dbflute.properties.DfBasicProperties in project dbflute-core by dbflute.
the class Table method isUseIdentity.
// ===================================================================================
// Identity
// ========
/**
* Determine whether this table uses an identity.
* @return The determination, true or false.
*/
public boolean isUseIdentity() {
final DfBasicProperties basicProperties = getBasicProperties();
// because serial type is treated as sequence
if (basicProperties.isDatabasePostgreSQL()) {
return false;
}
// It gives priority to auto-increment information of JDBC.
if (hasAutoIncrementColumn()) {
return true;
}
final DfSequenceIdentityProperties prop = getSequenceIdentityProperties();
return prop.getIdentityColumnName(getTableDbName()) != null;
}
use of org.dbflute.properties.DfBasicProperties in project dbflute-core by dbflute.
the class Table method extractPostgreSQLSerialSequenceName.
/**
* Extract sequence name of postgreSQL serial type column.
* @return Sequence name of postgreSQL serial type column. (NullAllowed: If null, not found)
*/
protected String extractPostgreSQLSerialSequenceName() {
final DfBasicProperties basicProperties = getBasicProperties();
if (!basicProperties.isDatabasePostgreSQL() || !hasAutoIncrementColumn()) {
return null;
}
final Column autoIncrementColumn = getAutoIncrementColumn();
if (autoIncrementColumn == null) {
return null;
}
final String defaultValue = autoIncrementColumn.getDefaultValue();
if (defaultValue == null) {
return null;
}
final String prefix = "nextval('";
if (!defaultValue.startsWith(prefix)) {
return null;
}
final String excludedPrefixString = defaultValue.substring(prefix.length());
final int endIndex = excludedPrefixString.indexOf("'");
if (endIndex < 0) {
return null;
}
return excludedPrefixString.substring(0, endIndex);
}
use of org.dbflute.properties.DfBasicProperties in project dbflute-core by dbflute.
the class Procedure method getProcedureUniqueName.
// ===================================================================================
// Derived Property
// ================
public String getProcedureUniqueName() {
final DfBasicProperties prop = getBasicProperties();
final String filteredName;
if (prop.isDatabaseSQLServer()) {
// SQLServer returns 'sp_foo;1'
filteredName = Srl.substringLastFront(_procedureName, ";");
} else {
filteredName = _procedureName;
}
return _unifiedSchema.getCatalogSchema() + "." + filteredName;
}
Aggregations