use of org.dbflute.properties.DfSequenceIdentityProperties in project dbflute-core by dbflute.
the class Table method getSequenceCacheSize.
public Integer getSequenceCacheSize() {
if (!isUseSequence()) {
return null;
}
final DfSequenceIdentityProperties prop = getSequenceIdentityProperties();
final DfSchemaSource ds = getDatabase().getDataSource();
return prop.getSequenceCacheSize(ds, getUnifiedSchema(), getTableDbName());
}
use of org.dbflute.properties.DfSequenceIdentityProperties in project dbflute-core by dbflute.
the class Table method getSequenceReturnType.
public String getSequenceReturnType() {
final DfSequenceIdentityProperties sequenceIdentityProperties = getProperties().getSequenceIdentityProperties();
final String sequenceReturnType = sequenceIdentityProperties.getSequenceReturnType();
if (hasCompoundPrimaryKey()) {
return sequenceReturnType;
}
final Column primaryKeyAsOne = getPrimaryKeyAsOne();
if (primaryKeyAsOne.isJavaNativeNumberObject()) {
return primaryKeyAsOne.getJavaNative();
}
return sequenceReturnType;
}
use of org.dbflute.properties.DfSequenceIdentityProperties 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.DfSequenceIdentityProperties in project dbflute-core by dbflute.
the class Table method getIdentityColumn.
protected Column getIdentityColumn() {
if (!isUseIdentity()) {
return null;
}
// It gives priority to auto-increment information of JDBC.
final Column autoIncrementColumn = getAutoIncrementColumn();
if (autoIncrementColumn != null) {
return autoIncrementColumn;
}
final DfSequenceIdentityProperties prop = getSequenceIdentityProperties();
final String columnName = prop.getIdentityColumnName(getTableDbName());
final Column column = getColumn(columnName);
if (column == null) {
String msg = "The columnName does not exist in the table: ";
msg = msg + " tableName=" + getTableDbName() + " columnName=" + columnName;
msg = msg + " columnList=" + getColumnNameCommaString();
throw new IllegalStateException(msg);
}
return column;
}
Aggregations