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

Examples of org.jboss.ejb.plugins.cmp.jdbc2.bridge.JDBCEntityBridge2


   {
      String entityName = metadata.getEJBName();
      if(entityName != null)
      {
         Catalog catalog = entity.getManager().getCatalog();
         JDBCEntityBridge2 otherEntity = (JDBCEntityBridge2) catalog.getEntityByEJBName(entityName);
         if(otherEntity == null)
         {
            throw new DeploymentException("Unknown entity: " + entityName);
         }
         this.entity = otherEntity;
View Full Code Here


/*     */   {
/*  63 */     String entityName = metadata.getEJBName();
/*  64 */     if (entityName != null)
/*     */     {
/*  66 */       Catalog catalog = entity.getManager().getCatalog();
/*  67 */       JDBCEntityBridge2 otherEntity = (JDBCEntityBridge2)catalog.getEntityByEJBName(entityName);
/*  68 */       if (otherEntity == null)
/*     */       {
/*  70 */         throw new DeploymentException("Unknown entity: " + entityName);
/*     */       }
/*  72 */       this.entity = otherEntity;
View Full Code Here

/*     */
/* 429 */     this.metaData = loadJDBCEntityMetaData();
/*     */
/* 432 */     this.typeFactory = new JDBCTypeFactory(this.metaData.getTypeMapping(), this.metaData.getJDBCApplication().getValueClasses(), this.metaData.getJDBCApplication().getUserTypeMappings());
/*     */
/* 437 */     this.entityBridge = new JDBCEntityBridge2(this, this.metaData);
/* 438 */     this.entityBridge.init();
/*     */
/* 440 */     Catalog catalog = getCatalog();
/* 441 */     catalog.addEntity(this.entityBridge);
/*     */
View Full Code Here

      }

      public void load(EntityEnterpriseContext ctx, FieldState state)
      {
         Object value;
         EntityTable relatedTable = relatedEntity.getTable();

         Connection con = null;
         PreparedStatement ps = null;
         ResultSet rs = null;
         try
         {
            if(log.isDebugEnabled())
            {
               log.debug("executing: " + loadSql);
            }

            con = relatedTable.getDataSource().getConnection();
            ps = con.prepareStatement(loadSql);

            JDBCCMPFieldBridge2[] pkFields = (JDBCCMPFieldBridge2[])entity.getPrimaryKeyFields();

            Object myPk = ctx.getId();
            int paramInd = 1;
            for(int i = 0; i < pkFields.length; ++i)
            {
               JDBCCMPFieldBridge2 pkField = pkFields[i];
               Object fieldValue = pkField.getPrimaryKeyValue(myPk);

               JDBCCMPFieldBridge2 relatedFkField = tableKeyFields[i];
               relatedFkField.setArgumentParameters(ps, paramInd++, fieldValue);
            }

            rs = ps.executeQuery();

            while(rs.next())
            {
               value = relatedTable.loadRow(rs, false);
               state.addLoadedPk(value);
            }
         }
         catch(SQLException e)
         {
View Full Code Here

      }

      public void load(EntityEnterpriseContext ctx, FieldState state)
      {
         Object value;
         EntityTable relatedTable = relatedEntity.getTable();

         Connection con = null;
         PreparedStatement ps = null;
         ResultSet rs = null;
         try
         {
            if(log.isDebugEnabled())
            {
               log.debug("executing: " + loadSql);
            }

            con = relatedTable.getDataSource().getConnection();
            ps = con.prepareStatement(loadSql);

            JDBCCMPFieldBridge2[] relatedFkFields = relatedCMRField.foreignKeyFields;
            JDBCCMPFieldBridge2[] myPkFields = relatedCMRField.relatedPKFields;

            Object myPk = ctx.getId();
            int paramInd = 1;
            for(int i = 0; i < relatedFkFields.length; ++i)
            {
               JDBCCMPFieldBridge2 myPkField = myPkFields[i];
               Object fieldValue = myPkField.getPrimaryKeyValue(myPk);

               JDBCCMPFieldBridge2 relatedFkField = relatedFkFields[i];
               relatedFkField.setArgumentParameters(ps, paramInd++, fieldValue);
            }

            rs = ps.executeQuery();

            while(rs.next())
            {
               value = relatedTable.loadRow(rs, false);
               state.addLoadedPk(value);
            }
         }
         catch(SQLException e)
         {
View Full Code Here

/*      */       }
/*      */     }
/*      */
/*      */     public void load(EntityEnterpriseContext ctx, JDBCCMRFieldBridge2.FieldState state)
/*      */     {
/* 1347 */       EntityTable relatedTable = JDBCCMRFieldBridge2.this.relatedEntity.getTable();
/*      */
/* 1349 */       Connection con = null;
/* 1350 */       PreparedStatement ps = null;
/* 1351 */       ResultSet rs = null;
/*      */       try
/*      */       {
/* 1354 */         if (JDBCCMRFieldBridge2.this.log.isDebugEnabled())
/*      */         {
/* 1356 */           JDBCCMRFieldBridge2.this.log.debug("executing: " + this.loadSql);
/*      */         }
/*      */
/* 1359 */         con = relatedTable.getDataSource().getConnection();
/* 1360 */         ps = con.prepareStatement(this.loadSql);
/*      */
/* 1362 */         JDBCCMPFieldBridge2[] relatedFkFields = JDBCCMRFieldBridge2.access$300(JDBCCMRFieldBridge2.this).foreignKeyFields;
/* 1363 */         JDBCCMPFieldBridge2[] myPkFields = JDBCCMRFieldBridge2.access$300(JDBCCMRFieldBridge2.this).relatedPKFields;
/*      */
/* 1365 */         Object myPk = ctx.getId();
/* 1366 */         int paramInd = 1;
/* 1367 */         for (int i = 0; i < relatedFkFields.length; i++)
/*      */         {
/* 1369 */           JDBCCMPFieldBridge2 myPkField = myPkFields[i];
/* 1370 */           Object fieldValue = myPkField.getPrimaryKeyValue(myPk);
/*      */
/* 1372 */           JDBCCMPFieldBridge2 relatedFkField = relatedFkFields[i];
/* 1373 */           relatedFkField.setArgumentParameters(ps, paramInd++, fieldValue);
/*      */         }
/*      */
/* 1376 */         rs = ps.executeQuery();
/*      */
/* 1378 */         while (rs.next())
/*      */         {
/* 1380 */           Object value = relatedTable.loadRow(rs, false);
/* 1381 */           state.addLoadedPk(value);
/*      */         }
/*      */       }
/*      */       catch (SQLException e)
/*      */       {
View Full Code Here

/*      */       }
/*      */     }
/*      */
/*      */     public void load(EntityEnterpriseContext ctx, JDBCCMRFieldBridge2.FieldState state)
/*      */     {
/* 1248 */       EntityTable relatedTable = JDBCCMRFieldBridge2.this.relatedEntity.getTable();
/*      */
/* 1250 */       Connection con = null;
/* 1251 */       PreparedStatement ps = null;
/* 1252 */       ResultSet rs = null;
/*      */       try
/*      */       {
/* 1255 */         if (JDBCCMRFieldBridge2.this.log.isDebugEnabled())
/*      */         {
/* 1257 */           JDBCCMRFieldBridge2.this.log.debug("executing: " + this.loadSql);
/*      */         }
/*      */
/* 1260 */         con = relatedTable.getDataSource().getConnection();
/* 1261 */         ps = con.prepareStatement(this.loadSql);
/*      */
/* 1263 */         JDBCCMPFieldBridge2[] pkFields = (JDBCCMPFieldBridge2[])(JDBCCMPFieldBridge2[])JDBCCMRFieldBridge2.this.entity.getPrimaryKeyFields();
/*      */
/* 1265 */         Object myPk = ctx.getId();
/* 1266 */         int paramInd = 1;
/* 1267 */         for (int i = 0; i < pkFields.length; i++)
/*      */         {
/* 1269 */           JDBCCMPFieldBridge2 pkField = pkFields[i];
/* 1270 */           Object fieldValue = pkField.getPrimaryKeyValue(myPk);
/*      */
/* 1272 */           JDBCCMPFieldBridge2 relatedFkField = JDBCCMRFieldBridge2.this.tableKeyFields[i];
/* 1273 */           relatedFkField.setArgumentParameters(ps, paramInd++, fieldValue);
/*      */         }
/*      */
/* 1276 */         rs = ps.executeQuery();
/*      */
/* 1278 */         while (rs.next())
/*      */         {
/* 1280 */           Object value = relatedTable.loadRow(rs, false);
/* 1281 */           state.addLoadedPk(value);
/*      */         }
/*      */       }
/*      */       catch (SQLException e)
/*      */       {
View Full Code Here

   public Schema getSchema()
   {
      schema = (Schema)getApplicationData(SCHEMA);
      if(schema == null)
      {
         schema = new Schema(container.getEjbModule().getServiceName().getCanonicalName());
         putApplicationData(SCHEMA, schema);
      }
      return schema;
   }
View Full Code Here

   public Schema getSchema()
   {
      schema = (Schema)getApplicationData(SCHEMA);
      if(schema == null)
      {
         schema = new Schema();
         putApplicationData(SCHEMA, schema);
      }
      return schema;
   }
View Full Code Here

         if(metadata.getMethod().getName().startsWith("ejbSelect"))
         {
            try
            {
               QueryCommand queryCommand = queryFactory.getQueryCommand(metadata.getMethod());
               Schema schema = ((JDBCStoreManager2)entityBridge.getManager()).getSchema();
               EJBSelectBridge ejbSelectBridge = new EJBSelectBridge(entityBridge.getContainer(), schema, metadata, queryCommand);
               selectorsByMethod.put(metadata.getMethod(), ejbSelectBridge);
            }
            catch(FinderException e)
            {
View Full Code Here

TOP

Related Classes of org.jboss.ejb.plugins.cmp.jdbc2.bridge.JDBCEntityBridge2

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.