[jboss-cvs] JBossAS SVN: r75269 - trunk/server/src/main/org/jboss/ejb/plugins/cmp/jdbc2/schema.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Jul 1 10:16:21 EDT 2008


Author: alex.loubyansky at jboss.com
Date: 2008-07-01 10:16:20 -0400 (Tue, 01 Jul 2008)
New Revision: 75269

Modified:
   trunk/server/src/main/org/jboss/ejb/plugins/cmp/jdbc2/schema/EntityTable.java
Log:
JBAS-5696 minor re-pharsing to make the lines look the same in trunk and Branch_4_2

Modified: trunk/server/src/main/org/jboss/ejb/plugins/cmp/jdbc2/schema/EntityTable.java
===================================================================
--- trunk/server/src/main/org/jboss/ejb/plugins/cmp/jdbc2/schema/EntityTable.java	2008-07-01 14:09:19 UTC (rev 75268)
+++ trunk/server/src/main/org/jboss/ejb/plugins/cmp/jdbc2/schema/EntityTable.java	2008-07-01 14:16:20 UTC (rev 75269)
@@ -1343,35 +1343,32 @@
                final ForeignKeyConstraint[] cons = row.fkUpdates;
                for (int c = 0; c < fkConstraints.length; ++c)
                {
-                  if (cons[c] != null)
-                  {
-                     if (row.state == DELETED && !cons[c].selfReference)
-                        continue;
+                  if (cons[c] == null || row.state == DELETED && !cons[c].selfReference)
+                     continue;
 
-                     PreparedStatement s = ps[c];
-                     if (s == null)
+                  PreparedStatement s = ps[c];
+                  if (s == null)
+                  {
+                     if (log.isDebugEnabled())
                      {
-                        if (log.isDebugEnabled())
-                        {
-                           log.debug("nullifying fk: " + cons[c].nullFkSql);
-                        }
-                        s = con.prepareStatement(cons[c].nullFkSql);
-                        ps[c] = s;
+                        log.debug("nullifying fk: " + cons[c].nullFkSql);
                      }
+                     s = con.prepareStatement(cons[c].nullFkSql);
+                     ps[c] = s;
+                  }
 
-                     int paramInd = 1;
-                     for (int fInd = 0; fInd < pkFields.length; ++fInd)
-                     {
-                        JDBCCMPFieldBridge2 pkField = pkFields[fInd];
-                        Object fieldValue = row.fields[pkField.getRowIndex()];
-                        paramInd = pkField.setArgumentParameters(s, paramInd, fieldValue);
-                     }
+                  int paramInd = 1;
+                  for (int fInd = 0; fInd < pkFields.length; ++fInd)
+                  {
+                     JDBCCMPFieldBridge2 pkField = pkFields[fInd];
+                     Object fieldValue = row.fields[pkField.getRowIndex()];
+                     paramInd = pkField.setArgumentParameters(s, paramInd, fieldValue);
+                  }
 
-                     final int affected = s.executeUpdate();
-                     if (affected != 1)
-                     {
-                        throw new EJBException("Affected " + affected + " rows while expected just one");
-                     }
+                  final int affected = s.executeUpdate();
+                  if (affected != 1)
+                  {
+                     throw new EJBException("Affected " + affected + " rows while expected just one");
                   }
                }
             }




More information about the jboss-cvs-commits mailing list