mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#1279 - Change ObjectFactory method to match, tidy format (no real change here)
This commit is contained in:
@@ -77,7 +77,6 @@ public interface TableDdl {
|
||||
|
||||
/**
|
||||
* Writes alter foreign key statements.
|
||||
* @throws IOException
|
||||
*/
|
||||
void generate(DdlWrite writer, AlterForeignKey alterForeignKey) throws IOException;
|
||||
|
||||
|
||||
@@ -663,9 +663,7 @@ public class BaseTableDdl implements TableDdl {
|
||||
@Override
|
||||
public void generate(DdlWrite writer, AlterForeignKey alterForeignKey) throws IOException {
|
||||
if (DdlHelp.isDropForeignKey(alterForeignKey.getColumnNames())) {
|
||||
|
||||
String ddl = platformDdl.alterTableDropForeignKey(alterForeignKey.getTableName(),
|
||||
alterForeignKey.getName());
|
||||
String ddl = platformDdl.alterTableDropForeignKey(alterForeignKey.getTableName(), alterForeignKey.getName());
|
||||
if (hasValue(ddl)) {
|
||||
writer.apply().append(ddl).endOfStatement();
|
||||
}
|
||||
|
||||
@@ -195,9 +195,9 @@ public class ObjectFactory {
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link CompoundUniqueConstraint }
|
||||
* Create an instance of {@link AddUniqueConstraint }
|
||||
*/
|
||||
public AddUniqueConstraint createCompoundUniqueConstraint() {
|
||||
public AddUniqueConstraint createAddUniqueConstraint() {
|
||||
return new AddUniqueConstraint();
|
||||
}
|
||||
|
||||
|
||||
@@ -169,8 +169,7 @@ public class MTable {
|
||||
}
|
||||
List<UniqueConstraint> uqConstraints = createTable.getUniqueConstraint();
|
||||
for (UniqueConstraint uq : uqConstraints) {
|
||||
MCompoundUniqueConstraint mUq = new MCompoundUniqueConstraint(
|
||||
SplitColumns.split(uq.getColumnNames()), uq.isOneToOne(), uq.getName());
|
||||
MCompoundUniqueConstraint mUq = new MCompoundUniqueConstraint(SplitColumns.split(uq.getColumnNames()), uq.isOneToOne(), uq.getName());
|
||||
mUq.setNullableColumns(SplitColumns.split(uq.getNullableColumns()));
|
||||
uniqueConstraints.add(mUq);
|
||||
}
|
||||
@@ -185,8 +184,7 @@ public class MTable {
|
||||
}
|
||||
|
||||
|
||||
public void addForeignKey(String name, String refTableName, String indexName, String columnNames,
|
||||
String refColumnNames) {
|
||||
public void addForeignKey(String name, String refTableName, String indexName, String columnNames, String refColumnNames) {
|
||||
MCompoundForeignKey foreignKey = new MCompoundForeignKey(name, refTableName, indexName);
|
||||
String[] cols = SplitColumns.split(columnNames);
|
||||
String[] refCols = SplitColumns.split(refColumnNames);
|
||||
@@ -194,7 +192,6 @@ public class MTable {
|
||||
foreignKey.addColumnPair(cols[i], refCols[i]);
|
||||
}
|
||||
addForeignKey(foreignKey);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user