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

Examples of org.jboss.ejb.plugins.cmp.jdbc2.bridge.JDBCCMRFieldBridge2$SecurityActions$UTIL


    //
    resourceSet
        .getResourceFactoryRegistry()
        .getExtensionToFactoryMap()
        .put(Resource.Factory.Registry.DEFAULT_EXTENSION,
            new _40ResourceFactoryImpl());

    // Register the package to ensure it is available during loading.
    //
    resourceSet.getPackageRegistry().put(_40Package.eNS_URI,
        _40Package.eINSTANCE);
View Full Code Here


    // Register the appropriate resource factory to handle all file
    // extensions.
    //
    resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap()
        .put(Resource.Factory.Registry.DEFAULT_EXTENSION,
            new _40ResourceFactoryImpl());
   
   
    // Register the package to ensure it is available during loading.
    //
    resourceSet.getPackageRegistry().put(_40Package.eNS_URI,
View Full Code Here

    // Register the appropriate resource factory to handle all file
    // extensions.
    //
    resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap()
        .put(Resource.Factory.Registry.DEFAULT_EXTENSION,
            new _40ResourceFactoryImpl());
   
   
    // Register the package to ensure it is available during loading.
    //
    resourceSet.getPackageRegistry().put(_40Package.eNS_URI,
View Full Code Here

      return metadata.getMethod();
   }

   public Object execute(Object[] args) throws FinderException
   {
      JDBCStoreManager2 manager = command.getStoreManager();
      GenericEntityObjectFactory factory = (metadata.isResultTypeMappingLocal() ?
         (GenericEntityObjectFactory)manager.getContainer().getLocalProxyFactory() : manager.getContainer().getProxyFactory());

      Object result;
      switch(returnType)
      {
         case SINGLE:
View Full Code Here

            if(value != null)
            {
               changeValue(null);

               final Object relatedId = value.getPrimaryKey();
               final JDBCStoreManager2 relatedManager = (JDBCStoreManager2)relatedEntity.getManager();

               if(!relatedManager.isCascadeDeleted(relatedId))
               {
                  value.remove();
               }
            }
View Full Code Here

/*  718 */         if (value != null)
/*      */         {
/*  720 */           changeValue(null);
/*      */
/*  722 */           Object relatedId = value.getPrimaryKey();
/*  723 */           JDBCStoreManager2 relatedManager = (JDBCStoreManager2)JDBCCMRFieldBridge2.this.relatedEntity.getManager();
/*      */
/*  725 */           if (!relatedManager.isCascadeDeleted(relatedId))
/*      */           {
/*  727 */             value.remove();
/*      */           }
/*      */         }
/*      */
View Full Code Here

/* 100 */     return this.metadata.getMethod();
/*     */   }
/*     */
/*     */   public Object execute(Object[] args) throws FinderException
/*     */   {
/* 105 */     JDBCStoreManager2 manager = this.command.getStoreManager();
/* 106 */     GenericEntityObjectFactory factory = this.metadata.isResultTypeMappingLocal() ? manager.getContainer().getLocalProxyFactory() : manager.getContainer().getProxyFactory();
/*     */     Object result;
/* 110 */     switch (this.returnType)
/*     */     {
/*     */     case 0:
/* 113 */       result = this.command.fetchOne(this.schema, factory, args);
View Full Code Here

   }

   public Object execute(Method m, Object[] args, EntityEnterpriseContext ctx) throws CreateException
   {
      Object pk;
      PersistentContext pctx = (PersistentContext) ctx.getPersistenceContext();
      if(ctx.getId() == null)
      {
         Connection con = null;
         PreparedStatement ps = null;
         ResultSet rs = null;
         try
         {
            if(log.isDebugEnabled())
            {
               log.debug("executing sql: " + pkSql);
            }

            con = entityBridge.getDataSource().getConnection();
            ps = con.prepareStatement(pkSql);
            rs = ps.executeQuery();

            if(!rs.next())
            {
               throw new CreateException("pk-sql " + pkSql + " returned no results!");
            }

            pk = pkField.loadArgumentResults(rs, 1);
            pctx.setFieldValue(pkField.getRowIndex(), pk);
            pk = entityBridge.extractPrimaryKeyFromInstance(ctx);
         }
         catch(SQLException e)
         {
            log.error("Failed to execute pk sql. error code: " + e.getErrorCode() + ", sql state: " + e.getSQLState(), e);
            throw new CreateException("Failed to execute pk sql: " + e.getMessage() +
               ", error code: " + e.getErrorCode() + ", sql state: " + e.getSQLState());
         }
         finally
         {
            JDBCUtil.safeClose(rs);
            JDBCUtil.safeClose(ps);
            JDBCUtil.safeClose(con);
         }

         if(pk == null)
         {
            log.error("Primary key for created instance is null.");
            throw new CreateException("Primary key for created instance is null.");
         }

         pctx.setPk(pk);
      }
      else
      {
         // insert-after-ejb-post-create
         try
         {
            pctx.flush();
         }
         catch(SQLException e)
         {
            if("23000".equals(e.getSQLState()))
            {
View Full Code Here

      }
   }

   public void initInstance(EntityEnterpriseContext ctx)
   {
      ctx.setPersistenceContext(new PersistentContext(this, table.getRow(ctx.getId())));
      for(int i = 0; i < tableFields.length; ++i)
      {
         tableFields[i].initInstance(ctx);
      }
View Full Code Here

      return fields;
   }

   public boolean isStoreRequired(EntityEnterpriseContext instance)
   {
      PersistentContext pctx = (PersistentContext) instance.getPersistenceContext();
      return pctx.isDirty();
   }
View Full Code Here

TOP

Related Classes of org.jboss.ejb.plugins.cmp.jdbc2.bridge.JDBCCMRFieldBridge2$SecurityActions$UTIL

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.