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

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


/*      */       }
/*      */     }
/*      */
/*      */     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

/*     */   public Schema getSchema()
/*     */   {
/* 100 */     this.schema = ((Schema)getApplicationData("SCHEMA"));
/* 101 */     if (this.schema == null)
/*     */     {
/* 103 */       this.schema = new Schema();
/* 104 */       putApplicationData("SCHEMA", this.schema);
/*     */     }
/* 106 */     return this.schema;
/*     */   }
View Full Code Here

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

TOP

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

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.