You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-dev@db.apache.org by mp...@apache.org on 2002/11/29 14:50:29 UTC
cvs commit: jakarta-turbine-torque/src/java/org/apache/torque/engine/database/model AppData.java Column.java ConstraintNameGenerator.java Database.java ForeignKey.java Index.java NameFactory.java NameGenerator.java Table.java
mpoeschl 2002/11/29 05:50:29
Modified: src/java/org/apache/torque/engine/database/model
AppData.java Column.java
ConstraintNameGenerator.java Database.java
ForeignKey.java Index.java NameFactory.java
NameGenerator.java Table.java
Log:
o javadocs
o checkstyle fixes
Revision Changes Path
1.15 +26 -16 jakarta-turbine-torque/src/java/org/apache/torque/engine/database/model/AppData.java
Index: AppData.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-torque/src/java/org/apache/torque/engine/database/model/AppData.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- AppData.java 15 Sep 2002 03:16:56 -0000 1.14
+++ AppData.java 29 Nov 2002 13:50:29 -0000 1.15
@@ -134,13 +134,13 @@
protected Properties getIdiosyncrasies(String databaseType)
throws EngineException
{
- Properties idiosyncrasies =
- (Properties) idiosyncrasyTable.get(databaseType);
+ Properties idiosyncrasies
+ = (Properties) idiosyncrasyTable.get(databaseType);
// If we haven't yet loaded the properties and we have the
// information to do so, proceed with loading.
- if (idiosyncrasies == null &&
- basePropsFilePath != null && databaseType != null)
+ if (idiosyncrasies == null && basePropsFilePath != null
+ && databaseType != null)
{
idiosyncrasies = new Properties();
File propsFile = new File(basePropsFilePath + databaseType,
@@ -161,8 +161,8 @@
{
try
{
- String path = '/' + basePropsFilePath + databaseType +
- "/db.props";
+ String path = '/' + basePropsFilePath + databaseType
+ + "/db.props";
idiosyncrasies.load(getClass().getResourceAsStream(path));
}
catch (Exception e)
@@ -173,9 +173,9 @@
if (idiosyncrasies.isEmpty())
{
- throw new EngineException("Database-specific properties " +
- "file does not exist: " +
- propsFile.getAbsolutePath());
+ throw new EngineException("Database-specific properties "
+ + "file does not exist: "
+ + propsFile.getAbsolutePath());
}
}
return idiosyncrasies;
@@ -241,6 +241,8 @@
/**
* Returns whether this application has multiple databases.
+ *
+ * @return true if the application has multiple databases
*/
public boolean hasMultipleDatabases()
{
@@ -250,12 +252,13 @@
/**
* Return the database with the specified name.
*
+ * @param name database name
* @return A Database object. If it does not exist it returns null
*/
public Database getDatabase (String name)
{
doFinalInitialization();
- for (Iterator i = dbList.iterator() ; i.hasNext() ;)
+ for (Iterator i = dbList.iterator(); i.hasNext();)
{
Database db = (Database) i.next();
if (db.getName().equals(name))
@@ -268,6 +271,9 @@
/**
* An utility method to add a new database from an xml attribute.
+ *
+ * @param attrib the xml attributes
+ * @return the database
*/
public Database addDatabase(Attributes attrib)
{
@@ -280,6 +286,8 @@
/**
* Add a database to the list and sets the AppData property to this
* AppData
+ *
+ * @param db the database to add
*/
public void addDatabase(Database db)
{
@@ -297,27 +305,29 @@
private void doFinalInitialization()
{
- if (!isInitialized)
+ if (!isInitialized)
{
Iterator dbs = dbList.iterator();
- while (dbs.hasNext())
+ while (dbs.hasNext())
{
- ((Database)dbs.next()).doFinalInitialization();
+ ((Database) dbs.next()).doFinalInitialization();
}
isInitialized = true;
- }
+ }
}
/**
* Creats a string representation of this AppData.
* The representation is given in xml format.
+ *
+ * @return representation in xml format
*/
public String toString()
{
StringBuffer result = new StringBuffer();
result.append ("<app-data>\n");
- for (Iterator i = dbList.iterator(); i.hasNext(); )
+ for (Iterator i = dbList.iterator(); i.hasNext();)
{
result.append (i.next());
}
1.24 +14 -14 jakarta-turbine-torque/src/java/org/apache/torque/engine/database/model/Column.java
Index: Column.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-torque/src/java/org/apache/torque/engine/database/model/Column.java,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- Column.java 30 Sep 2002 04:32:04 -0000 1.23
+++ Column.java 29 Nov 2002 13:50:29 -0000 1.24
@@ -160,7 +160,7 @@
javaName = attrib.getValue("javaName");
javaType = attrib.getValue("javaType");
- if ( javaType != null && javaType.length() == 0 )
+ if (javaType != null && javaType.length() == 0)
{
javaType = null;
}
@@ -170,8 +170,8 @@
javaNamingMethod = attrib.getValue("javaNamingMethod");
if (javaNamingMethod == null)
{
- javaNamingMethod =
- parentTable.getDatabase().getDefaultJavaNamingMethod();
+ javaNamingMethod
+ = parentTable.getDatabase().getDefaultJavaNamingMethod();
}
//Primary Key
@@ -202,8 +202,8 @@
setType(attrib.getValue("type"));
inheritanceType = attrib.getValue("inheritance");
- isInheritance =
- ( inheritanceType != null && !inheritanceType.equals("false") );
+ isInheritance = (inheritanceType != null
+ && !inheritanceType.equals("false"));
this.inputValidator = attrib.getValue("inputValidator");
description = attrib.getValue("description");
@@ -352,7 +352,7 @@
public void addInheritance(Inheritance inh)
{
inh.setColumn(this);
- if ( inheritanceList == null )
+ if (inheritanceList == null)
{
inheritanceList = new ArrayList();
isEnumeratedClasses = true;
@@ -461,9 +461,9 @@
ForeignKey[] fks = parentTable.getForeignKeys();
for (int i = 0; i < fks.length; i++)
{
- if ( fks[i].getForeignTableName()
- .equals(fk.getForeignTableName())
- && !fks[i].getLocalColumns().contains(this.name) )
+ if (fks[i].getForeignTableName()
+ .equals(fk.getForeignTableName())
+ && !fks[i].getLocalColumns().contains(this.name))
{
return true;
}
@@ -541,7 +541,7 @@
public void setType(String torqueType)
{
this.torqueType = torqueType;
- if ( torqueType.equals("VARBINARY") || torqueType.equals("BLOB") )
+ if (torqueType.equals("VARBINARY") || torqueType.equals("BLOB"))
{
needsTransactionInPostgres = true;
}
@@ -742,7 +742,7 @@
torqueType = "FLOAT";
columnType = new Float (0);
}
- else if (tn.indexOf ("DATE") != -1 )
+ else if (tn.indexOf ("DATE") != -1)
{
torqueType = "DATE";
columnType = new Date();
@@ -797,7 +797,7 @@
public String getJavaNative()
{
String jtype = TypeMap.getJavaNativeObject(torqueType);
- if ( isUsePrimitive() )
+ if (isUsePrimitive())
{
jtype = TypeMap.getJavaNative(torqueType);
}
@@ -812,7 +812,7 @@
public String getVillageMethod()
{
String vmethod = TypeMap.getVillageObjectMethod(torqueType);
- if ( isUsePrimitive() )
+ if (isUsePrimitive())
{
vmethod = TypeMap.getVillageMethod(torqueType);
}
1.4 +5 -6 jakarta-turbine-torque/src/java/org/apache/torque/engine/database/model/ConstraintNameGenerator.java
Index: ConstraintNameGenerator.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-torque/src/java/org/apache/torque/engine/database/model/ConstraintNameGenerator.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ConstraintNameGenerator.java 8 May 2002 19:45:45 -0000 1.3
+++ ConstraintNameGenerator.java 29 Nov 2002 13:50:29 -0000 1.4
@@ -98,14 +98,13 @@
{
int maxColumnNameLength =
Integer.parseInt(db.getProperty("maxColumnNameLength"));
- maxBodyLength = (maxColumnNameLength - namePostfix.length() -
- constraintNbr.length() - 2);
+ maxBodyLength = (maxColumnNameLength - namePostfix.length()
+ - constraintNbr.length() - 2);
if (DEBUG)
{
- System.out.println("maxColumnNameLength=" +
- maxColumnNameLength + " maxBodyLength=" +
- maxBodyLength);
+ System.out.println("maxColumnNameLength=" + maxColumnNameLength
+ + " maxBodyLength=" + maxBodyLength);
}
}
catch (EngineException e)
1.17 +38 -38 jakarta-turbine-torque/src/java/org/apache/torque/engine/database/model/Database.java
Index: Database.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-torque/src/java/org/apache/torque/engine/database/model/Database.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- Database.java 15 Sep 2002 03:16:56 -0000 1.16
+++ Database.java 29 Nov 2002 13:50:29 -0000 1.17
@@ -149,7 +149,7 @@
* Set the value of package.
* @param v Value to assign to package.
*/
- public void setPackage(String v)
+ public void setPackage(String v)
{
this.pkg = v;
}
@@ -160,7 +160,7 @@
*/
public String getBaseClass()
{
- if ( baseClass == null )
+ if (baseClass == null)
{
return "BaseObject";
}
@@ -171,7 +171,7 @@
* Set the value of baseClass.
* @param v Value to assign to baseClass.
*/
- public void setBaseClass(String v)
+ public void setBaseClass(String v)
{
this.baseClass = v;
}
@@ -182,7 +182,7 @@
*/
public String getBasePeer()
{
- if ( basePeer == null )
+ if (basePeer == null)
{
return "BasePeer";
}
@@ -193,7 +193,7 @@
* Set the value of basePeer.
* @param v Value to assign to basePeer.
*/
- public void setBasePeer(String v)
+ public void setBasePeer(String v)
{
this.basePeer = v;
}
@@ -211,7 +211,7 @@
* Set the value of defaultIdMethod.
* @param v Value to assign to defaultIdMethod.
*/
- public void setDefaultIdMethod(String v)
+ public void setDefaultIdMethod(String v)
{
this.defaultIdMethod = v;
}
@@ -238,7 +238,7 @@
* Set the value of defaultJavaNamingMethod.
* @param v The default naming conversion for this database to use.
*/
- public void setDefaultJavaNamingMethod(String v)
+ public void setDefaultJavaNamingMethod(String v)
{
this.defaultJavaNamingMethod = v;
}
@@ -256,7 +256,7 @@
* Set the value of heavyIndexing.
* @param v Value to assign to heavyIndexing.
*/
- public void setHeavyIndexing(boolean v)
+ public void setHeavyIndexing(boolean v)
{
this.heavyIndexing = v;
}
@@ -382,7 +382,7 @@
public void doFinalInitialization()
{
Table[] tables = getTables();
- for (int i=0; i<tables.length; i++)
+ for (int i = 0; i < tables.length; i++)
{
Table currTable = tables[i];
@@ -390,7 +390,7 @@
// if idMethod="autoincrement", make sure a column is
// specified as autoIncrement="true"
// FIXME: Handle idMethod="native" via DB adapter.
- if ( currTable.getIdMethod().equals("autoincrement") )
+ if (currTable.getIdMethod().equals("autoincrement"))
{
Column[] columns = currTable.getColumns();
boolean foundOne = false;
@@ -398,13 +398,13 @@
{
foundOne = columns[j].isAutoIncrement();
}
-
- if ( !foundOne )
+
+ if (!foundOne)
{
- String errorMessage = "Table '" + currTable.getName() +
- "' is marked as autoincrement, but it does not " +
- "have a column which declared as the one to " +
- "auto increment (i.e. autoIncrement=\"true\")\n";
+ String errorMessage = "Table '" + currTable.getName()
+ + "' is marked as autoincrement, but it does not "
+ + "have a column which declared as the one to "
+ + "auto increment (i.e. autoIncrement=\"true\")\n";
System.out.println("Error in XML schema: " + errorMessage);
}
}
@@ -413,62 +413,62 @@
// setup reverse fk relations
ForeignKey[] fks = currTable.getForeignKeys();
- for (int j=0; j<fks.length; j++)
+ for (int j = 0; j < fks.length; j++)
{
ForeignKey currFK = fks[j];
Table foreignTable = getTable(currFK.getForeignTableName());
- if ( foreignTable == null )
+ if (foreignTable == null)
{
System.out.println("ERROR!! Attempt to set foreign"
- + " key to nonexistent table, " +
- currFK.getForeignTableName() + "!");
+ + " key to nonexistent table, "
+ + currFK.getForeignTableName() + "!");
}
List referrers = foreignTable.getReferrers();
- if ( (referrers == null || !referrers.contains(currFK)))
+ if ((referrers == null || !referrers.contains(currFK)))
{
foreignTable.addReferrer(currFK);
}
// local column references
Iterator localColumnNames = currFK.getLocalColumns().iterator();
- while (localColumnNames.hasNext())
+ while (localColumnNames.hasNext())
{
Column local = currTable
.getColumn((String)localColumnNames.next());
// give notice of a schema inconsistency.
// note we do not prevent the npe as there is nothing
// that we can do, if it is to occur.
- if ( local == null )
+ if (local == null)
{
System.out.println("ERROR!! Attempt to define foreign"
- + " key with nonexistent column, " +
- local.getName() + ", in table, " +
- currTable.getName() + "!" );
+ + " key with nonexistent column, "
+ + local.getName() + ", in table, "
+ + currTable.getName() + "!");
}
//check for foreign pk's
if (local.isPrimaryKey())
{
currTable.setContainsForeignPK(true);
}
-
+
}
-
+
// foreign column references
- Iterator foreignColumnNames =
- currFK.getForeignColumns().iterator();
- while (foreignColumnNames.hasNext())
+ Iterator foreignColumnNames
+ = currFK.getForeignColumns().iterator();
+ while (foreignColumnNames.hasNext())
{
Column foreign = foreignTable
- .getColumn((String)foreignColumnNames.next());
+ .getColumn((String) foreignColumnNames.next());
// if the foreign column does not exist, we may have an
// external reference or a misspelling
- if ( foreign == null )
+ if (foreign == null)
{
System.out.println("ERROR!! Attempt to set foreign"
- + " key to nonexistent column, " +
- foreign.getName() + ", in table, "
- + foreignTable.getName() + "!" );
+ + " key to nonexistent column, "
+ + foreign.getName() + ", in table, "
+ + foreignTable.getName() + "!");
}
foreign.addReferrer(currFK);
}
@@ -492,7 +492,7 @@
.append(" basePeer=\"").append(getBasePeer()).append('"')
.append(">\n");
- for (Iterator i = tableList.iterator(); i.hasNext(); )
+ for (Iterator i = tableList.iterator(); i.hasNext();)
{
result.append(i.next());
}
1.10 +5 -5 jakarta-turbine-torque/src/java/org/apache/torque/engine/database/model/ForeignKey.java
Index: ForeignKey.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-torque/src/java/org/apache/torque/engine/database/model/ForeignKey.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- ForeignKey.java 15 Sep 2002 01:59:44 -0000 1.9
+++ ForeignKey.java 29 Nov 2002 13:50:29 -0000 1.10
@@ -123,7 +123,7 @@
*/
public boolean hasOnUpdate()
{
- return ! onUpdate.equals(NONE);
+ return !onUpdate.equals(NONE);
}
/**
@@ -131,7 +131,7 @@
*/
public boolean hasOnDelete()
{
- return ! onDelete.equals(NONE);
+ return !onDelete.equals(NONE);
}
/**
@@ -273,7 +273,7 @@
for (int i = 0; i < localColumns.size(); i++)
{
- h.put (localColumns.get(i),foreignColumns.get(i));
+ h.put(localColumns.get(i), foreignColumns.get(i));
}
return h;
@@ -297,7 +297,7 @@
for (int i = 0; i < localColumns.size(); i++)
{
- h.put (foreignColumns.get(i),localColumns.get(i));
+ h.put (foreignColumns.get(i), localColumns.get(i));
}
return h;
1.20 +8 -8 jakarta-turbine-torque/src/java/org/apache/torque/engine/database/model/Index.java
Index: Index.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-torque/src/java/org/apache/torque/engine/database/model/Index.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- Index.java 8 May 2002 19:45:45 -0000 1.19
+++ Index.java 29 Nov 2002 13:50:29 -0000 1.20
@@ -71,6 +71,7 @@
*/
public class Index
{
+ /** enables debug output */
private static final boolean DEBUG = false;
private String indexName;
@@ -109,15 +110,14 @@
if (DEBUG)
{
- System.out.println("Created Index named " + getName() +
- " with " + indexColumns.size() +
- " columns");
+ System.out.println("Created Index named " + getName()
+ + " with " + indexColumns.size() + " columns");
}
}
else
{
- throw new EngineException("Cannot create a new Index using an " +
- "empty list Column object");
+ throw new EngineException("Cannot create a new Index using an "
+ + "empty list Column object");
}
}
@@ -137,8 +137,8 @@
}
// ASSUMPTION: This Index not yet added to the list.
inputs.add(new Integer(table.getIndices().length + 1));
- indexName = NameFactory.generateName
- (NameFactory.CONSTRAINT_GENERATOR, inputs);
+ indexName = NameFactory.generateName(
+ NameFactory.CONSTRAINT_GENERATOR, inputs);
}
/**
1.9 +3 -4 jakarta-turbine-torque/src/java/org/apache/torque/engine/database/model/NameFactory.java
Index: NameFactory.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-torque/src/java/org/apache/torque/engine/database/model/NameFactory.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- NameFactory.java 8 May 2002 19:45:45 -0000 1.8
+++ NameFactory.java 29 Nov 2002 13:50:29 -0000 1.9
@@ -118,9 +118,8 @@
}
catch (InstantiationException e)
{
- System.err.println("Unable to instantiate class " + name +
- ": Make sure it's in your run-time " +
- "classpath");
+ System.err.println("Unable to instantiate class " + name
+ + ": Make sure it's in your run-time classpath");
}
catch (Exception e)
{
1.9 +3 -3 jakarta-turbine-torque/src/java/org/apache/torque/engine/database/model/NameGenerator.java
Index: NameGenerator.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-torque/src/java/org/apache/torque/engine/database/model/NameGenerator.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- NameGenerator.java 8 May 2002 19:45:45 -0000 1.8
+++ NameGenerator.java 29 Nov 2002 13:50:29 -0000 1.9
@@ -103,7 +103,7 @@
*
* @param inputs Inputs used to generate a name.
* @return The generated name.
+ * @throws EngineException
*/
- String generateName(List inputs)
- throws EngineException;
+ String generateName(List inputs) throws EngineException;
}
1.35 +39 -41 jakarta-turbine-torque/src/java/org/apache/torque/engine/database/model/Table.java
Index: Table.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-torque/src/java/org/apache/torque/engine/database/model/Table.java,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- Table.java 15 Nov 2002 18:07:11 -0000 1.34
+++ Table.java 29 Nov 2002 13:50:29 -0000 1.35
@@ -117,7 +117,7 @@
*/
public Table()
{
- this (null);
+ this(null);
}
/**
@@ -162,10 +162,10 @@
}
if ("autoincrement".equals(idMethod) || "sequence".equals(idMethod))
{
- System.out.println("The value '" + idMethod + "' for Torque's " +
- "table.idMethod attribute has been deprecated in favor " +
- "of '" + NATIVE + "'. Please adjust your " +
- "Torque XML schema accordingly.");
+ System.out.println("The value '" + idMethod + "' for Torque's "
+ + "table.idMethod attribute has been deprecated in favor "
+ + "of '" + NATIVE + "'. Please adjust your "
+ + "Torque XML schema accordingly.");
idMethod = NATIVE;
}
skipSql = "true".equals(attrib.getValue("skipSql"));
@@ -175,8 +175,8 @@
basePeer = attrib.getValue("basePeer");
alias = attrib.getValue("alias");
heavyIndexing = "true".equals(attrib.getValue("heavyIndexing"))
- || (!"false".equals(attrib.getValue("heavyIndexing")) &&
- getDatabase().isHeavyIndexing());
+ || (!"false".equals(attrib.getValue("heavyIndexing"))
+ && getDatabase().isHeavyIndexing());
description = attrib.getValue("description");
enterface = attrib.getValue("interface");
}
@@ -319,11 +319,11 @@
*/
public String getBaseClass()
{
- if ( isAlias() && baseClass == null )
+ if (isAlias() && baseClass == null)
{
return alias;
}
- else if ( baseClass == null )
+ else if (baseClass == null)
{
return getDatabase().getBaseClass();
}
@@ -337,7 +337,7 @@
* Set the value of baseClass.
* @param v Value to assign to baseClass.
*/
- public void setBaseClass(String v)
+ public void setBaseClass(String v)
{
this.baseClass = v;
}
@@ -348,11 +348,11 @@
*/
public String getBasePeer()
{
- if ( isAlias() && basePeer == null )
+ if (isAlias() && basePeer == null)
{
return alias + "Peer";
}
- else if ( basePeer == null )
+ else if (basePeer == null)
{
return getDatabase().getBasePeer();
}
@@ -366,7 +366,7 @@
* Set the value of basePeer.
* @param v Value to assign to basePeer.
*/
- public void setBasePeer(String v)
+ public void setBasePeer(String v)
{
this.basePeer = v;
}
@@ -396,7 +396,7 @@
public void addColumn(Column col)
{
col.setTable (this);
- if ( col.isInheritance() )
+ if (col.isInheritance())
{
inheritanceColumn = col;
}
@@ -414,8 +414,8 @@
public ForeignKey addForeignKey(Attributes attrib)
{
ForeignKey fk = new ForeignKey();
- fk.loadFromXML (attrib);
- addForeignKey (fk);
+ fk.loadFromXML(attrib);
+ addForeignKey(fk);
return fk;
}
@@ -433,16 +433,16 @@
*/
public List getChildrenNames()
{
- if ( inheritanceColumn == null
- || !inheritanceColumn.isEnumeratedClasses() )
+ if (inheritanceColumn == null
+ || !inheritanceColumn.isEnumeratedClasses())
{
return null;
}
List children = inheritanceColumn.getChildren();
List names = new ArrayList(children.size());
- for ( int i = 0; i < children.size(); i++ )
+ for (int i = 0; i < children.size(); i++)
{
- names.add( ((Inheritance) children.get(i)).getClassName() );
+ names.add(((Inheritance) children.get(i)).getClassName());
}
return names;
}
@@ -488,7 +488,7 @@
*/
public List getForeignTableNames()
{
- if ( foreignTableNames == null )
+ if (foreignTableNames == null)
{
foreignTableNames = new ArrayList(1);
}
@@ -504,11 +504,11 @@
fk.setTable (this);
foreignKeys.add(fk);
- if ( foreignTableNames == null )
+ if (foreignTableNames == null)
{
foreignTableNames = new ArrayList(5);
}
- if ( foreignTableNames.contains(fk.getForeignTableName()) )
+ if (foreignTableNames.contains(fk.getForeignTableName()))
{
foreignTableNames.add(fk.getForeignTableName());
}
@@ -529,8 +529,8 @@
public IdMethodParameter addIdMethodParameter(Attributes attrib)
{
IdMethodParameter imp = new IdMethodParameter();
- imp.loadFromXML (attrib);
- addIdMethodParameter (imp);
+ imp.loadFromXML(attrib);
+ addIdMethodParameter(imp);
return imp;
}
@@ -543,7 +543,7 @@
*/
public void addIdMethodParameter(IdMethodParameter imp)
{
- imp.setTable (this);
+ imp.setTable(this);
if (idMethodParameters == null)
{
idMethodParameters = new ArrayList(2);
@@ -568,8 +568,8 @@
public Index addIndex(Attributes attrib)
{
Index index = new Index();
- index.loadFromXML (attrib);
- addIndex (index);
+ index.loadFromXML(attrib);
+ addIndex(index);
return index;
}
@@ -579,7 +579,7 @@
*/
public void addUnique(Unique unique)
{
- unique.setTable (this);
+ unique.setTable(this);
unices.add(unique);
}
@@ -591,7 +591,7 @@
{
Unique unique = new Unique();
unique.loadFromXML(attrib);
- addUnique (unique);
+ addUnique(unique);
return unique;
}
@@ -750,7 +750,6 @@
this.enterface = v;
}
-
/**
* When a table is abstract, it marks the business object class that is
* generated as being abstract. If you have a table called "FOO", then the
@@ -791,7 +790,7 @@
* Set the value of package.
* @param v Value to assign to package.
*/
- public void setPackage(String v)
+ public void setPackage(String v)
{
this.pkg = v;
}
@@ -917,16 +916,16 @@
public ForeignKey getForeignKey (String col)
{
ForeignKey firstFK = null;
- for (Iterator iter = foreignKeys.iterator(); iter.hasNext(); )
+ for (Iterator iter = foreignKeys.iterator(); iter.hasNext();)
{
ForeignKey key = (ForeignKey) iter.next();
if (key.getLocalColumns().contains(col))
{
- if (firstFK == null)
+ if (firstFK == null)
{
- firstFK = key;
+ firstFK = key;
}
- else
+ else
{
//System.out.println(col+" is in multiple FKs. This is not"
// + " being handled properly.");
@@ -974,7 +973,6 @@
return tableParent;
}
-
/**
* Flag to determine if code/sql gets created for this table.
* Table will be skipped, if return true.
@@ -1054,7 +1052,7 @@
if (columnList != null)
{
- for (Iterator iter = columnList.iterator(); iter.hasNext(); )
+ for (Iterator iter = columnList.iterator(); iter.hasNext();)
{
result.append(iter.next());
}
@@ -1062,7 +1060,7 @@
if (foreignKeys != null)
{
- for (Iterator iter = foreignKeys.iterator(); iter.hasNext(); )
+ for (Iterator iter = foreignKeys.iterator(); iter.hasNext();)
{
result.append(iter.next());
}
@@ -1149,7 +1147,7 @@
{
StringBuffer result = new StringBuffer();
boolean comma = false;
- for (Iterator iter = list.iterator(); iter.hasNext(); )
+ for (Iterator iter = list.iterator(); iter.hasNext();)
{
Column col = (Column) iter.next();
if (col.isPrimaryKey())