/** * PUBLIC: * Configure the query to use an instance of the specified container class * to hold the result objects. The key used to index the value in the Map * is the value returned by a call to the specified zero-argument method. * The method must be implemented by the class (or a superclass) of the * value to be inserted into the Map. * <p>jdk1.2.x: The container class must implement (directly or indirectly) the Map interface. * <p>jdk1.1.x: The container class must be a subclass of Hashtable. * <p>The referenceClass must set before calling this method. */ public void useMapClass(Class concreteClass, String methodName) { // the reference class has to be specified before coming here if (getReferenceClass() == null) { throw QueryException.referenceClassMissing(this); } ContainerPolicy policy = ContainerPolicy.buildPolicyFor(concreteClass); policy.setKeyName(methodName, getReferenceClass().getName()); setContainerPolicy(policy); }
/** * PUBLIC: * Configure the query to use an instance of the specified container class * to hold the result objects. The key used to index the value in the Map * is the value returned by a call to the specified zero-argument method. * The method must be implemented by the class (or a superclass) of the * value to be inserted into the Map. * <p>jdk1.2.x: The container class must implement (directly or indirectly) the Map interface. * <p>jdk1.1.x: The container class must be a subclass of Hashtable. * <p>The referenceClass must set before calling this method. */ public void useMapClass(Class concreteClass, String methodName) { // the reference class has to be specified before coming here if (getReferenceClass() == null) { throw QueryException.referenceClassMissing(this); } ContainerPolicy policy = ContainerPolicy.buildPolicyFor(concreteClass); policy.setKeyName(methodName, getReferenceClass().getName()); setContainerPolicy(policy); }
/** * PUBLIC: * Configure the query to use an instance of the specified container class * to hold the result objects. The key used to index the value in the Map * is the value returned by a call to the specified zero-argument method. * The method must be implemented by the class (or a superclass) of the * value to be inserted into the Map. * <p>jdk1.2.x: The container class must implement (directly or indirectly) the Map interface. * <p>jdk1.1.x: The container class must be a subclass of Hashtable. * <p>The referenceClass must set before calling this method. */ public void useMapClass(Class concreteClass, String methodName) { // the reference class has to be specified before coming here if (getReferenceClass() == null) { throw QueryException.referenceClassMissing(this); } ContainerPolicy policy = ContainerPolicy.buildPolicyFor(concreteClass); policy.setKeyName(methodName, getReferenceClass().getName()); setContainerPolicy(policy); }
/** * INTERNAL: * Ensure that the descriptor has been set. */ public void checkDescriptor(AbstractSession session) throws QueryException { if (this.descriptor == null) { if (getReferenceClass() == null) { throw QueryException.referenceClassMissing(this); } ClassDescriptor referenceDescriptor = session.getDescriptor(getReferenceClass()); if (referenceDescriptor == null) { throw QueryException.descriptorIsMissing(getReferenceClass(), this); } setDescriptor(referenceDescriptor); } }
/** * INTERNAL: * Ensure that the descriptor has been set. * @param session Current session. */ @Override public void checkDescriptor(AbstractSession session) throws QueryException { if (this.descriptor == null) { if (getReferenceClass() == null) { throw QueryException.referenceClassMissing(this); } ClassDescriptor referenceDescriptor = session.getDescriptor(getReferenceClass()); if (referenceDescriptor == null) { throw QueryException.descriptorIsMissing(getReferenceClass(), this); } setDescriptor(referenceDescriptor); } }
/** * INTERNAL: * Ensure that the descriptor has been set. */ @Override public void checkDescriptor(AbstractSession session) throws QueryException { if (this.descriptor == null) { if (getReferenceClass() == null) { throw QueryException.referenceClassMissing(this); } ClassDescriptor referenceDescriptor = session.getDescriptor(getReferenceClass()); if (referenceDescriptor == null) { throw QueryException.descriptorIsMissing(getReferenceClass(), this); } setDescriptor(referenceDescriptor); } }
/** * INTERNAL: * Ensure that the descriptor has been set. */ public void checkDescriptor(AbstractSession session) throws QueryException { if (this.descriptor == null) { if (getReferenceClass() == null) { throw QueryException.referenceClassMissing(this); } ClassDescriptor referenceDescriptor; //Bug#3947714 In case getSelectionObject() is proxy if (getSelectionObject() != null && session.getProject().hasProxyIndirection()) { referenceDescriptor = session.getDescriptor(getSelectionObject()); } else { referenceDescriptor = session.getDescriptor(getReferenceClass()); } if (referenceDescriptor == null) { throw QueryException.descriptorIsMissing(getReferenceClass(), this); } setDescriptor(referenceDescriptor); } }
/** * INTERNAL: * Ensure that the descriptor has been set. */ public void checkDescriptor(AbstractSession session) throws QueryException { if (this.descriptor == null) { if (getReferenceClass() == null) { throw QueryException.referenceClassMissing(this); } ClassDescriptor referenceDescriptor; //Bug#3947714 In case getSelectionObject() is proxy if (getSelectionObject() != null && session.getProject().hasProxyIndirection()) { referenceDescriptor = session.getDescriptor(getSelectionObject()); } else { referenceDescriptor = session.getDescriptor(getReferenceClass()); } if (referenceDescriptor == null) { throw QueryException.descriptorIsMissing(getReferenceClass(), this); } setDescriptor(referenceDescriptor); } }
/** * INTERNAL: * Ensure that the descriptor has been set. */ public void checkDescriptor(AbstractSession session) throws QueryException { if (this.descriptor == null) { if (getReferenceClass() == null) { throw QueryException.referenceClassMissing(this); } ClassDescriptor referenceDescriptor; //Bug#3947714 In case getSelectionObject() is proxy if (getSelectionObject() != null && session.getProject().hasProxyIndirection()) { referenceDescriptor = session.getDescriptor(getSelectionObject()); } else { referenceDescriptor = session.getDescriptor(getReferenceClass()); } if (referenceDescriptor == null) { throw QueryException.descriptorIsMissing(getReferenceClass(), this); } setDescriptor(referenceDescriptor); } }
throw QueryException.referenceClassMissing(this);
throw QueryException.referenceClassMissing(this);
throw QueryException.referenceClassMissing(this);
/** * INTERNAL: * Prepare the receiver for execution in a session. */ protected void prepare() throws QueryException { super.prepare(); if (getReferenceClass() == null) { throw QueryException.referenceClassMissing(this); } if (getDescriptor() == null) { ClassDescriptor referenceDescriptor = getSession().getDescriptor(getReferenceClass()); if (referenceDescriptor == null) { throw QueryException.descriptorIsMissing(getReferenceClass(), this); } setDescriptor(referenceDescriptor); } if (getDescriptor().isAggregateDescriptor()) { throw QueryException.aggregateObjectCannotBeDeletedOrWritten(getDescriptor(), this); } getQueryMechanism().prepareDeleteAll(); }
/** * INTERNAL: * Prepare the receiver for execution in a session. */ protected void prepare() throws QueryException { super.prepare(); if (getReferenceClass() == null) { throw QueryException.referenceClassMissing(this); } if (getDescriptor() == null) { ClassDescriptor referenceDescriptor = getSession().getDescriptor(getReferenceClass()); if (referenceDescriptor == null) { throw QueryException.descriptorIsMissing(getReferenceClass(), this); } setDescriptor(referenceDescriptor); } if (getDescriptor().isAggregateDescriptor()) { throw QueryException.aggregateObjectCannotBeDeletedOrWritten(getDescriptor(), this); } getQueryMechanism().prepareDeleteAll(); }
/** * INTERNAL: * Prepare the receiver for execution in a session. */ protected void prepare() throws QueryException { super.prepare(); if (getReferenceClass() == null) { throw QueryException.referenceClassMissing(this); } if (getDescriptor() == null) { ClassDescriptor referenceDescriptor = getSession().getDescriptor(getReferenceClass()); if (referenceDescriptor == null) { throw QueryException.descriptorIsMissing(getReferenceClass(), this); } setDescriptor(referenceDescriptor); } if (getDescriptor().isAggregateDescriptor()) { throw QueryException.aggregateObjectCannotBeDeletedOrWritten(getDescriptor(), this); } getQueryMechanism().prepareDeleteAll(); }