/** * INTERNAL: * Not sure were this is used, MW? */ public void useMapClassName(String concreteClassName, String methodName) { // the reference class has to be specified before coming here if (getReferenceClassName() == null) { throw DescriptorException.referenceClassNotSpecified(this); } MapContainerPolicy policy = new MapContainerPolicy(concreteClassName); policy.setKeyName(methodName, getReferenceClass().getName()); setContainerPolicy(policy); }
private Class getCollectionGenericClass(DatabaseMapping mapping) { Class collectionName = null; if (mapping.isEISMapping()) { final EISCompositeCollectionMapping collectionMapping = (EISCompositeCollectionMapping) mapping; if (collectionMapping.getReferenceClass() != null) { collectionName = collectionMapping.getReferenceClass(); } if ((collectionName == null) && (collectionMapping.getAttributeClassification() != null)) { collectionName = collectionMapping.getAttributeClassification(); } } else { final CollectionMapping collectionMapping = (CollectionMapping) mapping; if (collectionMapping.getReferenceClass() != null) { collectionName = collectionMapping.getReferenceClass(); } if ((collectionName == null) && (collectionMapping.getAttributeClassification() != null)) { collectionName = collectionMapping.getAttributeClassification(); } } return collectionName; } }
/** * INTERNAL: * Not sure were this is used, MW? */ public void useMapClassName(String concreteClassName, String methodName) { // the reference class has to be specified before coming here if (getReferenceClassName() == null) { throw DescriptorException.referenceClassNotSpecified(this); } MapContainerPolicy policy = new MapContainerPolicy(concreteClassName); policy.setKeyName(methodName, getReferenceClass().getName()); setContainerPolicy(policy); }
private Class getCollectionGenericClass(DatabaseMapping mapping) { Class collectionName = null; if (mapping.isEISMapping()) { final EISCompositeCollectionMapping collectionMapping = (EISCompositeCollectionMapping) mapping; if (collectionMapping.getReferenceClass() != null) { collectionName = collectionMapping.getReferenceClass(); } if ((collectionName == null) && (collectionMapping.getAttributeClassification() != null)) { collectionName = collectionMapping.getAttributeClassification(); } } else { final CollectionMapping collectionMapping = (CollectionMapping) mapping; if (collectionMapping.getReferenceClass() != null) { collectionName = collectionMapping.getReferenceClass(); } if ((collectionName == null) && (collectionMapping.getAttributeClassification() != null)) { collectionName = collectionMapping.getAttributeClassification(); } } return collectionName; } }
/** * INTERNAL: * Not sure were this is used, MW? */ public void useMapClassName(String concreteClassName, String methodName) { // the reference class has to be specified before coming here if (getReferenceClassName() == null) { throw DescriptorException.referenceClassNotSpecified(this); } MapContainerPolicy policy = new MapContainerPolicy(concreteClassName); policy.setKeyName(methodName, getReferenceClass().getName()); setContainerPolicy(policy); }
if (collectionMapping.getReferenceClass() != null) { collectionName = collectionMapping.getReferenceClass().getSimpleName();
if (collectionMapping.getReferenceClass() != null) { collectionName = collectionMapping.getReferenceClass().getSimpleName();
/** * PUBLIC: * If transparent indirection is used, a special map will be placed in the source * object's attribute. * Fetching of the contents of the map from the database will be delayed * until absolutely necessary. (Any message sent to the map will cause * the contents to be faulted in from the database.) * This can result in rather significant performance gains, without having to change * the source object's attribute from Map (or Map or Hashtable) to * ValueHolderInterface.<p> * The key used in the Map is the value returned by a call to the zero parameter * method named methodName. The method should be a zero argument method implemented (or * inherited) by the value to be inserted into the Map. */ public void useTransparentMap(String methodName) { setIndirectionPolicy(new TransparentIndirectionPolicy()); useMapClass(ClassConstants.IndirectMap_Class, methodName); ContainerPolicy policy = ContainerPolicy.buildPolicyFor(Hashtable.class); policy.setKeyName(methodName, getReferenceClass()); setSelectionQueryContainerPolicy(policy); }
/** * PUBLIC: * If transparent indirection is used, a special map will be placed in the source * object's attribute. * Fetching of the contents of the map from the database will be delayed * until absolutely necessary. (Any message sent to the map will cause * the contents to be faulted in from the database.) * This can result in rather significant performance gains, without having to change * the source object's attribute from Map (or Map or Hashtable) to * ValueHolderInterface.<p> * The key used in the Map is the value returned by a call to the zero parameter * method named methodName. The method should be a zero argument method implemented (or * inherited) by the value to be inserted into the Map. */ public void useTransparentMap(String methodName) { setIndirectionPolicy(new TransparentIndirectionPolicy()); useMapClass(ClassConstants.IndirectMap_Class, methodName); ContainerPolicy policy = ContainerPolicy.buildPolicyFor(Hashtable.class); policy.setKeyName(methodName, getReferenceClass()); setSelectionQueryContainerPolicy(policy); }
/** * PUBLIC: * If transparent indirection is used, a special map will be placed in the source * object's attribute. * Fetching of the contents of the map from the database will be delayed * until absolutely necessary. (Any message sent to the map will cause * the contents to be faulted in from the database.) * This can result in rather significant performance gains, without having to change * the source object's attribute from Map (or Map or Hashtable) to * ValueHolderInterface.<p> * The key used in the Map is the value returned by a call to the zero parameter * method named methodName. The method should be a zero argument method implemented (or * inherited) by the value to be inserted into the Map. */ public void useTransparentMap(String methodName) { setIndirectionPolicy(new TransparentIndirectionPolicy()); useMapClass(ClassConstants.IndirectMap_Class, methodName); ContainerPolicy policy = ContainerPolicy.buildPolicyFor(Hashtable.class); policy.setKeyName(methodName, getReferenceClass()); setSelectionQueryContainerPolicy(policy); }
/** * INTERNAL: * This method is used to load a relationship from a list of PKs. This list * may be available if the relationship has been cached. */ public Object valueFromPKList(Object[] pks, AbstractSession session){ ContainerPolicy cp = this.containerPolicy; Object result = cp.containerInstance(pks.length); for (int index = 0; index < pks.length; ++index){ Vector pk = null; if (getReferenceDescriptor().hasCMPPolicy()){ pk = getReferenceDescriptor().getCMPPolicy().createPkVectorFromKey(pks[index], session); }else{ pk = (Vector)pks[index]; } ReadObjectQuery query = new ReadObjectQuery(); query.setReferenceClass(getReferenceClass()); query.setSelectionKey(pk); query.setIsExecutionClone(true); cp.addInto(session.executeQuery(query), result, session); } return result; }
attributeClass = mapping.getReferenceClass(); } else if (mapping.isAggregateCollectionMapping()) {