Package org.jboss.ejb.plugins.cmp.jdbc2.schema

Examples of org.jboss.ejb.plugins.cmp.jdbc2.schema.Schema


                  }

                  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)
                  {
View Full Code Here


/*     */
/* 194 */         int paramInd = 1;
/* 195 */         JDBCCMPFieldBridge2[] keyFields = (JDBCCMPFieldBridge2[])(JDBCCMPFieldBridge2[])this.leftField.getTableKeyFields();
/* 196 */         for (int pkInd = 0; pkInd < keyFields.length; pkInd++)
/*     */         {
/* 198 */           JDBCCMPFieldBridge2 pkField = keyFields[pkInd];
/* 199 */           Object fieldValue = pkField.getPrimaryKeyValue(keys.leftKey);
/* 200 */           paramInd = pkField.setArgumentParameters(ps, paramInd, fieldValue);
/*     */         }
/*     */
/* 203 */         keyFields = (JDBCCMPFieldBridge2[])(JDBCCMPFieldBridge2[])this.rightField.getTableKeyFields();
/* 204 */         for (int pkInd = 0; pkInd < keyFields.length; pkInd++)
/*     */         {
/* 206 */           JDBCCMPFieldBridge2 pkField = keyFields[pkInd];
/* 207 */           Object fieldValue = pkField.getPrimaryKeyValue(keys.rightKey);
/* 208 */           paramInd = pkField.setArgumentParameters(ps, paramInd, fieldValue);
/*     */         }
/*     */
/* 211 */         ps.addBatch();
/* 212 */         batchCount++;
/*     */
View Full Code Here

/*     */
/* 269 */         JDBCCMPFieldBridge2[] keyFields = (JDBCCMPFieldBridge2[])(JDBCCMPFieldBridge2[])this.leftField.getTableKeyFields();
/* 270 */         int paramInd = 1;
/* 271 */         for (int fInd = 0; fInd < keyFields.length; fInd++)
/*     */         {
/* 273 */           JDBCCMPFieldBridge2 field = keyFields[fInd];
/* 274 */           Object fieldValue = field.getPrimaryKeyValue(keys.leftKey);
/* 275 */           paramInd = field.setArgumentParameters(ps, paramInd, fieldValue);
/*     */         }
/*     */
/* 278 */         keyFields = (JDBCCMPFieldBridge2[])(JDBCCMPFieldBridge2[])this.rightField.getTableKeyFields();
/* 279 */         for (int fInd = 0; fInd < keyFields.length; fInd++)
/*     */         {
/* 281 */           JDBCCMPFieldBridge2 field = keyFields[fInd];
/* 282 */           Object fieldValue = field.getPrimaryKeyValue(keys.rightKey);
/* 283 */           paramInd = field.setArgumentParameters(ps, paramInd, fieldValue);
/*     */         }
/*     */
/* 286 */         ps.addBatch();
/* 287 */         batchCount++;
/*     */
View Full Code Here

/*      */
/*  285 */     this.updateSql = ("update " + this.tableName + " set ");
/*  286 */     int setFields = 0;
/*  287 */     for (int i = 0; i < tableFields.length; i++)
/*      */     {
/*  289 */       JDBCCMPFieldBridge2 field = tableFields[i];
/*  290 */       if (field.isPrimaryKeyMember())
/*      */         continue;
/*  292 */       if (setFields++ > 0)
/*      */       {
/*  294 */         this.updateSql += ", ";
/*      */       }
/*  296 */       this.updateSql = (this.updateSql + field.getColumnName() + "=?");
/*      */     }
/*      */
/*  299 */     this.updateSql += " where ";
/*  300 */     this.updateSql = (this.updateSql + pkFields[0].getColumnName() + "=?");
/*  301 */     for (int i = 1; i < pkFields.length; i++)
/*      */     {
/*  303 */       this.updateSql = (this.updateSql + " and " + pkFields[i].getColumnName() + "=?");
/*      */     }
/*      */
/*  306 */     if (this.entity.getVersionField() != null)
/*      */     {
/*  308 */       this.updateSql = (this.updateSql + " and " + this.entity.getVersionField().getColumnName() + "=?");
/*      */     }
/*  310 */     this.log.debug("update sql: " + this.updateSql);
/*      */
/*  313 */     String selectColumns = tableFields[0].getColumnName();
/*  314 */     for (int i = 1; i < tableFields.length; i++)
/*      */     {
/*  316 */       JDBCCMPFieldBridge2 field = tableFields[i];
/*  317 */       selectColumns = selectColumns + ", " + field.getColumnName();
/*      */     }
/*      */
/*  320 */     String whereColumns = pkFields[0].getColumnName() + "=?";
/*  321 */     for (int i = 1; i < pkFields.length; i++)
/*      */     {
View Full Code Here

/*  504 */       ps = con.prepareStatement(this.selectSql);
/*      */
/*  506 */       int paramInd = 1;
/*  507 */       for (i = 0; i < pkFields.length; i++)
/*      */       {
/*  509 */         JDBCCMPFieldBridge2 pkField = pkFields[i];
/*  510 */         Object pkValue = pkField.getPrimaryKeyValue(id);
/*  511 */         paramInd = pkField.setArgumentParameters(ps, paramInd, pkValue);
/*      */       }
/*      */
/*  514 */       rs = ps.executeQuery();
/*      */
/*  516 */       if (!rs.next())
View Full Code Here

/*  648 */         Row row = view.deleted;
/*      */
/*  650 */         int paramInd = 1;
/*  651 */         for (int pkInd = 0; pkInd < pkFields.length; pkInd++)
/*      */         {
/*  653 */           JDBCCMPFieldBridge2 pkField = pkFields[pkInd];
/*  654 */           Object fieldValue = row.fields[pkField.getRowIndex()];
/*  655 */           paramInd = pkField.setArgumentParameters(ps, paramInd, fieldValue);
/*      */         }
/*      */
/*  658 */         this.deleteStrategy.executeUpdate(ps);
/*      */
/*  660 */         batchCount++;
View Full Code Here

/*  708 */         Row row = view.dirty;
/*      */
/*  710 */         int paramInd = 1;
/*  711 */         for (int fInd = 0; fInd < tableFields.length; fInd++)
/*      */         {
/*  713 */           JDBCCMPFieldBridge2 field = tableFields[fInd];
/*  714 */           if (field.isPrimaryKeyMember())
/*      */             continue;
/*  716 */           Object fieldValue = row.fields[field.getRowIndex()];
/*  717 */           paramInd = field.setArgumentParameters(ps, paramInd, fieldValue);
/*      */         }
/*      */
/*  721 */         for (int fInd = 0; fInd < pkFields.length; fInd++)
/*      */         {
/*  723 */           JDBCCMPFieldBridge2 pkField = pkFields[fInd];
/*  724 */           Object fieldValue = row.fields[pkField.getRowIndex()];
/*  725 */           paramInd = pkField.setArgumentParameters(ps, paramInd, fieldValue);
/*      */         }
/*      */
/*  728 */         JDBCCMPFieldBridge2 versionField = this.entity.getVersionField();
/*  729 */         if (versionField != null)
/*      */         {
/*  731 */           int versionIndex = versionField.getVersionIndex();
/*  732 */           Object curVersion = row.fields[versionIndex];
/*  733 */           paramInd = versionField.setArgumentParameters(ps, paramInd, curVersion);
/*      */
/*  735 */           Object newVersion = row.fields[versionField.getRowIndex()];
/*  736 */           row.fields[versionIndex] = newVersion;
/*      */         }
/*      */
/*  739 */         this.updateStrategy.executeUpdate(ps);
/*      */
View Full Code Here

/*  969 */       this.created = row;
/*  970 */       EntityTable.Row.access$902(row, 4);
/*      */
/*  972 */       this.rowByPk.put(row.pk, row);
/*      */
/*  974 */       JDBCCMPFieldBridge2 versionField = EntityTable.this.entity.getVersionField();
/*  975 */       if (versionField != null)
/*      */       {
/*  977 */         row.fields[versionField.getVersionIndex()] = EntityTable.Row.access$100(row)[versionField.getRowIndex()];
/*      */       }
/*      */     }
View Full Code Here

/*  998 */       JDBCCMPFieldBridge2[] tableFields = (JDBCCMPFieldBridge2[])(JDBCCMPFieldBridge2[])EntityTable.this.entity.getTableFields();
/*      */
/* 1002 */       int rsOffset = 1;
/* 1003 */       for (int i = 0; i < tableFields.length; i++)
/*      */       {
/* 1005 */         JDBCCMPFieldBridge2 field = tableFields[i];
/* 1006 */         if ((searchableOnly) && (!field.getJDBCType().isSearchable()))
/*      */         {
/* 1008 */           row.fields[field.getRowIndex()] = EntityTable.access$1300();
/* 1009 */           rsOffset--;
/*      */         }
/*      */         else
/*      */         {
/* 1013 */           Object columnValue = field.loadArgumentResults(rs, field.getRowIndex() + rsOffset);
/* 1014 */           row.fields[field.getRowIndex()] = columnValue;
/*      */
/* 1016 */           if (field.getVersionIndex() == -1)
/*      */             continue;
/* 1018 */           row.fields[field.getVersionIndex()] = columnValue;
/*      */         }
/*      */       }
/*      */
/* 1022 */       Object[] relations = EntityTable.this.relationsTotal > 0 ? new Object[EntityTable.this.relationsTotal] : null;
/*      */       try
View Full Code Here

/* 1039 */       Object pk = null;
/* 1040 */       JDBCCMPFieldBridge2[] pkFields = (JDBCCMPFieldBridge2[])(JDBCCMPFieldBridge2[])EntityTable.this.entity.getPrimaryKeyFields();
/*      */
/* 1042 */       for (int i = 0; i < pkFields.length; i++)
/*      */       {
/* 1044 */         JDBCCMPFieldBridge2 field = pkFields[i];
/*      */
/* 1046 */         Object columnValue = field.loadArgumentResults(rs, field.getRowIndex() + 1);
/* 1047 */         pk = field.setPrimaryKeyValue(pk, columnValue);
/*      */       }
/* 1049 */       return pk;
/*      */     }
View Full Code Here

TOP

Related Classes of org.jboss.ejb.plugins.cmp.jdbc2.schema.Schema

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.