org.eclipse.persistence.exceptions.QueryException.referenceClassMissing()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(9.1k)|赞(0)|评价(0)|浏览(81)

本文整理了Java中org.eclipse.persistence.exceptions.QueryException.referenceClassMissing方法的一些代码示例,展示了QueryException.referenceClassMissing的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。QueryException.referenceClassMissing方法的具体详情如下:
包路径:org.eclipse.persistence.exceptions.QueryException
类名称:QueryException
方法名:referenceClassMissing

QueryException.referenceClassMissing介绍

暂无

代码示例

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core

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

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

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

代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

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

代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

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

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core

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

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

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

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

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

代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

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

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core

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

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core

throw QueryException.referenceClassMissing(this);

代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

throw QueryException.referenceClassMissing(this);

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

throw QueryException.referenceClassMissing(this);

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * 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();
}

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

/**
 * 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();
}

代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * 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();
}

相关文章

微信公众号

最新文章

更多

QueryException类方法