/** * The related entity's local container invoker. */ public final LocalProxyFactory getRelatedInvoker() { return getRelatedContainer().getLocalProxyFactory(); }
public Object[] toArray() { Set value = state.getLoadedValue(ctx); Object[] result = (Object[])Array.newInstance(relatedEntity.getLocalInterface(), value.size()); LocalProxyFactory relatedPF = relatedContainer.getLocalProxyFactory(); int i = 0; for(Iterator iter = value.iterator(); iter.hasNext();) { Object id = iter.next(); result[i++] = relatedPF.getEntityEJBLocalObject(id); } return result; }
public Object[] toArray(Object a[]) { Set value = state.getLoadedValue(ctx); if(a == null || a.length < value.size()) { a = (Object[])Array.newInstance(entity.getLocalInterface(), value.size()); } LocalProxyFactory relatedPF = relatedContainer.getLocalProxyFactory(); int i = 0; for(Iterator iter = value.iterator(); iter.hasNext();) { Object id = iter.next(); a[i++] = relatedPF.getEntityEJBLocalObject(id); } return a; }
public Object next() { try { curId = idIter.next(); } catch(ConcurrentModificationException e) { throw new IllegalStateException(e.getMessage()); } return relatedContainer.getLocalProxyFactory().getEntityEJBLocalObject(curId); } };
public Object getValue(EntityEnterpriseContext ctx) { Object value = getLoadedValue(ctx); if(value == null) { localObject = null; } else if(localObject == null) { localObject = relatedContainer.getLocalProxyFactory().getEntityEJBLocalObject(value); } return localObject; }
public EJBLocalObject getEJBLocalObject() { if(ejbLocalObject == null && con.getLocalHomeClass() != null) { ejbLocalObject = ((EntityContainer)con).getLocalProxyFactory().getEntityEJBLocalObject(id); } return ejbLocalObject; }
EJBLocalHome relatedHome = relatedContainer.getLocalProxyFactory().getEJBLocalHome(); try relatedLocalObject = relatedContainer.getLocalProxyFactory().getEntityEJBLocalObject(fk);
public EJBLocalObject getEJBLocalObject() { AllowedOperationsAssociation.assertAllowedIn("getEJBLocalObject", IN_EJB_POST_CREATE | IN_EJB_REMOVE | IN_EJB_ACTIVATE | IN_EJB_PASSIVATE | IN_EJB_LOAD | IN_EJB_STORE | IN_BUSINESS_METHOD | IN_EJB_TIMEOUT); if (con.getLocalHomeClass()==null) throw new IllegalStateException( "No local interface for bean." ); if (ejbLocalObject == null) { Object cacheKey = ((EntityCache)((EntityContainer)con).getInstanceCache()).createCacheKey(id); ejbLocalObject = ((EntityContainer)con).getLocalProxyFactory().getEntityEJBLocalObject(cacheKey); } return ejbLocalObject; }
/** * This method is called only for CMR fields with foreign key fields mapped to CMP fields * to check the validity of the foreign key value. * * @param fk the foreign key to check * @return true if there is related entity with the equal primary key */ public boolean isForeignKeyValid(Object fk) { boolean valid; if(relatedManager.getReadAheadCache().getPreloadDataMap(fk, false) != null) { valid = true; } else { EJBLocalHome relatedHome = getRelatedContainer().getLocalProxyFactory().getEJBLocalHome(); try { relatedFindByPrimaryKey.invoke(relatedHome, new Object[]{fk}); valid = true; } catch(Exception ignore) { // no such entity. it is ok to ignore valid = false; } } return valid; }
public EJBLocalHome getEJBLocalHome() { if (con.getLocalHomeClass() == null) throw new IllegalStateException("No local home defined."); if (con instanceof EntityContainer) return ((EntityContainer) con).getLocalProxyFactory().getEJBLocalHome(); else if (con instanceof StatelessSessionContainer) return ((StatelessSessionContainer) con).getLocalProxyFactory().getEJBLocalHome(); else if (con instanceof StatefulSessionContainer) return ((StatefulSessionContainer) con).getLocalProxyFactory().getEJBLocalHome(); // Should never get here throw new EJBException("No EJBLocalHome available (BUG!)"); }
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: result = command.fetchOne(schema, factory, args); if(result == null && getMethod().getReturnType().isPrimitive()) { throw new FinderException( "Cannot return null as a value of primitive type " + getMethod().getReturnType().getName() ); } break; case COLLECTION: result = command.fetchCollection(schema, factory, args); break; default: throw new IllegalStateException("Unexpected return type: " + returnType); } return result; } }
if(container.getLocalProxyFactory() != null) final EJBLocalObject ejbObject = container.getLocalProxyFactory().getEntityEJBLocalObject(relatedId); ejbObject.remove();
if(queryMetaData.isResultTypeMappingLocal() && selectedContainer.getLocalHomeClass() != null) factory = selectedContainer.getLocalProxyFactory();
con.getLocalProxyFactory() : con.getProxyFactory();